Skip to content

Commit fbcd43b

Browse files
WIP
1 parent 0e049f8 commit fbcd43b

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

apps/site/pages/en/blog/events/collab-summit-2024-dublin.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,56 @@ The documentation session highlighted the need for improved ownership, regular u
7373
7474
## Module loading customization/optimization and CJS/ESM interoperability
7575

76-
ESM as first class ???
77-
`node --inti` like `npm init` but with `type` key to `module`.
78-
also https://github.com/pkgjs/create-package-json mention by wes
76+
The session on module loading customization and CJS/ESM interoperability focused on several key areas, including the removal of the `--experimental-default-type` flag, marking syntax detection as stable, and documenting dual package shipping patterns.
77+
78+
### `--experimental-default-type`
79+
80+
- **Removal Discussion**: There was a consensus that the `--experimental-default-type` flag could be removed, as no one in the room objected to its removal.
81+
- **Error Message Improvement**: It was noted that the error message from mixing CJS and ESM syntax could be improved.
82+
- **Next Steps**: Geoffrey suggested marking syntax detection as stable and dropping the default mode switch experiment. Benjamin agreed, noting that there have been no complaints about the current implementation.
83+
- **Timeline for Removal**: Joyee raised the question of when to remove the flag, suggesting it could be done in the next major or minor release. Michael Dawson questioned the benefit of removing it now, while Geoffrey pointed out the code complexity in keeping it.
84+
85+
### Syntax Detection
86+
87+
- **Stability**: The group discussed whether syntax detection could be marked as stable, given that it has been unflagged since July.
88+
89+
### Documenting Dual Package Shipping Patterns
90+
91+
- **Ecosystem Practices**: The discussion turned to documenting dual package shipping patterns and updating ecosystem practices. Filip mentioned that he decided not to support CJS users who run Node.js versions that don't support `require(esm)`.
92+
- **Guidance for Maintainers**: The consensus was that maintainers should be provided with different guides for different choices, as some may still want to support older versions of Node.js.
93+
- **Future Prospects**: Jordan envisioned a future where shipping native ESM (only) in all packages would be feasible, as long as there is an easy method for users on older engines to seamlessly adapt/transpile a consistent compile source.
94+
95+
### ESM as First Class
96+
97+
- **Opinionated Documentation**: Geoffrey suggested that the documentation could be more opinionated, telling people to write ESM and considering CommonJS as legacy (but still supported). This would move away from presenting both as equal first-class citizens.
98+
- **Learn Article**: Jacob mentioned a potential Learn article that could be ported from the loaders example, providing practical guidance on configuring CommonJS and ESM for Node.js.
99+
100+
### `node --init`
101+
102+
<!--
103+
- problem: npm init doesn't make "type": "module" by default
104+
- solution: `node --init` to create a package.json with "type": "module"
105+
with potential "scripts": {"test": "node --test"} to bootstrap a project
106+
- Wes mention: package maintainance working group (node.js WG) has a npm init pkg thing being worked on: https://github.com/pkgjs/create-package-json
107+
-->
108+
109+
> **⚠️ WARNING**: This is a proposal and not yet implemented. Also, it's may never be implemented.
110+
> Please don't take this for granted.
111+
112+
### Missing Pieces of ESM
113+
114+
- **Performance**: Geoffrey mentioned a work-in-progress to remove async handling in the ESM loader, which is currently failing tests due to unexpected async activity. Jacob noted that it is currently impossible for ESM to be faster than CJS, but Joyee mentioned that it would be possible when import defer eval is shipped in V8.
115+
- **Snapshot & SEA Support**: The group discussed the need for snapshot and SEA support in ESM.
116+
117+
### Synchronous, In-thread & Universal Module Loader Customization Hooks
118+
119+
- **Proposal Summary**: Joyee summarized the new proposal for synchronous, in-thread, and universal module loader customization hooks.
120+
- **Escape Hatch**: Matteo mentioned the initial motivation for making hooks async to support network loading and his experiments with making async operations synchronous using a package called `everysync`.
121+
- **Migration Guide**: Jacob confirmed that the plan before removing the async hooks is to write a migration guide including `everysync` (or similar).
122+
123+
### Summary
124+
125+
The session on module loading customization and CJS/ESM interoperability highlighted the need for clear documentation, improved error messages, and a more opinionated approach to promoting ESM as a first-class citizen. The group also discussed the challenges and potential solutions for making ESM faster and more efficient, as well as the need for better tools and practices to facilitate the migration to ESM.
79126

80127
## Facilitating userland migrations to new features and breaking changes
81128

@@ -99,4 +146,4 @@ Diagnostic doesn't work with ESM so issue for "ESM as first class"
99146

100147
Thanks to all the attendees. Special thanks to the Baseline team for hosting the summit and providing a welcoming space for the Node.js community.
101148

102-
Also big thanks to Claudio Wunder, Matteo Collina, Robin Ginn, and the [OpenJS Foundation](https://openjsf.org) for organizing the event and making it possible.
149+
Also big thanks to [Claudio Wunder](https://github.com/ovflowd), [Matteo Collina](https://github.com/mcollina), Robin Ginn, and the [OpenJS Foundation](https://openjsf.org) for organizing the event and making it possible.

0 commit comments

Comments
 (0)