-
Notifications
You must be signed in to change notification settings - Fork 2
Move build deps to devDependencies #56
Comments
@exogen -- Thanks for capturing a potential rearchitecture. I'd like to focus us first by hashing out our project-wide motivations for what we should support as a team and community member, and then after that we can decide on the propers means to get there! @alexlande @kenwheeler @chaseadamsio @exogen -- I'd love your commentary here about our values and goals for public JS frontend projects (where what can go in git repo source includes Some things I would posit that are important to support from a project installation perspective are:
Thoughts, comments? |
Re: Bower stats, wow I'm wondering if their "Top packages over past 7 days" is correct, because it looks bleak. Number of Anyway, one thing I forgot to capture re: Bower support: @alexlande pointed out this redux issue, in which someone points out that you can still install via Bower using the npmcdn.com URL to your |
@exogen -- Yeah, the bower numbers for the individual numbers are almost certainly wrong. A certain client project we have easily eclipses that regularly ;) Using an overly-broad heuristic of searches of GitHub public projects:
|
Let's say we wanted complete first-class support for Bower: I'm still unclear how moving those dependencies is related. Looking at Radium's |
If we switched to a This provides access for Bower users and those who want a UMD build for things like CodePen. While Bower is still relevant in certain ecosystems, I see very little use in the React ecosystem. Bower use would be an edge case at best, and I feel like providing a UMD build via npmcdn would be accommodating enough. |
Depending on the complexity of the library at issue, "bower support" can include any of the following:
... and bower unfortunately, cannot run build steps. But, strictly speaking, only the UMD build is a requirement for us, so npmcdn technically support that. Other side not, IIRC, going off of a URL for bower (like would be the case for npmcdn) gives up ability to manage versions / list outdated packages / etc. Not a deal-breaker, but worth noting (as our bower support is most likely to land in "something's that's better than nothing" once we're done with this discussion). Let's still chat about desired support scenarios though -- |
Re: git dependencies-- given that this use case is mainly meant to support forks, people in that situation could just remove |
On a separate note, if bower will work with npmcdn I think that's great. That said, I think that the recent memification of "bower is dead" is overblown. Bower is still huge. They've only got one maintainer now and not a ton of work is happening, but they've been in that situation for ~2 years at this point. The internet has just jumped on a recent discussion of that fact (plus the npm3 release) to pronounce that Bower is dead/terrible/bad for the JavaScript community/whatever. I can't say with certainty whether npm has eclipsed bower for front-end usage (I think it's heading in that direction, at least), but it's not something that should be written off. |
I echo Ken's comment. To wrap @ryan-roemer's list:
|
@chaseadamsio I don't follow what this means, could you elaborate? |
@exogen for sure! These are just my (not so well-formulated) thoughts on it:
I'm not sure the answer is a good one for the above scenario: If they're using the
This is where the release client with npm ( |
@chaseadamsio Oh! I wasn't following release clients but now I see – release candidates as in
I don't think we're proposing you need to be able to install via arbitrary As for publishing an RC build to preview changes, it's an option but I don't think is in the spirit of what @ryan-roemer wants (and doesn't cover forks with a different owner, as you mention – for example, we have a long-running dependency on a But publishing a |
@exogen sorry for the confusion on using client instead of correctly saying candidate...I couldn't think of the word "hypnotize" earlier either...it's been a weird Monday. |
This may be a naive suggestion... but for small libraries I've worked on, I tend to just have Just a thought. :) In any case, +1 for npm git repo dependencies being an important use case to support - I use them quite often. |
Some discussion has happened around this already, but the gist is that we have
builder
andbuilder-react-component
independencies
. And most of our current repos, which are pre-Builder, havebabel
andwebpack
in their production dependencies. This not only makes installing our stuff extra slow, but I've found that we're more likely to experience version conflicts or the need to completely wipenode_modules
just to upgrade or install a new dependency (some tools in the Karma and webpack ecosystem declarepeerDependencies
that end up getting mad that all our components have webpack as a production dep).When transpiling with Babel, nearly all the projects I've surveyed do their build in
version
orprepublish
. But that means they don't supportgit
install URLs, because the build artifacts are only present in the NPM package. To supportgit
URLs, we landed on a solution of conditionally building inpostinstall
. The problem is that even though the build is conditional, the build dependencies like Babel and Webpack are not: everyone installing through NPM has to bear the cost of installing those, too, no matter what. Not to mention that on principle, they just aren't true deps: they aren'trequire
'd anywhere in the package. They're build dependencies!I'd prefer to align ourselves with what everyone else is doing: building in
version
orprepublish
. Here are a couple options:postinstall
method and just don't supportgit
URLs. @coopy says they're an antipattern and that the NPM folks recommend publishing under a scoped package name if you need to depend on a fork. Another option would be to checklib
into the repo in a branch of your fork, just for the purpose of beinggit
installable.postinstall
that not only builds conditionally, but installs dev dependencies temporarily only when a build is needed. That way the common case of installing via NPM, which already has the build artifacts, never even pulls down the build deps. To test how this would work, I made a helper for exactly this purpose: postinstall-buildAs for Bower, I don't know how it works or why our current method is required to support it, so I'll let someone else explain. But I also don't give a hoot about Bower.
The text was updated successfully, but these errors were encountered: