Coder Social home page Coder Social logo

Comments (5)

remcohaszing avatar remcohaszing commented on July 25, 2024 1

Some considerations:

  • Dual package hazard
  • Publishing both CJS and ESM, also means you need to publish type definitions for both CJS and ESM. Even in case they have the same content, their file extension makes them behave differently.
  • module.exports is not the same as export default. Neither is module.exports.default. Ideally you switch to named exports to minimize exports compatibility issues.

from classnames.

jonkoops avatar jonkoops commented on July 25, 2024 1

Even in case they have the same content, their file extension makes them behave differently.

In all likelihood we'd have to roll bespoke type definitions for both CommonJS and ESM to be actually correct, considering the TypeScript compiler cannot emit types for a different module format.

from classnames.

dcousens avatar dcousens commented on July 25, 2024

Alternatively, we let the dust settle on the 2.x.y branch for a few weeks, and if that remains stable, we then go ESM only for 3.0.0

from classnames.

jonkoops avatar jonkoops commented on July 25, 2024

That would have my preference as well, the way I see it we can keep supporting 2.x, so if users need time to migrate they can keep using that version for the foreseeable future.

from classnames.

jonkoops avatar jonkoops commented on July 25, 2024

I'll consider this as a resolved discussion, we can make 3.0 entirely ESM, as it will simplify the maintenance for us, and reduce the amount of weird edge-case bugs we might not be able to foresee. I can commit to supporting 2.0 with bug fixes and security patches, so users that cannot migrate to directly can continue to use that version.

from classnames.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.