Skip to content

WIP: Using rollup for theme JS compilation #33103

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

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from

Conversation

davidtaylorhq
Copy link
Member

No description provided.

davidtaylorhq added a commit that referenced this pull request Jun 6, 2025
Theme translations are very simple JS, and do not need to be run through the theme transpiler. This brings their format in-line with core/plugin translations.

Extracted from #33103
davidtaylorhq added a commit that referenced this pull request Jul 14, 2025
davidtaylorhq added a commit that referenced this pull request Jul 14, 2025
It's possible for different source files to generate the same compiled output (e.g. if only a comment changes), so we should include the sourcemap content when calculating a digest.

Extracted from #33103
davidtaylorhq added a commit that referenced this pull request Jul 14, 2025
davidtaylorhq added a commit that referenced this pull request Jul 14, 2025
It's possible for different source files to generate the same compiled
output (e.g. if only a comment changes), so we should include the
sourcemap content when calculating a digest.

Extracted from #33103
davidtaylorhq added a commit that referenced this pull request Jul 16, 2025
Previously, all script tags in a theme field would be combined into a single `.js` bundle along with the `text/discourse-plugin` modules. This led to some unexpected run order, and also makes it hard to implement the `type=module` change being developed in #33103.

This commit refactors things so that each raw script gets extracted into its own `.js` bundle, which is then placed in exactly the same place in the HTML.
davidtaylorhq added a commit that referenced this pull request Jul 16, 2025
Previously, all script tags in a theme field would be combined into a
single `.js` bundle along with the `text/discourse-plugin` modules. This
led to some unexpected run order, and also makes it hard to implement
the `type=module` change being developed in #33103.

This commit refactors things so that each raw script gets extracted into
its own `.js` bundle, which is then placed in exactly the same place in
the HTML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants