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
core mode: add version() #35298
core mode: add version() #35298
Conversation
86542de
to
9353008
Compare
99f688c
to
f53e7f6
Compare
f53e7f6
to
888f342
Compare
Hey @jridgewell! These files were changed:
|
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.
I know this used to live in mode, but WDYT about moving it into #core/constants
? Then again, I suppose the same could be said of all the mode constants, so I'm not sure what makes the most sense. Approving to unblock.
What is mode but a set of constants :) |
Things like minified/esm/fortesting etc are really the "mode" in which it was compiled, whereas the RTV is very much a constant. My feeling is that |
I'd push back on the concept of "mode it is compiled in". I don't know of a good definition for what constitutes a mode and what doesn't. Instead I'd argue the clean separation of constants exists between build constants vs. source constants. |
I don't feel strongly enough, this is fine by me 👍🏻 |
888f342
to
9e7c915
Compare
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.
I'm curious if it would be sensible to rename this to just mode.rtv()
? I feel like it's a ubiquitous-enough term that it would be very easily understood
I'm fine with that. Separate note: DCE doesn't seem to be working. I think we can make the |
Working for what? DCE should be working for the true/false values; I don't believe it would inline the RTV string if that's what you're expecting. |
Actually...this isn't |
b42cbf6
to
276aee1
Compare
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.
This is great! Thanks for doing it
Side note: I've found it easier to shift logic to core
in one PR and have mode.js
reference it, then (in theory) eventually update callsites/transforms in a separate PR. If you feel motivated to keep working on these, uses of getMode(win).test
, and getMode(win).localDev
could both be updated to the core versions as well; I moved the logic to core, but didn't update all the files because of OWNERS approval 😆
build-system/babel-plugins/babel-plugin-amp-mode-transformer/index.js
Outdated
Show resolved
Hide resolved
276aee1
to
d334977
Compare
d334977
to
40eb85e
Compare
summary
Adds
.version
to#core/mode
. Removes it fromsrc/internal-version.js
.