-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV:
@babel/plugin-proposal-decorators
-> decorator-transforms
decorator-transforms (https://github.com/ef4/decorator-transforms) is a modern replacement for babel's plugin-proposal-decorators. It provides a decorator implementation using modern browser features, without needing to enable babel's full suite of class feature transformations. Initial tests suggest: - Our largest JS chunk drops from 4.38MB (991.71kb gzip) to 4.18MB (956.49kb gzip), so that's a 3.5% saving on gzip size - Tachometer benchmarks suggest a 1-2% speedup in the time taken to boot the app and render the topic list ``` ┌───────────┬─────────────────────┬─────────────────┬─────────────────┐ │ Benchmark │ Avg time │ vs before │ vs after │ ├───────────┼─────────────────────┼─────────────────┼─────────────────┤ │ before │ 220.22ms - 222.21ms │ │ slower │ │ │ │ - │ 1% - 2% │ │ │ │ │ 1.39ms - 4.09ms │ ├───────────┼─────────────────────┼─────────────────┼─────────────────┤ │ after │ 217.57ms - 219.39ms │ faster │ │ │ │ │ 1% - 2% │ - │ │ │ │ 1.39ms - 4.09ms │ │ └───────────┴─────────────────────┴─────────────────┴─────────────────┘ ``` Currently installs decorator-transforms from a fork which includes [two pending fixes](https://github.com/ef4/decorator-transforms/pulls)
- Loading branch information
1 parent
14fc029
commit 26ccad4
Showing
17 changed files
with
158 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/node_modules/decorator-transforms/dist/index.js b/node_modules/decorator-transforms/dist/index.js | ||
index a7147a6..5ff5aef 100644 | ||
--- a/node_modules/decorator-transforms/dist/index.js | ||
+++ b/node_modules/decorator-transforms/dist/index.js | ||
@@ -4,10 +4,13 @@ import { | ||
import "./chunk-CSAU5B4Q.js"; | ||
|
||
// src/index.ts | ||
-import { createRequire } from "module"; | ||
import { ImportUtil } from "babel-import-util"; | ||
-var req = createRequire(import.meta.url); | ||
-var { default: decoratorSyntax } = req("@babel/plugin-syntax-decorators"); | ||
+ | ||
+// https://github.com/ef4/decorator-transforms/pull/27 | ||
+import PluginSyntaxDecorators from "@babel/plugin-syntax-decorators"; | ||
+const decoratorSyntax = | ||
+ PluginSyntaxDecorators.default || PluginSyntaxDecorators; | ||
+ | ||
function makeVisitor(t) { | ||
return { | ||
Program(path, state) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters