globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 603 forks source link

Stop supporting AMD in a version 2.0? #810

Open rxaviers opened 6 years ago

rxaviers commented 6 years ago

I believe nowadays everyone uses ES7 modules or commonJS (with a sort of webpack for the web) or are moving towards it.

The goal of this issue is to collect community feedback (if any) about moving this path forward.

Related issues:

marvinhagemeister commented 6 years ago

I'd love if globalize would go with a more modern module system. We can support both commonjs and es-modules easily for maximum compatibility with node and bundlers like webpack. This add support for automatic tree-shaking of gloablize so that a user doesn't have to care what needs to be included or not. That is something bundlers are a lot better optimized for anyways.

// package.json

{
  "main": "path/to/common-js/bundle.js",
  "module": "path/to/es-modules/bundle.js"
  // ...
}
Makepool commented 6 years ago

Globalize not supporting ES modules is the only reason I'm not currently using it. I've been completely unable to get it to work with the latest version of Webpack. I think support for ES modules would bring a lot more people to the Globalize table and make using the library trivial for anyone who'd just found it.

onigoetz commented 6 years ago

I'm very interested in this And I can make a pull request to do this and use Webpack/Rollup for the builds

rxaviers commented 6 years ago

Awesome, :+1:. Sounds good to me. Having said that, it's important to note this will cause conflicts to existing PRs, so we'll want to merge (at least) the ones listed on https://github.com/globalizejs/globalize/milestone/3 first. I have had very little bandwidth and any help reviewing these PRs and making sure they are good to merge are welcome.

willcooley commented 8 months ago

What’s the status on this to support a more modern module system as I saw nothing in the milestone link? Vitejs needs it for easier compiler building, and same as Angular projects wanting to use the new es build system.