migrate code base to media-query-list-parser
see :
- https://github.com/postcss/postcss-media-minmax/issues/42
- https://github.com/csstools/postcss-plugins/tree/postcss-preset-env--v8/packages/media-query-list-parser#readme
summary :
- travis -> github workflow
- node 10 -> node 14
- javascript -> typescript
- regexp -> media-query-list-parser
Our media query list parser has a very large OM and it is a low level API. Working with this in plain JavaScript is really painful. It is much easier to work with from TypeScript.
To support TypeScript I've added the build config (rollup) from the csstools mono repo. There are other ways to get a similar result, but this is one I am comfortable with.
This pull request fixes a few issues but mostly focusses on using the new parser and OM to achieve the same outcome.
note :
Totally fine if this is not a direction you want to take with this plugin. What works for us doesn't necessarily work for you :)
@yisibl Do you have time in the next few weeks to look at this?
We are hoping to wrap up all work for postcss-preset-env version 8 and would like to include an updated version of this plugin.
As I said before we totally understand it if you want to go in another direction.
Thank you for your contribution, I need to chat with my partner and get back to you.
@yisibl Any news here?
Thank you for your continued interest, I should have time during the Chinese New Year to carry out my work here.
Related issues that will likely be fixed by this change :
- https://github.com/postcss/postcss-media-minmax/issues/38
- https://github.com/postcss/postcss-media-minmax/issues/34
- https://github.com/postcss/postcss-media-minmax/issues/19
- support for
<ratio>in queries that need altered values (@media (0/0 < aspect-ratio < 16/9))
@yisibl Any chance you could give this another look?
Again totally fine if this parser is not something you want to adopt but we really want to ship an improved version for postcss-preset-env. We also don't mind maintaining a fork but we prefer to contribute here.
The parser and underlying tokenizer have been in use now for months in both postcss-preset-env and stylelint without any issues.
@romainmenke Sorry, too busy with work this month, I'm afraid I'll have time next month!
That is fine @yisibl :)
We really want to move forward with this, given the momentum this feature currently has in browsers.
I've created a new plugin based on this PR in the csstools mono repo. I've also added a bunch more tests, including browser tests.
Ideally these patches find there way back to this plugin in some form or another after which we can delete the forked plugin and set postcss-preset-env right again :)
I've already updated this PR with the latest bug fixes. I haven't updated the PR yet that doesn't include TypeScript.