Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change setupStore helper default serializer to JSONAPISerializer #4754

Closed
hjdivad opened this issue Jan 16, 2017 · 5 comments
Closed

Change setupStore helper default serializer to JSONAPISerializer #4754

hjdivad opened this issue Jan 16, 2017 · 5 comments
Labels
🏷️ cleanup This PR primarily removes deprecated functionality

Comments

@hjdivad
Copy link
Member

hjdivad commented Jan 16, 2017

It's currently JSONSerializer which causes oddities during test refactoring, as many tests push json-api documents into the store and you sometimes want to refactor this to be the fulfillment value of an adapter method.

@hd719
Copy link

hd719 commented Apr 12, 2017

Hello I am new to open source and I would like to contribute to this project.

-Thank you!

@hjdivad
Copy link
Member Author

hjdivad commented Apr 12, 2017

hi @hd719 it's awesome that you want to help

This is an issue around cleaning up the tests.

In particular, when setting up a mock store, the default serializer is DS.JSONSerializer which is inconvenient because the internal representation is essentially json-api, so it would be much nicer to make it DS.JSONAPISerializer.

So doing this cleanup consists of

  1. run the tests, verify they're green.
  2. change that line to make the default serializer DS.JSONAPISerializer
  3. see what tests break

Just doing this is already useful, but the next step is to clean up the tests that break. Likely some of them will simply depend on manually specifying a serializer if they were relying on the current default of DS.JSONSerializer.

Here's an example of manually registering a serializer: https://github.com/emberjs/data/blob/master/tests/integration/store/query-record-test.js#L76 (note that env here is the result of setupStore, created in the beforeEach of this test).

@eshtadc
Copy link
Contributor

eshtadc commented May 30, 2017

I didn't see this ever get a PR with all the test changes so I went ahead with one. Chose to update test formats since I figured they were testing the "default" except in cases where it really seemed to have an intention of testing JSONSerializer specifically. One of my first ember-data PRs so happy for any feedback :)

@hjdivad
Copy link
Member Author

hjdivad commented Jun 13, 2017

#5003

bmac pushed a commit that referenced this issue Jun 13, 2017
#5003)

* Change setupStore helper default serializer to JSONAPISerializer #4754

* Update test per review feedback
@bmac
Copy link
Member

bmac commented Jun 13, 2017

Closed by #5003

@bmac bmac closed this as completed Jun 13, 2017
runspired pushed a commit to runspired/data that referenced this issue Jun 16, 2017
…rjs#4754 (emberjs#5003)

* Change setupStore helper default serializer to JSONAPISerializer emberjs#4754

* Update test per review feedback
sudowork pushed a commit to sudowork/data that referenced this issue Jun 20, 2017
…rjs#4754 (emberjs#5003)

* Change setupStore helper default serializer to JSONAPISerializer emberjs#4754

* Update test per review feedback
@runspired runspired added 🏷️ cleanup This PR primarily removes deprecated functionality and removed Cleanup labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ cleanup This PR primarily removes deprecated functionality
Projects
None yet
Development

No branches or pull requests

5 participants