Update readme to install as dependency, not dev dependency? #225

Closed
davidbwaters opened this Issue Nov 6, 2016 · 15 comments

Projects

None yet

6 participants

@davidbwaters

Just noticed the readme suggests using NPM/Bower to install inuit as a dev dependency ('--save-dev;). I would think it should be installed with '--save' to be a regular dependency, reserving dev dependencies for non-essential stuff like unit testing, packaging scripts, documentation generation, etc.

@florianbouvot florianbouvot pushed a commit that referenced this issue Nov 6, 2016
Florian Bouvot [refs #225] Update readme to install as dependency e353ba6
@florianbouvot
Member

Thanks @davidbwaters.

@twittkopf

This might not be correct, depending on the way you see it.

npm is widely used for non Node projects, the differentiation between dependencies and devDependencies does not necessarily apply. In many frontend projects, all code served to the browser is compiled, there are no runtime dependencies. This would mean that there are no dependencies, only devDependencies – all dependencies are included in the build done during development.

One could also argue that dependencies are required for development as well, so it would be okay to list everything unter dependencies.

As this is slightly confusing and there seems to be no general consensus (at least I have that impression), I think it should be actually left to the consumer of the framework to decide how to install it.

Maybe also have a look at petehunt/webpack-howto#53 and webpack/webpack#520 where questions regarding this topic were asked without finding a general solution.

@florianbouvot
Member

@twittkopf thank you, I think you're right 👍

@florianbouvot florianbouvot pushed a commit that referenced this issue Nov 6, 2016
Florian Bouvot [refs #225] Remove flag from installation instructions e3c970d
@davidbwaters
davidbwaters commented Nov 6, 2016 edited

Good call. While I agree that the semantics argument that both could be considered devDependencies, I think the fact that we have the optional distinction indicates a reasonable way to use them. It makes sense (to me) that the dependencies designation would represent the 'minimum viable' code to use and as an indicator of what's nonessential for something to work. Seeing the dev flag in the instructions just seemed like not-so-good advice.

BTW, before bringing this up, I read and was referencing this http://stackoverflow.com/questions/19339227/bower-and-devdependencies-vs-dependencies about the issue that clarifies my perspective.

Anyways, I think it's safe to say that most people using a package manager to install either knows which one to use or is just using one or the other.

@herzinger
Contributor

As I see it, anything that goes on to become part of the production code is a dependency, which makes the issue correct.

@anselmh
Member
anselmh commented Nov 9, 2016

Well, actually, in strict terms @twittkopf is correct here. However, we have to also take into account how most people use npm and its package management for front-end projects. And when we look at this, it’s true that most people handle dependencies like this in a way like @herzinger suggests — having these packages as a dependency in a project.

I’m fine with whatever decision we make here, but I tend to vote for advertising inuitcss as dependency.

@jtfairbank

Some outside thoughts:

I think most people working on small projects / front-end only projects won't care. On previous projects of mine, I noticed that once they hit a certain size or scope then the difference started to matter b/c devs were including administrative nodejs scripts to perform tasks beyond building / compiling / etc.

If InuitCSS were around for that project, I'd install it as a dependency because it is related to "the set of things that end up on a production server, possibly transformed" (vs. "the set of things that end up on my dev machine, build server, or test server but not production").

@florianbouvot
Member
florianbouvot commented Nov 10, 2016 edited

What the "best" choice for npm/bower beginner? I vote for install as dependency.

Experienced users will have no problem to install inuitcss like they want...

@florianbouvot florianbouvot pushed a commit that referenced this issue Nov 10, 2016
Florian Bouvot [refs #225] Restore dependency flag 48f1798
@herzinger
Contributor

That's exactly right. Installing inuitcss as a dependency is the most sensible way, and I think this is what we should advocate. If anyone has a strong enough opinion otherwise, they will know to change the flag by themselves. What we CAN'T do, is show it in our readme with no flag at all, as it's the only way everyone should agree one should never do it.

@herzinger
Contributor

Maybe also have a look at petehunt/webpack-howto#53 and webpack/webpack#520 where questions regarding this topic were asked without finding a general solution.

Webpack is a project that falls into a much bigger grey area concerning this than we do. Actually, we do not fall into any grey areas, as I see it.

@twittkopf

Webpack is a project that falls into a much bigger grey area concerning this than we do. Actually, we do not fall into any grey areas, as I see it.

The webpack issue referenced is actually not webpack specific but illustrates that there seems to be no general opinion on this topic, which is exactly what I tried to express in my first comment.

There seems to be no "right" or "wrong" way to handle this for some projects – even installing without any flag can be a sensible decision. Thats why I suggested to leave it to the consumer to decide what to do. On the other hand, if you know what you want it's a no-brainer to use --save instead of --save-dev or vice versa, so I see the point of putting a flag in the readme – any flag is probably a better fit than no flag.

@herzinger
Contributor

even installing without any flag can be a sensible decision.
-@twittkopf

Could you give a example of that?

I think we should show the flag, since I'm guessing many people, especially begginers, would simply copy/paste the line.

@twittkopf

@herzinger debugging or trying things out

@herzinger
Contributor

@twittkopf sure, but them you wouldn't publish it like this.

@florianbouvot
Member

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment