Skip to content

Comments

perf!: make yaml dependency optional#261

Merged
ai merged 1 commit intopostcss:mainfrom
ArnaudBarre:optionnal-yaml
Jun 1, 2024
Merged

perf!: make yaml dependency optional#261
ai merged 1 commit intopostcss:mainfrom
ArnaudBarre:optionnal-yaml

Conversation

@ArnaudBarre
Copy link
Contributor

Notable Changes

The direct yaml dependency is currently adding ~250kb to Vite bundle size for something that seems to be a very small usecase. I think it's better to make it a peer dependency and release a major

Commit Message Summary (CHANGELOG)

Make `yaml` a peer dependency. If you are using a yaml configuration file, migrate to JSON or install `yaml` to your project

Type

  • CI
  • Fix
  • Perf
  • Docs
  • Test
  • Chore
  • Style
  • Build
  • Feature
  • Refactor

SemVer

  • Fix (:label: Patch)
  • Feature (:label: Minor)
  • Breaking Change (:label: Major)

Checklist

  • Lint and unit tests pass with my changes
  • I have added tests that prove my fix is effective/works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes are merged and published in downstream modules

@ai
Copy link
Member

ai commented May 24, 2024

Yes, I like the idea of reducing node_modules and I think it is a good way to do it.

But since it is breaking change, I need to think a little.

@ArnaudBarre
Copy link
Contributor Author

Thanks for considering it! There is also a slight runtime perf benefit because node doesn't need to process the full yaml source code if you don't use it.

@ai
Copy link
Member

ai commented Jun 1, 2024

Seems like there is only ≈100 .postcssrc.yml files around all public GitHub repos https://github.com/search?q=path%3A**%2F.postcssrc.yml&type=code&ref=advsearch

Not really popular config.

@ai ai merged commit b99b537 into postcss:main Jun 1, 2024
@ai
Copy link
Member

ai commented Jun 1, 2024

Released in 6.0.

@ArnaudBarre ArnaudBarre deleted the optionnal-yaml branch June 2, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants