Coder Social home page Coder Social logo

Comments (9)

dfreeman avatar dfreeman commented on June 1, 2024

I'm definitely on board with the idea (you're not the first person to hit this), but the final concatenation actually happens over in ember-css-modules — this package only handles the per-module stuff.

I think now that salsify/ember-css-modules#58 has landed, you could run postcss-sprites via ember-cli-postcss on the concatenated output, but having a baked-in, documented postprocess set of plugins would be much nicer.

Would you be up for tackling that in ember-css-modules? It would likely involve conditionally running this tree through something like broccoli-postcss if any postprocess plugins are configured.

from broccoli-css-modules.

alexlafroscia avatar alexlafroscia commented on June 1, 2024

Yup! I wasn't 100% sure what the right level to introduce this would be.

Thanks for the pointer on where to start looking. I'll get a PR together tomorrow.

from broccoli-css-modules.

alexlafroscia avatar alexlafroscia commented on June 1, 2024

So, I have an initial version of this working here:

https://github.com/alexlafroscia/ember-css-modules/tree/add-postprocess-plugin-set

The problem is that it relies on broccoli-postcss, which uses a different syntax for specifying the plugins, which looks like this:

[
  {
    module: require('autoprefixer'),
    options: { ... }
  },
  ...
]

Which means that the syntax, if using before and after and postprocess is kind of mixed

screen shot 2016-12-22 at 12 25 34 pm

How would you feel about supporting the { module: ... , options ... } syntax in the other two locations, so that it could all be consistent? The alternative is creating a fork of broccoli-postcss and depending on that.

from broccoli-css-modules.

dfreeman avatar dfreeman commented on June 1, 2024

I don't totally understand why broccoli-postcss is doing what it's doing with the module/options dance (looks like it's something to do with copying config around?), but it looks like @jasonmit's branch here switches over to broccoli-persistent-filter + postcss, which solves the consistency problem, right?

(Edit: and now I see you've merged that in since I last looked 🙂)

from broccoli-css-modules.

alexlafroscia avatar alexlafroscia commented on June 1, 2024

Yeah! @jasonmit and I work together, so he's been helping me with this 😀

I agree, it's a bit weird that broccoli-postcss differs from the "regular" syntax without a great reason. Not sure why that's necessary, but Jason's plugin seems to be exactly what I'm looking for.

from broccoli-css-modules.

alexlafroscia avatar alexlafroscia commented on June 1, 2024

@dfreeman do you have ideas on how I should set up tests for this new feature?

from broccoli-css-modules.

dfreeman avatar dfreeman commented on June 1, 2024

That's an excellent question. We briefly had Nodeland tests for the template transform in ember-css-modules, but ended up converting them to run in the browser when the Glimmer 2 alpha rolled out in order to use the rendering engine that was actually packaged with each version of Ember.

I think explicit tests for the postcss-persistent-filter would be useful to have, which probably means bringing back a Node test runner — the Mocha set up in this repo is probably relatively similar to what you'd want. Beyond that, some kind of smoke test to verify it actually works live (e.g. by adding a postprocess plugin to the dummy app and verifying it gets run) could prevent any careless regressions in the future.

from broccoli-css-modules.

alexlafroscia avatar alexlafroscia commented on June 1, 2024

Cool. I'll add those things a part of my PR. Might be a few days, I'm traveling for the holidays.

from broccoli-css-modules.

dfreeman avatar dfreeman commented on June 1, 2024

Sounds good! Feel free to ping me here or on Slack if there's anything I can do to help out — I'm traveling as well so may not be able to respond right away, but I'm super happy to have another dev getting some familiarity with the ECM codebase.

from broccoli-css-modules.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.