Use ractive from the parent module instead of directly depending on it.#5
Use ractive from the parent module instead of directly depending on it.#5dantman wants to merge 1 commit intojonvuri:masterfrom
Conversation
Using 0.x doesn't solve the issues of version mismatch, as the parent may be depending on an older version, or eventually ractive may go 1.0. Instead, by not including it in the dependencies we'll depend directly on whatever version of ractive the module using ractivate is using.
|
This should either be a 0.3 or 1.0. |
|
Intuitively this seems wrong to me. |
|
But, this isn't a normal library where the library does everything with its dependencies, its a thin wrapper that returns an By directly depending on ractive an app that depends on ractivate ends up with a structure like: There are two independent copies of Ractive with different versions. Say you require ractive "0.6.1", then a 0.6.2 with a backwards incompatible change is made you end up with:
The app will be broken by the new release until the app upgrades to 0.6.2, however if 0.6.2 includes a template change that's a mistake and needs to be undone/fixed (this has happened before) then the app would remain completely broken until 0.6.3 was released because of ractivate. |
|
Basically ractive is more of a peer dependency for ractivate. However npm's |
|
It's intended that you install ractive first - basically, to make it an unofficial peer dependency. Ractive won't be installed as a sub-dependency to ractivate if it's already available as a normal node module. If you do And then Obviously an issue. However, if you do it the other way around, This is also the way it happens when both ractive and ractivate are declared as dependencies and you do an Also, correct me if I'm wrong, but someone desiring a different version of ractive could still make the same mistake with this change. If ractive isn't already installed, it will be included as a subdependency with I think it's probably better to rely on npm's dependency system even if it's a little dicey. It's just simplest. |
devDependencies are not installed when one does |
|
Yeah, they are. Just tried it now (Node 0.10.33, npm 2.1.11) and the documentation agrees: https://docs.npmjs.com/cli/install (Heading 'npm install (in package directory, no arguments)', about 3 paragraphs down) You have to pass the |
Using 0.x doesn't solve the issues of version mismatch, as the parent may be depending on an older version, or eventually ractive may go 1.0.
Instead, by not including it in the dependencies we'll depend directly on whatever version of ractive the module using ractivate is using.