Smashing / smashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
https://smashing.github.io/
MIT License
3.22k stars 324 forks source link

Add sprockets precompile rake task #190

Closed kinow closed 2 years ago

kinow commented 3 years ago

Closes #189

To test:

  1. copy file into a dashboards project (we assume bundle install etc has run, the dashboard is running fine)
  2. rake precompile-assets
  3. confirm assets/javascripts/application.js was created
  4. start your dashboard, make sure widgets, jobs, etc, are all working
  5. enjoy! :tada:
qume commented 2 years ago

Ok so this runs, and generates application.js which looks sensible. However the page just shows the background and no widgets.

In the console it says "Yeah! The dashboard has started!", and that's it.

The generated application.js is here: https://termbin.com/oaolz

I tried diffing the precompiled one with the live one, but diff choked (I guess doesn't like the long minified lines). Doing a manual look through they seem identical. When I fetch the live generated one with curl and name it application.js - same problem, just a gray background with no widgets.

Probably something really simple I'm missing here but a bit stumped. There are no errors logged to the console or 404's etc.

kinow commented 2 years ago

@qume is there any chance you used the old Rakefile? I had the same result with the previous Rakefile as that was missing the sassc/sass and coffee-script imports. But after adding them, the generated application.js worked fine.

qume commented 2 years ago

Awesome my bad I didn't copy over the new Rakefile from the template directory in the gem.

It works. Thank you!!

kinow commented 2 years ago

Excellent news @qume ! Thanks for testing it! I'll merge it, and wait a few more days/weeks to see if we get any other gem updates, issues, improvements, etc. A new version should be released in the next weeks with this Rakefile. I'll update documentation too. Cheers, Bruno.

kinow commented 2 years ago

Change log updated. Milestone updated. Docs added too to sidebar with a link to this new wiki page: https://github.com/Smashing/smashing/wiki/How-to%3A-precompile-assets