parcel
parcel copied to clipboard
feat: add @parcel/optimizer-svgo3 plugin
↪️ Pull Request
Fix #8701, but svgo 3.0 has breaking changes:
- Node.js 14+ is required for version
- stable package is replaced with native stable sort (required node 12+)
- and some plugins' name was changed
In this major version of parcel:
- introduce two new plugins for svgo 3.
-
@parcel/optimizer-htmlnano3
-
@parcel/optimizer-svgo3
- use them with config:
{
"extends": "@parcel/config-default",
"optimizers": {
"*.{html,xhtml}": ["@parcel/optimizer-htmlnano3"],
"*.svg": ["@parcel/optimizer-svgo3"]
}
}
In the next major of parcel:
- remove
optimizers/htmlnano-3
andoptimizers/svgo-3
. - change
optimizers/htmlnano
andoptimizers/svgo
to work with svgo 3.
💻 Examples
🚨 Test instructions
✔️ PR Todo
- [x] Added/updated unit tests for this change
- [x] Filled out test instructions (In case there aren't any unit tests)
- [x] Included links to related issues/PRs
Are there any breaking changes in this release?
Are there any breaking changes in this release?
Add to the comment.
Node.js 14+ is required for version
Parcel (officially) supports Node 12, but since that's EOL we should probably move on anyway.
I'm more concerned that the plugin names seem to have changed. That would break people's config files.
Node.js 14+ is required for version
Parcel (officially) supports Node 12, but since that's EOL we should probably move on anyway.
I'm more concerned that the plugin names seem to have changed. That would break people's config files.
All right, wait the next major version?
We have a similar situation here as well: https://github.com/parcel-bundler/parcel/pull/7922
OK. Let me try.
@devongovett @mischnic Please review this pr.
Hey sorry @jack0pan. We haven't yet figured out what we want to do here. Introducing a whole bunch of new plugins that users must manually upgrade isn't ideal. Ideally new projects would automatically get the new version while existing projects would stick with the version they have until they decide to upgrade. I'm not sure if there is a way to do that. One idea was proposed in https://github.com/parcel-bundler/parcel/pull/7922#issuecomment-1100140323
Bump a major version on @parcel/transformer-mdx. Change the dependency range in @parcel/config-default to e.g. ^2.4.1 || ^3.0.0. This way, existing projects will continue to work with the old version and would need to manually update the version installed in their projects, but new projects would automatically get the latest when auto installed. I think this is more optimal, but I have not tested whether it will actually work at the moment or whether we need to make changes to support it.
I still have not tested what package managers do in this case. Would be good to figure it out though because this is going to keep happening.
- [ ] https://github.com/jhines2k7/parcel...