Durable use cache: optimize env var existence checks - #98504
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Tests PassedCommit: 4068e2f |
mischnic
marked this pull request as ready for review
September 10, 2026 14:00
mischnic
changed the base branch from
mischnic/env-var-existence
to
graphite-base/98504
September 10, 2026 14:01
mischnic
force-pushed
the
graphite-base/98504
branch
from
September 10, 2026 14:02
6a85f73 to
26b2bbe
Compare
mischnic
force-pushed
the
mischnic/env-var-existence-e2e
branch
from
September 10, 2026 14:03
a8d415f to
bd20198
Compare
mischnic
force-pushed
the
mischnic/env-var-existence-e2e
branch
from
September 10, 2026 16:54
dfb8475 to
e7699fe
Compare
| prop: prop_value, | ||
| ast_path: as_parent_path_in(self.arena, ast_path), | ||
| span: member_expr.span(), | ||
| in_truthiness_context: is_in_boolean_context( |
Contributor
There was a problem hiding this comment.
we could defer this test to effect processing, this would be slightly more efficient since we would mostly not need to walk the AST path
Member
Author
There was a problem hiding this comment.
no, we can't. I first wanted to do it like this.
in the effect processing stage, we have [AstParentKind], which is only the type of the AST node, not the actual AST node. So here, we can only tell if this is anyFn(process.env.FOO) and not if it's actually Boolean(process.env.FOO)
lukesandberg
approved these changes
Sep 11, 2026
mischnic
force-pushed
the
mischnic/env-var-existence-e2e
branch
from
September 11, 2026 17:18
e7699fe to
4068e2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

We now separately track code that accesses non-inlined env vars at runtime in two categories
For the second case, we only need to invalidate use-cache functions when the given env var transitioned betwen unset/falsy/truthy. But transitioning between two different truthy values doesn't caused invalidation.