-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Deprecation #168
Comments
Yeap. I know that Sprockets is enough for some cases. But since I am supporting too many open source projects, I just do not have time for all of them. It is hard to choose, but I think you can understand that Sprockets integration is the best candidate. Sprockets time is over. It requires a lot of time to maintain the bridge between Ruby and JS. |
Is this something that someone else can take over? I have a massive production environment that cannot simply be switched to Webpacker easily, and having used both I can see there are still excellent reasons in some cases to stick with Sprockets for the moment. I need to find ways to keep this running without major disruption. |
You can become a maintainer of Autoprefixer Rails. But it will require a big refactoring, because the latest Browserslist stopped to work with our Node.js to Ruby bridge. Another option is to write a small Node.js CLI tool to run PostCSS with Autoprefixer. Then you will run it on your |
I'm happy to look at being a maintainer of this gem. What's the process for building the autoprefixer.js file? I'll have a play around with running a Node.js tool to run PostCSS. |
I'd do this through my company account. |
@utkarsh2102 maybe you want to take a project maintenance
If somebody will prove me with a good PR with new |
I opened #172 with steps to update the Edit: PR Closed due to not able to use |
@ai |
Hi @ai,
I'd love to help out but I am not well-versed with JS yet. And that's why I am a bit hesitant here. (that said, I'd be happy to even take care of some JS part with some mentorship if you have time!? :)) |
|
It's great to see some interest in maintaining this project. :) Is it still reasonable in 2020 to use Sprockets for CSS in a non-frontend-framework Rails app? I'd vote yes :) However, I was interested in #2 in the deprecation page:
Is there some guidance on what that would actually look like? From a quick look, it doesn't seem like sprockets has any kind of hook system with which to trigger a postcss compile. |
@brendon I suggest running Autoprefixer only on deploy (and not in development). In this case, just add an extra script to your deploy tool: rake assets
node ./scripts/autoprefixer |
That makes sense. I guess the only issue would be the potential for differences between the dev environment and production where the latest version of a browser still relies on a prefix but we want to use the non-prefixed version. |
Fixed `autoprefixer-rails` to `9.8.5` due to a deprecation warning that fails the tests. We'll need to see how discussion goes on whether the project stays alive. ai/autoprefixer-rails#168
Just to share what I did We have a deploy rake task with tasks like asset precompile, docker image build/push & running ansible playbook # `current_absolute_path` points to a folder created for deployment
%Q|npx postcss "#{File.join(current_absolute_path, "public/assets/**/*.css")}" --map --env production --config #{current_absolute_path} --verbose --replace| Our /* eslint-disable global-require */
module.exports = (ctx) => ({
map: ctx.options.map,
plugins: [
require("postcss-preset-env")({
autoprefixer: {
flexbox: "no-2009",
},
stage: 3,
}),
require("cssnano")({
preset: ["default", {
calc: {
// Some vendor like noty for `calc`
warnWhenCannotResolve: false,
},
discardComments: {
removeAll: true,
},
}],
}),
],
}) The only downside right now is what @brendon mentioned but we are fine with it |
We have a few project that relies on sprocket, and we aren't switching to webpack any time soon. I've submitted #176 as a starting point for supporting next major version of autoprefixer. |
@albb0920 Great. This PR looks awesome. I invited you to the GitHub project. I will keep RubyGems access for a few releases but then will give you access to RubyGems too. |
Thanks, got it! Can we drop the deprecation warnings? |
Absolutely. Send PR and remove the wiki page. I will release the patch release. |
Do you have a Twitter account to mention you? |
OK, I'll work on it, thanks! Yes, you can mention me at @albb0920 |
Does this mean you're abandoning sprockets-only Rails users?
For some setups, it isn't useful or easy just to switch to Webpacker instead of Sprockets. Do we now lose Autoprefixer support because of this?
The text was updated successfully, but these errors were encountered: