fix(core): rewrite replacements while hoisting layers (#35175)

This commit is contained in:
James Long 2026-07-03 11:26:49 -04:00 committed by GitHub
commit 33ed95f09c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -89,6 +89,10 @@ export function buildLocationServiceMap(
LayerMap.make(
(ref: Location.Ref) => {
const allReplacements = replacements.concat([[Location.node, Location.boundNode(ref)]])
// Apply replacements during hoist, not afterward: replacements can
// introduce new tagged dependencies (Location.boundNode depends on
// Project), and the hoist walk is the only pass that can still slice
// those back out.
const location = LayerNode.hoist(locationServices, Node.tags.values.global, allReplacements)
return LayerNode.compile(location.node).pipe(