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

Packages without built js and css #411

Closed
henadzit opened this issue Jun 19, 2017 · 5 comments
Closed

Packages without built js and css #411

henadzit opened this issue Jun 19, 2017 · 5 comments

Comments

@henadzit
Copy link

Hi,

First of all, thank you for creating and maintaining rails-assets! It's a great idea and implementation.

We run into an issue with signature_pad (https://rails-assets.org/#/components/signature_pad). The package doesn't include built JS and CSS but includes a gulp script for building the package. The JS is written in ECMAScript 6 and doesn't work as is in older browsers.

I'm assuming this might be a trend and this might happen to other packages too. Is there a known way to work around the issue? Are you planning to support such packages?

Thanks,
Henadzi

@hut8
Copy link
Member

hut8 commented Jun 19, 2017

Hey there. Thanks for the report. Can you check out this reply to a different issue and let me know if it clears things up? #376 (comment)

@henadzit
Copy link
Author

@hut8, thank you for the quick answer!

It shed some light on the issue. Unfortunately, the proposed solution won't work for us because the JS file has to be compiled with Babel, not just selecting the correct files.

Do you have any suggestions for this case?

Do you plan to change something within rails-assets to support such case?

Thanks!

@joshjordan
Copy link
Member

Unfortunately, as Liam mentioned in his comment back in November, supporting such a case would open us up to maintaining many build tools, which is outside the scope of Rails Assets. Rails Assets needs to take ready-made javascript components and package them up for Ruby.

The simplest suggestion I can make is to fork the repo, build & commit the compiled assets, then point Rails Assets at your fork. Very open to other ideas, but need to be pragmatic and realistic about the scope we can manage in this project.

@hut8
Copy link
Member

hut8 commented Jun 19, 2017

Which version of Rails are you using? As of 5.1, I would consider rails-assets.org to be basically redundant because Rails now has integration with Yarn and Webpack. The point of my linking to that post is my explanation that if files need to be built, and they're not checked in (which used to be a requirement of bower, now it is recommended against), then they can't be used with rails-assets ☹️ My recommendations would be:

  • Use 5.1 with webpack integration
  • Fork it, build it, check in the compiled files, add a Bowerfile, push it to GitHub and then add it to the Bower registry. Then it's easy 😄
  • If that's too involved, download the code from CDN and vendor it. Ugly, yes, but requires the least effort

@henadzit
Copy link
Author

Thanks for the great answers! For now, we decided to go with webpack. Thanks!

@hut8 hut8 closed this as completed Jul 18, 2017
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

3 participants