Skip to content

Add a version comment to the emoji preval-ed file so it is regenerated#28700

Merged
Gargron merged 1 commit intomastodon:mainfrom
renchap:regenerate-emoji-preval
Jan 12, 2024
Merged

Add a version comment to the emoji preval-ed file so it is regenerated#28700
Gargron merged 1 commit intomastodon:mainfrom
renchap:regenerate-emoji-preval

Conversation

@renchap
Copy link
Copy Markdown
Member

@renchap renchap commented Jan 11, 2024

This is a follow up on #28404

In the PR above, the emoji data has been changed. But emojii_compressed.js is using babel-preval, so it is executed when processed with Babel, and then Babel will cache the resulting code.

This causes the frontend to no longer load after deploying the change, because Babel did not detect any change in emoji_compressed.js (the real file), so it re-used it from its cache, but the actuel content that needs to be consumed by Webpack and appear in the final bundle is different (it contains the new emoji data).

Adding this comment will change the checksum for emoji_compressed.js, which should invalidate Babel's cache and force the file to be executed again on the next build.

Note: I have not tested that it works

This is a follow up on mastodon#28404

In the PR above, the emoji data has been changed. But `emojii_compressed.js` is using `babel-preval`, so it is executed when processed with Babel, and then Babel will cache the resulting code.

This causes the frontend to no longer load after deploying the change, because Babel did not detect any change in `emoji_compressed.js` (the real file), so it re-used it from its cache, but the actuel content that needs to be consumed by Webpack and appear in the final bundle is different (it contains the new emoji data).

Adding this comment will change the checksum for `emoji_compressed.js`, which should invalidate Babel's cache and force the file to be executed again on the next build.
@renchap renchap force-pushed the regenerate-emoji-preval branch from ecad14e to 01bb76a Compare January 11, 2024 21:08
@renchap
Copy link
Copy Markdown
Member Author

renchap commented Jan 11, 2024

Update: tested it locally by checking out a commit before #28404, running the dev server, then checking out a commit after #28404, reloading in the browser, seeing that there is a JS error, adding the comment to emoji_compressed.js, and seeing that Webpack/Babel correctly recompute the file.

@Gargron Gargron added this pull request to the merge queue Jan 12, 2024
Merged via the queue into mastodon:main with commit 383be17 Jan 12, 2024
mjankowski pushed a commit to mjankowski/mastodon that referenced this pull request Jan 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants