administrate icon indicating copy to clipboard operation
administrate copied to clipboard

Remove dependency on sassc / scss

Open muriloime opened this issue 3 years ago • 8 comments

Hello there,

I realized the sassc related gems are increasing our slug size in heroku by 10-20% so I decided to remove the (now deprecated) sassc dependencies. In the case this work is desirable by the maintainers, I am creating this PR

cheers Murilo

muriloime avatar Feb 22 '22 11:02 muriloime

Thanks for jumping in and doing this. I've been keen to do this for the last few weeks, so I'm glad you've opened a PR about it.

@dcyoung-dev has a work in progress branch hanging around from when we initially looked at this, but it seems like this is a little further along, but I mention it in case you wanted to have a quick look.

Would you be able to do something about the Hound/style comments?

nickcharlton avatar Feb 23 '22 12:02 nickcharlton

Any chance of hurrying this along? I have another reason for wanting this PR which is that I'm using Rails 7 with tailwind 3, and adding sassc into the mix causes tailwind to blow up with a [Error: Function rgb is missing argument $green](https://github.com/tailwindlabs/tailwindcss/discussions/6738) error (apparently due to sassc being old/out of date)

iainbeeston avatar Mar 30 '22 10:03 iainbeeston

@iainbeeston this PR broke in production. I added a WIP

muriloime avatar Mar 30 '22 13:03 muriloime

I'm also unable to use Administrate because I'm using Tailwind. It would be great to see this PR merged. Thanks!

brunoprietog avatar Apr 12 '22 05:04 brunoprietog

I had a lot of sassc errors in my CI/CD server when running tests so I came back to this issue.

I finally managed to remove sass. Unfortunately I had to change selectize-rails too, as it used .scss.

I acknowledge it is maybe not the best way to use the asset pipeline (multiple files), but it is working now in prod \o/, and it does not rely on scss anymore. I would be more than happy to discuss on how to improve the solution

In order to make it work is necessary to add this line to app's manifest file

//= link administrate_manifest.js

Cheers Murilo

muriloime avatar Jul 14 '22 20:07 muriloime

@muriloime hey! I tried to deploy my app with Dokku using your fork, but have this error: `-----> Preparing app for Rails asset pipeline Running: rake assets:precompile

   Done in 1389ms.
   rake aborted!
   LoadError: cannot load such file -- sassc`

I added //= link administrate_manifest.js to manifest,js

I also can't do bundle exec rake assets:precompile locally: rake aborted! LoadError: cannot load such file -- sassc Any ideas? Thanks!

czepesch avatar Jul 23 '22 13:07 czepesch

@muriloime hey! I tried to deploy my app with Dokku using your fork, but have this error: `-----> Preparing app for Rails asset pipeline Running: rake assets:precompile

   Done in 1389ms.
   rake aborted!
   LoadError: cannot load such file -- sassc`

I added //= link administrate_manifest.js to manifest,js

I also can't do bundle exec rake assets:precompile locally: rake aborted! LoadError: cannot load such file -- sassc Any ideas? Thanks!

Hey actually I had to modify selectize gem too ( and pointed the gem to my github fork). Very simple change, just changed the extension of the relevant files to me https://github.com/muriloime/selectize-rails/commit/130c59904d7b1605b6ae813b7cee462e5a6cc0c9.

muriloime avatar Jul 25 '22 08:07 muriloime

@muriloime I don't have this gem in my project and don't think I should use at all. If so, there is no way to make administrate work? or it is possible to make similar changes somewhere else?

czepesch avatar Jul 25 '22 14:07 czepesch

This gem is required by administrate

On Mon, 25 Jul 2022, 16:37 czepesch, @.***> wrote:

@muriloime https://github.com/muriloime I don't have this gem in my project and don't think I should use at all. If so, there is no way to make administrate work? or it is possible to make similar changes somewhere else?

— Reply to this email directly, view it on GitHub https://github.com/thoughtbot/administrate/pull/2148#issuecomment-1194135132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXO4RTGMEBCFSEH4WXUKO3VV2RAXANCNFSM5PBE6ARQ . You are receiving this because you were mentioned.Message ID: @.***>

muriloime avatar Oct 11 '22 08:10 muriloime

Kudos for this work, would be glad to see it land and reduce deploy sizes substantially

sodabrew avatar Jan 11 '23 01:01 sodabrew

I think this pr has a urgent priority because of tailwind conflict. Have a expected release date?

MuhammetDilmac avatar Jan 11 '23 08:01 MuhammetDilmac

@MuhammetDilmac @sodabrew I don't know if this PR will ever see the light of day, as it required changes on other gems as well. I use this in production but I had to point to github versions of other gems. If some admin has an idea and are willing to release this change I am more than prone to discuss.

muriloime avatar Jan 12 '23 13:01 muriloime

@muriloime was the only other change in selectize-rails? The version of Selectize used by selectize-rails is wildly out of date and looking at https://github.com/manuelvanrijn/selectize-rails, seems unlikely to be updated anytime. I would suggest removing it by importing selectize.js into this PR directly from https://github.com/selectize/selectize.js#installation

Comparing notes across projects, there is a Selectize plugin for ActiveAdmin: https://github.com/blocknotes/activeadmin_selectize (rather than using selectize-rails -- yet also uses sassc at runtime)

sodabrew avatar Jan 17 '23 23:01 sodabrew

Closing in favour of https://github.com/thoughtbot/administrate/issues/2311

pablobm avatar Apr 18 '23 09:04 pablobm