Skip to content

[0.21.0] shared js file content changes even if there is no code change #434

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

Closed
jfcherng opened this issue Nov 8, 2018 · 5 comments · Fixed by #441
Closed

[0.21.0] shared js file content changes even if there is no code change #434

jfcherng opened this issue Nov 8, 2018 · 5 comments · Fixed by #441
Labels

Comments

@jfcherng
Copy link

jfcherng commented Nov 8, 2018

Problem

The js file content of shared entry (usually named as app.HASH.js or vendor.HASH.js) varies between builds even if there is no source code change.

Reproduce

https://github.com/jfcherng/encore-shared-content-unstable

@weaverryan
Copy link
Member

This stuff is very complex - so it's very possible. We should check into it - thanks for the reproducer!

By the way, do you see a new hash EVERY time you build... even if you literally change NOTHING? Or do you at least need to change some content, but these 2 files are unchanged, and so should not have a new hash?

Thanks!

@jfcherng
Copy link
Author

jfcherng commented Nov 8, 2018

@weaverryan

I may run the build process even if there is no js code change (say I only edit some css files or other non-js assets whatever). Ideally, I hope the vendor.HASH.js remain the same file name and the same file content since I do not touch js-related things.

Currently, the file content would change (due to file content changes in _tmp_shared.HASH.js) but the HASH remains the same (because _tmp_shared.HASH.js is appened to vendor.HASH.js in the done compiler hook?). So I guess the more basic problem would be why the content of _tmp_shared.HASH.js changes between builds.

The generated codes still work fine though. The only inconvenience to me is that vendor.HASH.js would be marked as file content changed between builds in my assets version control.

@Lyrkan
Copy link
Collaborator

Lyrkan commented Nov 8, 2018

Maybe related to #361 (comment)?

@jfcherng
Copy link
Author

jfcherng commented Nov 8, 2018

@Lyrkan It looks quite similar.

In #361 @symfony/encore 0.21.0, there are unwanted changes between builds:

  • _tmp_shared.js: content and hash
  • shared.js: content (because _tmp_shared.js is appended to it in the done compiler hook)

@weaverryan
Copy link
Member

Fixed in #441!

The issue was an internal detail of the "hack" that makes this work - a randomly-named file was created. This randomness caused the content/hash changed on _tmp_shared.js.

weaverryan added a commit that referenced this issue Nov 16, 2018
…erryan)

This PR was squashed before being merged into the master branch (closes #441).

Discussion
----------

Appending the _tmp_shared contents via an earlier hook

Fixes #435 and fixes #434

Commits
-------

42ec9ef Using a static, not random filename for the _tmp_shared entry
c2ba1d6 updating shared-entry-contact-plugin code for emit
fbf6121 removing non-existent method on this hook
5f9d2ee Appending the _tmp_shared contents via an earlier hook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants