Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM Support? (originally reported by jrasanen) #340

Closed
joshjordan opened this issue May 22, 2016 · 8 comments
Closed

NPM Support? (originally reported by jrasanen) #340

joshjordan opened this issue May 22, 2016 · 8 comments

Comments

@joshjordan
Copy link
Member

Hi!

Any plans adding NPM support for proxying packages?

And thanks for continuing maintaining rails-assets. [Issue automatically imported by https://github.com/controlgroup/CSV-GitHub-import-export]

@Envek
Copy link

Envek commented Aug 1, 2016

+1 on this as some projects drops support for pure Bower because they do not want to commit built js into repository.

For example Chart.js 2.2.0+: https://github.com/chartjs/Chart.js/releases/tag/v2.2.0

@joshjordan
Copy link
Member Author

Hi @Envek! Thanks for adding your support to this issue. We're definitely going to implement it, right now its just a matter of when.

For what its worth, in the meantime, if you come across any packages that you want to use but aren't in bower yet, you can fork them and add a bower.json, then get them into the bower repository. Just a stopgap in case you get blocked.

@hut8
Copy link
Member

hut8 commented Aug 1, 2016

@Envek you shouldn't need to commit built JS into a repository to support bower. See https://github.com/bower/spec/blob/master/json.md#main -- it specifically says:

  • Use source files with module exports and imports over pre-built distribution files.
  • Do not include minified files.

@Envek
Copy link

Envek commented Aug 1, 2016

I got it, but it would be better if someone from @chartjs will read it. May be @simonbrunel or @etimberg? And people from other js libraries too.

Thank you for feedback.

@simonbrunel
Copy link

@Envek: is using bower-npm-resolver, for Chart.js, an issue? It seems to provide the feature reported by this ticket. See PR#2555 for details.

@Envek
Copy link

Envek commented Aug 2, 2016

@simonbrunel: it require us to change build system for project's frontend (and separate frontend from backend). We're currently installing js libs from rails-assets (this repo, which in turn is proxy to Bower and converter from bower packages to Ruby gems) and compile them with sprockets. I don't think it worth it for simple project (kinda website, not SPA, as we still need to render ready HTML on server).

So if rails-assets add support for bower-npm-resolver I will be able to upgrade to Chart.js 2.2.0 (for now stick at 2.1.6).

@simonbrunel
Copy link

@Envek, I didn't know about rails-assets and understand your point. Having built files in the repository itself doesn't make sense, is pretty confusing since it never reflects the actual sources, and many times, pollutes PRs and commit history. In case of Chart.js, we provide different alternatives to get built versions (minified or not). Not sure which ones Bower officially supports, but I hope rails-assets will be able to implement at least one of them:

  • as downloads attached to GitHub releases (tags)
  • as part of the NPM package (in the dist/folder)
  • or from cdn.js

@hut8
Copy link
Member

hut8 commented Jul 15, 2022

Closing this because of the three better asset management alternatives in Rails 7 (and other alternatives in 5 and 6)

@hut8 hut8 closed this as completed Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants