next.js
112a7657 - [tubopack] Compile time replace top level `this` expressions to fix a subtle esm bug and simplify the client side runtime (#80925)

Commit
227 days ago
[tubopack] Compile time replace top level `this` expressions to fix a subtle esm bug and simplify the client side runtime (#80925) ### What Use the 'free variable' system to compile time replace `this` expressions at the top level. In ESM modules it is rebound to `undefined`, this fixes an existing bug in turbopack where it was instead bound to `globalThis` In CJS modules it is rebound to `exports` via the `__turbopack_context__.e` alias Then remove the implicit `this` propagation from the runtime so we can adopt arrow functions everywhere. Closes PACK-4905
Author
Parents
Loading