tenex / rails-assets

The solution to assets management in Rails
https://rails-assets.org
MIT License
1.63k stars 69 forks source link

Packages without built js and css #411

Closed henadzit closed 7 years ago

henadzit commented 7 years ago

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 commented 7 years ago

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? https://github.com/tenex/rails-assets/issues/376#issuecomment-261615808

henadzit commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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:

henadzit commented 7 years ago

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