On ചൊവ്വ 06 മാർച്ച് 2018 07:42 വൈകു, Ian Jackson wrote: > Pirate Praveen writes ("Javascript team policy and rejection of node-three > binary package"): >> 1. Node.js has standard locations for discovering installed packages >> which is different from browser targeted javascript libraries. >> >> Node.js expects pure js modules to be installed at /usr/lib/nodejs but >> javascript libraries are installed at /usr/share/javascript > > This is not an argument in favour of separate packages AFAICT ?
They are in two different directories because they target two different APIs. Most of the time, files installed at /usr/lib/nodejs needs browserification (webpacking/module bundling) to be able to be installed at /usr/share/javascript. Though there are now formats like UMD (Universal Module) which allows the code to be run in both environments. I think in most cases where the software supports both environments, umd modules are used, so it would be fine to provide a single binary package. I just explained why these two separate targets exist. >> 2. Dependency on nodejs is required only during build or when other >> Node.js modules depend on it. a browser targeted library does not need >> to depend on nodejs package. > > This could be solved by dropping the nodejs dependency from all the > nodejs module packages and requiring top-level applications to depend > on nodejs. I see two problems with that approach. 1. It makes these modules installable but unuseable in architectures where nodejs itself is not available. 2. We won't be able to specify a minimum version of nodejs for these modules. For example, node-regexpu-core required nodejs >= 6 and this prevented its testing migration for a long time because testing only had nodejs 4 for a long time. I think separate binary should be allowed at least in the second case. >> If you take example of node-handlebars source package, libjs-handlebars >> is targeted at browsers and does not need to declare a dependency on >> nodejs. But handlebars package need nodejs to run. If there is only a >> single binary package, nodejs will get installed unnecessarily. > > Does handlebars contain anything that is useful to run directly ? handlebars is templating system widely used, not only in nodejs. It has binding for different languages (like ruby-handlebars-assets) and also a command line interface. The command line can be used for compiling handlebars templates.
signature.asc
Description: OpenPGP digital signature