Skip to content

DEV: @babel/plugin-proposal-decorators -> decorator-transforms#27260

Merged
davidtaylorhq merged 1 commit intomainfrom
decorator-transforms-take-2
Jun 10, 2024
Merged

DEV: @babel/plugin-proposal-decorators -> decorator-transforms#27260
davidtaylorhq merged 1 commit intomainfrom
decorator-transforms-take-2

Conversation

@davidtaylorhq
Copy link
Copy Markdown
Member

@davidtaylorhq davidtaylorhq commented May 30, 2024

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.

This was previously reverted in 97847f6. This version includes a babel transformation which works around the bug in Safari <= 15.

For Cloudflare compatibility issues, check https://meta.discourse.org/t/311390

@davidtaylorhq davidtaylorhq force-pushed the decorator-transforms-take-2 branch from be7c771 to 43625bb Compare May 30, 2024 12:01
@davidtaylorhq davidtaylorhq force-pushed the decorator-transforms-take-2 branch from 43625bb to 8a94aa1 Compare June 10, 2024 14:26
@davidtaylorhq davidtaylorhq marked this pull request as ready for review June 10, 2024 14:28
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.
@davidtaylorhq davidtaylorhq force-pushed the decorator-transforms-take-2 branch from 8a94aa1 to 07cacba Compare June 10, 2024 14:31
@davidtaylorhq davidtaylorhq merged commit 565c753 into main Jun 10, 2024
@davidtaylorhq davidtaylorhq deleted the decorator-transforms-take-2 branch June 10, 2024 14:51
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