Git Product home page Git Product logo

Comments (8)

ericf avatar ericf commented on August 25, 2024

What's the proposed signature, and what happens when one already exists?

Do MessageFormat instances get their own copy of the class-level formatters? Or would adding a formatter the class potentially change the output of an existing instances format() method?

from intl-messageformat.

caridy avatar caridy commented on August 25, 2024
  • instances will have an empty object or whatever custom formatters were passed as 3rd argument with a __proto__ to global formatters.
  • if you set an instance formatter, or add a global formatter using __addFormatter, it will overrule whatever we have in there.
  • yes, adding new global formatters will affect all existing instances since they use __proto__ chain to lookup for global formatters if a local one does not exists.

from intl-messageformat.

ericf avatar ericf commented on August 25, 2024

Cool, sounds good!

from intl-messageformat.

apipkin avatar apipkin commented on August 25, 2024

Should there be a consideration for this in the final Intl.MessageFormat implementation. Meaning, since the intention of this is a polyfill, this should mimic the end use case of the final Intl.MessageFormat. I like the idea of this, but I would like to refrain from adding new notions to a polyfill unless we are anticipating this functionality in the final product.

from intl-messageformat.

caridy avatar caridy commented on August 25, 2024

@apipkin that's a fair question. The problem is that we don't even know what are the default formatters that browsers might implement. I'm ok with keeping this one in the backlog until we have a better visibility into the future.

from intl-messageformat.

ericf avatar ericf commented on August 25, 2024

We should think of this as a library, not a polyfill. We have hints as to what might come in a future version of ECMAScript, but we don't have a spec. We should think of this library and our experiences using it as driving forces to get the MessageFormat straw man proposals to real specs in the language.

from intl-messageformat.

apipkin avatar apipkin commented on August 25, 2024

I think that's a great way to look at it. With that in mind, is leading with a double underscore the correct api to present?

from intl-messageformat.

ericf avatar ericf commented on August 25, 2024

This is now provided via IntlMessageFormat.FORMATS.

from intl-messageformat.

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.