mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 17:01:09 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user