DEV: Upgrade babel & remove vendored safari-bugfix transformation (#28208)

The Safari 15 bugfix has been rolled into @babel/preset-env in the most recent version, so we no longer need to carry our vendored copy.

This commit updates @babel/preset-env, runs npx yarn-deduplicate yarn.lock, and removes the vendored transform.

This commit also refactors our theme transpiler to use @babel/preset-env, with the same list of target browsers as our ember-cli build uses. This means we no longer need to maintain a separate list of babel transforms for themes.
This commit is contained in:
David Taylor
2024-08-05 10:35:26 +01:00
committed by GitHub
parent 6d1c2a3d5a
commit 1b28b8e169
15 changed files with 611 additions and 782 deletions

View File

@ -6,15 +6,6 @@ class DiscourseJsProcessor
class TranspileError < StandardError
end
# To generate a list of babel plugins used by ember-cli, set
# babel: { debug: true } in ember-cli-build.js, then run `yarn ember build -prod`
DISCOURSE_COMMON_BABEL_PLUGINS = [
["decorator-transforms", { runEarly: true }],
"proposal-class-static-block",
"transform-parameters",
"proposal-export-namespace-from",
]
def self.ember_cli?(filename)
filename.include?("/app/assets/javascripts/discourse/dist/")
end
@ -161,7 +152,6 @@ class DiscourseJsProcessor
filename: logical_path || "unknown",
extension: extension,
themeId: theme_id,
commonPlugins: DISCOURSE_COMMON_BABEL_PLUGINS,
},
)
end