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

[compiler][be] Clean up compilation skipping logic in Program #30642

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

mofeiZ
Copy link
Contributor

@mofeiZ mofeiZ commented Aug 8, 2024

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 10:46pm

return;
}

const environment = parseEnvironmentConfig(pass.opts.environment ?? {});
/*
* TODO(lauren): Remove pass.opts.environment nullcheck once PluginOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, we waited until compiling a function to validate environment configs. Let's just do this unconditionally -- this should be a fatal error and hopefully never happens in prod

@@ -514,43 +486,29 @@ export function compileProgram(
externalFunctions.push(gating);
}

const lowerContextAccess = pass.opts.environment?.lowerContextAccess;
const lowerContextAccess = environment.lowerContextAccess;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we're able to rely on the parsed / validated EnvironmentConfig, which comes with default values (instead of using a PartialEnvironmentConfig and duplicating defaults

@mofeiZ mofeiZ marked this pull request as ready for review August 8, 2024 22:32
…ram"

---
Drive-by cleanup when writing #30643


[ghstack-poisoned]
@mofeiZ mofeiZ merged commit 6764a8c into gh/mofeiZ/15/base Aug 9, 2024
19 checks passed
mofeiZ added a commit that referenced this pull request Aug 9, 2024
ghstack-source-id: fe2c81de9d4f41a787c690b722cbcff55eb18ac3
Pull Request resolved: #30642
@mofeiZ mofeiZ deleted the gh/mofeiZ/15/head branch August 9, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants