Fix fetch public/fastboot-fetch.js module definition for Fastboot#167
Merged
xg-wang merged 2 commits intoember-cli:masterfrom Dec 7, 2018
Merged
Fix fetch public/fastboot-fetch.js module definition for Fastboot#167xg-wang merged 2 commits intoember-cli:masterfrom
xg-wang merged 2 commits intoember-cli:masterfrom
Conversation
Member
|
What if ember-fetch is never the top level addon? What if it is only used as a subdep with several versions? |
Member
Author
|
@Turbo87 So if |
9c5ab46 to
978f2d8
Compare
Member
|
@xg-wang this PR seems to contain a lot of unrelated changes now. can you make sure to open dedicated PRs for those unrelated changes? |
40f4ddb to
e970738
Compare
Member
Author
|
#171 is merged, this good to go? |
Define fetch module with a setupFastboot method export to set host and protocol for every instance. Rename public/fastboot-fetch.js to public/fetch-fastboot.js to avoid lower version ember-fetch overwrite this file. Overrides treeForPublic in index.js to only include public asset if top level addon to avoid any future rename.
|
We may want to rethink this design a bit now that |
Member
|
Agree |
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #166, depends on #171
In v6.2.0
fetch/setupwas added topublic/fastboot-fetch.jsso we can setupfetchmodule with fastboot request info. However this file will be overwritten by any addon's dependencyember-fetchbased on last-write-win. To fix this:lower version ember-fetch overwrite this file.
level addon.
For example, top level addon
ember-fetchis 6.2.1, transitive dependency is anything before 6.2.0 will result in this dist:6.2.1 as top level addon will
manifest.vendorFiles.push('ember-fetch/fetch-fastboot.js');so thefastboot.jswill just be ignored.This commit also defines fetch module with a
setupFastbootmethod to set host andprotocol for every instance. This could avoid module redefinition.