-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
DEV: @babel/plugin-proposal-decorators
-> decorator-transforms
#25290
Conversation
This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days. |
7eef1e8
to
26ccad4
Compare
6fa1e7b
to
c99b9e9
Compare
13d9654
to
0547e07
Compare
@@ -92,7 +92,7 @@ class MyClass { | |||
JS | |||
|
|||
result = DiscourseJsProcessor.transpile(script, "blah", "blah/mymodule") | |||
expect(result).to include("_applyDecoratedDescriptor") | |||
expect(result).to include("static #_ = dt7948.n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is dt7948
name stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(obviously wouldn't consider it 'public API', but I think it's stable enough for us to use in this test assertion)
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. This improves the developer experience and performance. In local testing with Google's 'tachometer' tool, this reduces Discourse's 'init-to-render' time by around 3-4% (230ms -> 222ms). It reduces our initial gzip'd JS payloads by 3.2% (2.43MB -> 2.35MB), or 7.5% (14.5MB -> 13.4MB) uncompressed.
0547e07
to
5b2301d
Compare
I just wanted to let you know that In a theme component, I was doing the following: api.modifyClass("service:chat-state-manager", {
@tracked isChatSidebarActive: false,
...
}); However, after this PR, it no longer works, and ƒ () {
return propertyDesc;
} Maybe it was wrong from the start doing that, especially in a native class. (if #24957 is merged, I would assume it would be okay) |
…orms` (#25290)" This reverts commit 0f45208. This has led to two problems: 1. An incompatibility with Cloudflare's "auto minify" feature. They've deprecated this feature because of incompatibility with modern JS syntax. But unfortunately it will remain enabled on existing properties until 2024-08-05. 2. Discourse fails to boot in Safari 15. This is strange, because Safari does support all the required features in our production JS bundles. Even more strangely, things start working as soon as you open the developer tools. That suggests the cause could be a Safari bug rather than a simple incompatibility. Reverting while we work out a path forward on both those issues.
…orms` (#25290)" (#26971) This reverts commit 0f45208. This has led to two problems: 1. An incompatibility with Cloudflare's "auto minify" feature. They've deprecated this feature because of incompatibility with modern JS syntax. But unfortunately it will remain enabled on existing properties until 2024-08-05. 2. Discourse fails to boot in Safari 15. This is strange, because Safari does support all the required features in our production JS bundles. Even more strangely, things start working as soon as you open the developer tools. That suggests the cause could be a Safari bug rather than a simple incompatibility. Reverting while we work out a path forward on both those issues.
…orms` (discourse#25290)" (discourse#26971) This reverts commit 0f45208. This has led to two problems: 1. An incompatibility with Cloudflare's "auto minify" feature. They've deprecated this feature because of incompatibility with modern JS syntax. But unfortunately it will remain enabled on existing properties until 2024-08-05. 2. Discourse fails to boot in Safari 15. This is strange, because Safari does support all the required features in our production JS bundles. Even more strangely, things start working as soon as you open the developer tools. That suggests the cause could be a Safari bug rather than a simple incompatibility. Reverting while we work out a path forward on both those issues.
This pull request has been mentioned on Discourse Meta. There might be relevant details there: https://meta.discourse.org/t/this-error-is-a-problem/307647/3 |
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. This improves the developer experience and performance.
In local testing with Google's 'tachometer' tool, this reduces Discourse's 'init-to-render' time by around 3-4% (230ms -> 222ms).
It reduces our initial gzip'd JS payloads by 3.2% (2.43MB -> 2.35MB), or 7.5% (14.5MB -> 13.4MB) uncompressed.