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

Asset map not being added to index.html #37

Closed
backspace opened this issue May 8, 2018 · 7 comments
Closed

Asset map not being added to index.html #37

backspace opened this issue May 8, 2018 · 7 comments

Comments

@backspace
Copy link

backspace commented May 8, 2018

Hello again! I’ve been trying in this branch to test out integrating your promising addon into our PR deployment workflow, which will address a long-standing problem where dynamically-sourced images don’t display properly. I’m finding that the assetMap file isn’t being included in the index.html.

I changed the dynamically-sourced digit images on the landing page to use the asset map, to no avail:

image

Here’s what it looks like on the production site, for reference:

image

The PR deployment is here, in case that’s helpful. If you look at the source for index.html, you can see the asset map isn’t loaded. Can you imagine any reason why this would be the case? I’m confused. I suspect there’s some dreadfully obvious thing I’m missing.

I really look forward to being able to use your addon; while I’m aware of the limitation that dynamically-sourced images don’t load properly in PR deployments, I’m continually having to assure people that it’s a known problem when they’re looking at them to check into other changes. Thanks for your work on this!

@RuslanZavacky
Copy link
Contributor

Hey, @backspace thank you for detailed Issue :) it helped a lot. Also, I do apologize that I haven't paid enough attention to this project lately.

I've checked out travis-web branch that you were working on, and was able to make fingerprinting work :) and I've found a bug in ember-cli-ifa - #38

Can you please try out this branch and see if it will work for you?

P.S I had to add fingerprint.enabled = true; in ember-cli-build.js so it starts to fingerprint + changes from the branch that I've specified.

@RuslanZavacky
Copy link
Contributor

Also, keep in mind that we currently put asset map inside vendor.js, you can check if it is there via grep vendor-___.js file

grep -A 9 "get-asset" dist/assets/vendor-201ff432408a4e816bc870f0204be4d7.js

(use your vendor-hash.js file) :)

@backspace
Copy link
Author

No need to apologise! I know it can be a lot of work to maintain an addon, and you’ve already spent so much time addressing my troubles 😳

Thanks for pointing out that the asset map download is within the vendor file, that explains why I couldn’t find it in index.html. (But it wasn’t there even with inline: true? 🤔) But I don’t see it being fetched in the developer tools network tab, which I expect should happen? This is true even on your fix-regex-test-for-vendor branch.

There are a lot of moving parts here; I’m only testing this via PR deployment because that’s the environment I’m targeting. If I can get it to work as desired, then I’ll add the necessary flags for different handling in other environments.

@RuslanZavacky
Copy link
Contributor

@backspace got to a root of this... latest release and assumption to put asset map into vendor.js didn't work well, unfortunately.

I've attached a git patch with changes that I've used for travis-web to make assets work, but it essentially disables SRI. I don't recommend to use it in prod for now. I will work on the next version of cli-ifa to fallback to our previous approach with index.html placeholders.

working_without_sri.txt

@backspace
Copy link
Author

Thanks for the further investigation! I’ve reached the end of my timebox for experimenting with this for now, but I appreciate all your support. I look forward to when I can use this to solve the longstanding dynamic assets problem. 💞

@RVenkatesh
Copy link

RVenkatesh commented Jan 9, 2019

Any updates on this? Because for me since assetMap-{#hash}.json is loaded from inside vendor.js, whenever there is no change in vendor.js, the cached version of it will be loaded in the browser, which in turn will try to load the old assetMap-{#hash}.json file. Any help would be great.

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 23, 2019

resolved by #40 AFAICT

@Turbo87 Turbo87 closed this as completed Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants