Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECMA402 abstract methods #109

Open
longlho opened this issue Aug 19, 2020 · 9 comments
Open

ECMA402 abstract methods #109

longlho opened this issue Aug 19, 2020 · 9 comments

Comments

@longlho
Copy link

longlho commented Aug 19, 2020

Hi there,

We wrote a lot of ECMA402 abstract ops for formatjs and I'm curious if the maintainers would be open to us moving things over here?

Thanks!

@ljharb
Copy link
Owner

ljharb commented Aug 19, 2020

That's a great question.

Currently it's only 262 methods, and it's split out by year. If we added 402, I'd want to also go back and add them for previous years.

In v2, the "manifest" exports will all be removed, so there wouldn't possibly be any bundle size increase from adding these - but in v1, every addition does add a cost for anyone importing an ES object.

If you'd be willing, sending a PR for all of the current ones would be great! However, instead of mixing them with 262 operations (since 402 also redefines some of them), what about adding an ecma402 top-level directory, and adding year folders in there?

@longlho
Copy link
Author

longlho commented Aug 19, 2020

kk I'll give that a try

@mpcsh
Copy link

mpcsh commented Aug 20, 2020

@longlho would you be interested in coordinating on some of this work? I wrote half a polyfill of Intl.Segmenter as part of my stage 3 review; to turn it into an actual polyfill, I need to add a bunch of 402 methods to es-abstract. I'd love to work together!

@longlho
Copy link
Author

longlho commented Aug 20, 2020

Yeah definitely ;) some project management help to plan out the work & ofc actual contribution would be awesome!!

@mpcsh
Copy link

mpcsh commented Aug 20, 2020

let's talk - are you on IRC? I don't see anyone with your username. alternately, feel free to DM me on twitter.

@longlho
Copy link
Author

longlho commented Aug 21, 2020

Btw adding 402 from previous years would be a huge amount of maintenance from what I've seen. Since ECMA402 correctness is "best-effort" and a ton of things are ILND (implementation-locale-numberingSystem-dependent) some stuff would have to be completely rewritten. For example: the algorithm to parse & validate locale changed recently in ES2020 where it used to be BCP47, now it's canonicalized UTS35 BCP47 which is a different algorithm.

@ljharb
Copy link
Owner

ljharb commented Aug 21, 2020

Sure, but we can start with just 2020, make it easy to add 2021, and then someone who's obsessive about completeness (hi!) can easily fill in older years over time.

@longlho
Copy link
Author

longlho commented Aug 21, 2020

hmm so our implementations of ecma402 uses TypeScript specifically since the InternalSlot declared in Formatters are very complex (e.g http://ecma-international.org/ecma-402/7.0/index.html#numberformat-objects is a 4-level nested attributes

diagram

So without TS it's very hard for me to maintain. I'm prob just gonna keep ecma402 abstract ops separately on top of es-abstract instead of merging this w/ this repo.

@ljharb
Copy link
Owner

ljharb commented Aug 21, 2020

Fair enough; let's keep this open in case you change your mind, or in case @mpcsh is still willing to contribute any AOs :-)

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

No branches or pull requests

3 participants