-
Notifications
You must be signed in to change notification settings - Fork 605
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
Don't make duplicated requests through Ember Data #2087
Conversation
r? @smarnach (rust_highfive has picked a reviewer for you, use r? to override) |
a38f038
to
a8c37cf
Compare
Based on some concerns raised on Discord, lets reassign. r? @locks |
From Discord:
I don't have strong opinion on ember-data-storefront. If we don't want to add the package, can we inject |
Ping @locks? |
Looking into it today! |
☔ The latest upstream changes (presumably #2122) made this pull request unmergeable. Please resolve the merge conflicts. |
@locks We could inject something that queries Fastboot's Shoebox on adapters by having our own initializer, but Ember's Adapter API doesn't provide a good hook point which we can utilize. Both https://api.emberjs.com/ember-data/3.4/classes/DS.RESTAdapter?show=private Surprisingly even ember-cli-fastboot is overriding _ajaxRequest. |
@locks - I'd like to hear your thoughts if you have some time. |
Sorry, busy days lately. If I can't address this by Monday I will step out of the way. |
f4e1ce6
to
a369d6e
Compare
I have removed |
c3be73c
to
a375466
Compare
@kzys I had some trouble testing this in my staging area at https://jtgeibel-staging-crates-io.herokuapp.com/. (This PR is currently deployed there with So I focused on getting a better local environment set up. I've opened #2215 and I've got things working there now. I'd like to do a bit more testing, but this PR seems to work well for me locally (with and without fastboot) when merged with this PR. I'm not sure what the issue with |
Hmm, I think it should be directly request the backend, but I'm not 100% sure. |
I just found out about https://github.com/cardstack/ember-data-fastboot, which should help with the boilerplate. |
☔ The latest upstream changes (presumably #2290) made this pull request unmergeable. Please resolve the merge conflicts. |
@locks It is somewhat coupled with JSONAPISerializer, which we don't use.
|
I cannot keep up with all the refactorting the team is doing. Ping me once that is over... |
a375466
to
be21bb7
Compare
This will prevent duplicated requests on `/crates` and other Ember Data-powered pages.
The options parameter is used to represent query parameters. So it must be included to differentiate URLs with different query parameters.
be21bb7
to
9578812
Compare
In #7301 we've removed most of the unused fastboot code, since it doesn't really seem well supported by Ember.js these days. Since this PR is building on top of fastboot, I'll close it for now. Thank you for your work anyway! :) |
ember-data-storefront provides FastbootAdapter which caches XHRs in
Fastboot's Shoebox.
This will prevent duplicated requests on /crates and other
Ember Data-powered pages.