lemanschik / modules

StealifyOS Stack - Awesome Storage - B8G Engine - ECMAScript - modules folder contains regular used modules
The Unlicense
0 stars 0 forks source link

Verify NJS 19,1 import require flags #2

Closed lemanschik closed 2 years ago

lemanschik commented 2 years ago

Stake Holder list

Ambient Loader Progress

The behavior of experimental loader hooks is not solved if all is solved we can implement rollup resolver finally as a plugin system to resolve hooks to enable:

TypeScript Closes

This closes all typescript resolve issues as typescript runs in nodejs and it respect nodejs flags you can finally apply loader Plugins to Typescript while typescript will work with frozzen intrinsics.

Closes vscode build

As this allows to write a single build instruction that works via loader resolveId hooks in every context

Closes Electron Issues

This closes the ESM Resolution Issues cross context which are the real problems that the users face when developing cross context cross module system boundary.

Closes Rollup Issues

Copyed from package maintainance discussion as aggreed on that this is future not current

This could be better adddressed when the Plugin Hook Loader API Exists and would get used without Package.json resolve or at last a none magical package.json resolve that is explicitly written in a reuseable loader.. As that exists in all other Engines also

Also interristing observation

Identified Fundamentals when incremental upgrading CJS to ESM

Short Conclusion

package.json when used for anything else then referencing a main + dependencies is a bad thing. For Example the new import maps features overlap with ECMAScript import as soon as used you need to recode them the reuse the code. This could be directly done as additional js file that only injects the dependencie specifiers.

also the whole scripts section can be replaced by simply putting the same scripts into the folder and run node script.js and not npm run-script build which calles node build.js the list is endless. Then on Top the Require CJS breaks everything as it simply supports to much diffrent resolutions and module types.

lemanschik commented 2 years ago

Closing in Favor of No CLI Solution We Simply keep user land snapshot api and directly load the mksnapshots and call it a day. Only the vscode ESM code migration needs attention typescript and nodejs can simply process indipendent and will get superseeded by the browser with the nativ filesystem access api