Skip to content
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

draft: move all build constants for bundlers instead of babel #34277

Closed
wants to merge 10 commits into from

Conversation

samouri
Copy link
Member

@samouri samouri commented May 7, 2021

summary
We have a number of build-time constants that are all replaced by babel. Bundlers/compilers are actually a more natural time to perform this substitution. In fact, both esbuild and closure support it out of the box.

@samouri samouri changed the title Build consts move all build constants for bundlers instead of babel May 7, 2021
@samouri samouri changed the title move all build constants for bundlers instead of babel draft: move all build constants for bundlers instead of babel May 7, 2021
// Therefore, all conditions set by ESM will also hold for SxG.
// However, we will also need to introduce a separate IS_SxG flag
// for conditions only true for SxG.
const replacements = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review: figure out the rest of the experiments

* Build Constants -- see build-system/build-constants.js for definition.
*/
/** @define {boolean} */
var IS_FORTESTING = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe split these out and stick em in something like compiler-constants.extern.js or something similar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this ever works...sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I've extracted the "combine all into one" element into: #34327

@samouri
Copy link
Member Author

samouri commented Jun 9, 2021

Closing because closure compiler does not support replacements within esm :(

@samouri samouri closed this Jun 9, 2021
@samouri samouri deleted the build-consts branch June 9, 2021 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants