-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ESM Preload Fix #7161
base: main
Are you sure you want to change the base?
ESM Preload Fix #7161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to cherry pick to main_v1 as well?
Yep we do |
By removing hash, this will lead to lack of cache invalidations. This will break what developers usually do. By changing this, developers will have do more sophisticated rules on caching, and won't be able to use hard caching for scripts. This is undesirable. Please do not change such well working rule. The correct solution to this problem is to figure out how to ensure user imported script urls are pre-processed correctly, so they match. |
Could you clarify? The hash param is not included in the classic scripts preload either, so this better aligns the two |
I've just checked, and you are correct, there is no hash. Has this been changed at any point? As there was a rule: every asset within assets/files used hashes, so it could be hard cached (200 local storage). Everything outside of that folder is soft-cached (304). |
Yep, script assets do not seem to have a file hash. See 7fe92ef#diff-59cbf44184755e9db171fb7873b5b92241e4bc05bffd75d001d9e6f738c38700R138-R141 The benefits around having a hash are valid though, but need further investigation |
Just to follow up; this needs to be checked with the editor build/export process |
This PR fixes playcanvas/editor#1236 along with https://github.com/playcanvas/editor-ui/pull/460.
This removes the
?hash=
appended to ESM paths during preloading. This ensures it matches the cache key used for explicit imports in user code, resulting in the same module.I confirm I have read the contributing guidelines and signed the Contributor License Agreement.