Re:Yarn Plug'n'Play: Getting rid of node_modules
by eliseumds on Thursday September 13, 2018 @08:08AM
(#17977933)
I quickly read the paper and I wonder if there's anything in place to deal with packages that generate side effects via postinstall. Can we at least manually create a list of them in package.json or something so that Yarn copies them into node_modules like before?
[ Parent
| on HN ]
Re:Yarn Plug'n'Play: Getting rid of node_modules
by arcatek on Thursday September 13, 2018 @08:19AM
(#17977986)
Postinstall scripts are the main issue, yep. Right now the current implementation doesn't do anything special with them, meaning that they are installed inside the cache (except when they're disabled altogether, which often works well enough since there isn't that many packages that require postinstall scripts).
This is obviously wrong, so we'll soon go to a model where we "unplug" the packages and put them into a specific directory (a bit like the node_modules folder, but entirely flat). The feature itself is already there (`yarn unplug` in the rfc), but we need to wire it to the install process.
Ideally, I think it would be beneficial for the ecosystem to move away as much as possible from postinstall scripts - WebAssembly became a very good solution for native libraries, and as the added benefit that it works everywhere, including the web.
Re:Yarn Plug'n'Play: Getting rid of node_modules
by jorangreef on Thursday September 13, 2018 @09:03AM
(#17978256)
How would you implement https://github.com/ronomon/direct-io with WebAssembly?
Native modules exist because people sometimes need to drop down to work with the platform directly.
Re:Yarn Plug'n'Play: Getting rid of node_modules
by arcatek on Thursday September 13, 2018 @09:08AM
(#17978286)
Someone working on the wasm will likely be able to tell you more, but from what I understood dynamic linking is on the table[1]. I didn't quite say that it was ready yet, but rather that it was on the right path.