-
Notifications
You must be signed in to change notification settings - Fork 386
[babel-plugin] create new defineConsts file extension #1289
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
Conversation
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
9a66067 to
decc03d
Compare
fcbef84 to
c29c5ab
Compare
|
Tested on Compiler error with Resolves correctly with |
Depending on the way users serve their CSS, you may want to declare a separate filepath for constants. For example, when using directory-based bundling, you'd need to include all constants files alongside each folder to have constants work globally.
This PR adds a
.constappended variant to the suffix defined inthemeFileExtension(.stylex.jsby default) so packagers can statically analyze which files contain constants. I considered making this configurable likethemeFileExtension, but decided to keep this hardcoded for now for simplicity.As a follow up, we should update the
enforce-extensionlint rule to handledefineConstsunder the new extension, with a config to allow users to hard enforce the.stylex.const.jsextension (ie. nodefineConstsin the default theme extension). The default behaviour will be that both.stylex.jsand.stylex.const.jswill be considered valid extensions for files declaringdefineConstsexports.Also contains a fix to
valid-stylesto respect user configuredthemeFileExtension