deno
ec2b4bfe - fix(node): full re-export fallback for unresolvable member re-exports (#34689)

Commit
50 days ago
fix(node): full re-export fallback for unresolvable member re-exports (#34689) Importing a named export from graphql-tag still failed with "does not provide an export named 'gql'", even though #34363 added handling for the `module.exports = require("X").MEMBER` entry shape that graphql-tag@2 uses. That fix narrows the wrapper's named exports to the names statically attached to MEMBER inside X, which works when the attachments are top-level but not for graphql-tag's actual inner file: a UMD bundle that performs its `exports.gql = ...` and `gql.* = ...` assignments inside the factory IIFE and builds the value through a namespace alias. Static narrowing finds nothing there, so the wrapper advertised no names at all. When the member's attached names cannot be determined statically, fall back to re-exporting the inner module wholesale rather than advertising nothing. This matches Node, which over-approximates `require(X).Y` to the inner module's full set of named exports. The narrow path is unchanged for the cases where the attachments are statically known, so unrelated names still do not leak through there. Closes #16708 Closes #25311
Author
Parents
Loading