ljharb / json-stable-stringify

MIT License
55 stars 11 forks source link

Drop support for legacy CommonJS ? #16

Closed maximebochon closed 2 months ago

maximebochon commented 2 months ago

When depending on json-stable-stringify in an Angular 12 project, I get this warning:

Warning: [...] depends on 'json-stable-stringify'.
CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

@trusktr gives some explanation about that in another projet's issue : https://github.com/PrismJS/prism/issues/3703

ljharb commented 2 months ago

CJS is in no way legacy and will likely never go away entirely, and dropping it (going ESM-only) is incredibly user-hostile because it prevents CJS consumers from using it.

In other words, this isn't a good suggestion, projects that do it are hurting their users and the ecosystem, and either way, such a decision would be driven by maintainers, not by contributors.