mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
- For `export default class Foo`, we don't insert a `var __TURBOPACK__default__export__ = Foo` variable because it should be a live binding. So put the correct name/syntax context into `ImportMap.exports` - The `__TURBOPACK__default__export__` generated by module fragment tree shaking should use the same syntax context as the one generated by `module_item.rs` (which is `SyntaxContext(0)`).
5.1 KiB
5.1 KiB
Items
Count: 6
Item 1: Stmt 0, ImportOfModule
import Stream from 'node:stream';
- Hoisted
- Side effects
Item 2: Stmt 0, ImportBinding(0)
import Stream from 'node:stream';
- Hoisted
- Declares:
Stream
Item 3: Stmt 1, VarDeclarator(0)
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
- Side effects
- Declares:
streamDestructionSupported - Reads:
Stream - Write:
Stream,streamDestructionSupported
Item 4: Stmt 2, Normal
function fetch() {}
- Hoisted
- Declares:
fetch - Write:
fetch
Item 5: Stmt 3, Normal
export default fetch;
- Side effects
- Declares:
__TURBOPACK__default__export__ - Reads:
fetch - Write:
__TURBOPACK__default__export__
Phase 1
graph TD
Item1;
Item2;
Item3;
Item4;
Item5;
Item6;
Item6["export default"];
Phase 2
graph TD
Item1;
Item2;
Item3;
Item4;
Item5;
Item6;
Item6["export default"];
Item3 --> Item2;
Item3 --> Item1;
Item5 --> Item4;
Item5 --> Item3;
Item6 --> Item5;
Phase 3
graph TD
Item1;
Item2;
Item3;
Item4;
Item5;
Item6;
Item6["export default"];
Item3 --> Item2;
Item3 --> Item1;
Item5 --> Item4;
Item5 --> Item3;
Item6 --> Item5;
Phase 4
graph TD
Item1;
Item2;
Item3;
Item4;
Item5;
Item6;
Item6["export default"];
Item3 --> Item2;
Item3 --> Item1;
Item5 --> Item4;
Item5 --> Item3;
Item6 --> Item5;
Final
graph TD
N0["Items: [ItemId(0, ImportOfModule)]"];
N1["Items: [ItemId(0, ImportBinding(0))]"];
N2["Items: [ItemId(1, VarDeclarator(0)), ItemId(2, Normal), ItemId(3, Normal), ItemId(Export(("__TURBOPACK__default__export__", #0), "default"))]"];
N1 --> N0;
Entrypoints
{
ModuleEvaluation: 2,
Export(
"default",
): 2,
Exports: 3,
}
Modules (dev)
Part 0
import 'node:stream';
Part 1
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
Part 2
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import Stream from 'node:stream';
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
function fetch() {}
const __TURBOPACK__default__export__ = fetch;
export { __TURBOPACK__default__export__ as default };
export { streamDestructionSupported as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { fetch as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { __TURBOPACK__default__export__ as c } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { };
Part 3
export { default } from "__TURBOPACK_PART__" assert {
__turbopack_part__: "export default"
};
Merged (module eval)
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import Stream from 'node:stream';
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
function fetch() {}
const __TURBOPACK__default__export__ = fetch;
export { __TURBOPACK__default__export__ as default };
export { streamDestructionSupported as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { fetch as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { __TURBOPACK__default__export__ as c } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { };
Entrypoints
{
ModuleEvaluation: 2,
Export(
"default",
): 2,
Exports: 3,
}
Modules (prod)
Part 0
import 'node:stream';
Part 1
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
Part 2
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import Stream from 'node:stream';
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
function fetch() {}
const __TURBOPACK__default__export__ = fetch;
export { __TURBOPACK__default__export__ as default };
export { streamDestructionSupported as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { fetch as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { __TURBOPACK__default__export__ as c } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { };
Part 3
export { default } from "__TURBOPACK_PART__" assert {
__turbopack_part__: "export default"
};
Merged (module eval)
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import Stream from 'node:stream';
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
function fetch() {}
const __TURBOPACK__default__export__ = fetch;
export { __TURBOPACK__default__export__ as default };
export { streamDestructionSupported as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { fetch as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { __TURBOPACK__default__export__ as c } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
export { };