-
Notifications
You must be signed in to change notification settings - Fork 186
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
Run puma plugin in debug mode #507
base: main
Are you sure you want to change the base?
Conversation
Would the I would prefer not to have the default behavior in development change depending on whether you ran |
Yes, it is fine. I think the correct way to make I am not a big fan of env variables to configure rails app because there are separated dev, test and production environments. I was initially trying to configure it like that, but it didn't work. I understand that it might be different subsystems that control compression in tailwind and in pipeline, but I don't want to know about it if it can just work. |
Well, currently it is consistent. The default for this gem, since the first release, has been to generate unminified CSS by default. When you need to examine unminified CSS then the command The environment variable was accepted in #504 specifically to allow this "debug" behavior to be injected into the puma plugin (see #400 for discussion), it's not intended to be a permanent project configuration. As the name implies, it's meant for debugging. I think the current behavior is the right default for most people, and so I'm inclined to close this PR without merging. But maybe I'm misunderstanding why you want unminified CSS by default. Can you explain a bit more about your use case? Is examining the generated CSS something you do often? |
In my experience css compression is a thing that brings more problems than it solves. Why?The page we are currently at is loading https://github.githubassets.com/assets/global-21a7f868f707.css. It is compressed and takes 277KB. If we decompress it takes 319KB. So it is 13% reduction.
People might think that compression:
All of that makes even less sense when there is a gzip compression support for HTTP:
I am not sure why we are not using it out of the box yet. My conclusionCSS compression doesn't make my app better. I disable it for all environments whenever I encounter the need to disable it for the first time (like for debugging). So what I need is a consistent way to disable CSS compression. That is why config option makes sense. |
As far as I understood, puma plugin is only designed for development, so it makes sense to avoid CSS minification in this env.
tailwindcss-rails/lib/tailwindcss/commands.rb
Line 16 in 08486ae