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
Remove support for processors #3408
Comments
I believe we're not ready to drop processors. Thanks to @gucong3000 we know that we can use syntaxes instead of processors. It renders processors as not needed. Also, it eliminates situations when users can't lint files with a processor and without it using one configuration (styled-components/stylelint-processor-styled-components#187). We're not ready to drop processors, because most popular processors are not converted to syntaxes yet. I did a quick look at I emphasize on |
Thanks for tagging me @jeddy3! I'm not the slightest familiar with PostCSS's syntax parsers so I'm not sure if I can be of much help in the discussion, but it sounds like this has the potential to solve some of the big limitations we've encountered with the processor API. Writing a new library also may bring new life into the project and things like improved interpolation inference could happen which we've in theory wanted to do for a while, but just lacked contribution time to accomplish it. So from that point of view I definitely welcome this new exciting solution, it's definitely some great advantages you point out. The only thing I'd contribute is just that if you end up deprecating processors, of course make sure that the PostCSS ecosystem has matured enough at that point, and it should hopefully be at least as good as the processor ecosystem is now, so that there'd be no disadvantages in switching. Basically I'm just pointing out the obvious that you shouldn't rush it too much :). It's pretty exciting though! |
cc @chinesedfan, @mxstbr |
Yeah, as long as there's a long grace period where processors keep working (maybe with a depreciation warning that points to the postcss stuff) I'm fine with this change—just please don't drop the entire option overnight. |
Thanks for the mention, @jeddy3. I find the prospect of having autofix for object styles very exciting and @gucong3000 seems to have done a great job on postcss-jsx. I aslo agree with @mxstbr and @emilgoldsmith: ship processor support along side syntax support and see if the community points out some edge cases that might creep-up before completely removing the processor apis. |
Definitely. We'll add a deprecation warning and only remove support in a major release a few months down the line. |
sorry for delay |
I'm sorry @evilebottnawi I don't think I completely understand what you mean, and what it is processors can do for you that the postcss plugins (given their future maturity) wouldn't be able to handle, could you be a bit more specific? |
The feature isn't being removed, it's being replaced with another API based on PostCSS, which has more community support and can still work like a processor. |
Status update... We recently started to drum up community support for the syntaxes by:
@chinesedfan has kindly created an issue (https://github.com/stylelint/postcss-css-in-js/issues/3) outlining what we also need to add to the We want to provide first-class support for CSS-in-JS in stylelint, but we'll need help to make that happen. |
Close via #6479 |
Following on from #3264.
We added support for processors in
7.0.0
. Processors replaced the existingextractStyleTagsFromHtml
functionality with something more extensible, because we realised that bundling support for all formats that could embed CSS was unsustainable.The autofix feature was added after the processors system was built. As such, the processor system wasn't designed with autofix in mind and this has led to incompatibilities.
Recently, @gucong3000 proposed using PostCSS's syntax option to extract CSS-like code from the likes of CSS-in-JS, markdown fences,
<style>
tags andstyle=""
attributes etc. We'd previously only used PostCSS's syntax option for CSS-like languages themselves like Scss and Less, rather than as a means to extract CSS-like code from other formats.I believe @gucong3000 approach has merit as:
There are currently four syntaxes that extract CSS-like code:
<style>
tags of HTML-like files.There is a known limitation, though. PostCSS's syntax option only accepts a single syntax, whereas many processors can be used at the same time. I believe @gucong3000 has attempted to work around this limitation with postcss-syntax. When passed to PostCSS's syntax option, it attempts to infer what actual syntax (e.g. postcss-scss, postcss-styled etc) should be used for each file.
Now that we have a replacement for the processor system, should we deprecate it in favour of supporting just syntaxes?
I'm going to mention @zabute and @emilgoldsmith as authors of the glamorous and styled-components processors, respectively. I hope you both don't mind. I wanted to give you a heads-up of this discussion in case you have any thoughts you want to share. For example, is there something your processors do that isn't covered by these syntaxes? Incidentally, thank you for your work on these processors and for allowing stylelint to be used by people using CSS-in-JS.
The text was updated successfully, but these errors were encountered: