Comments (8)
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.
- 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.
Cool, sounds good!
from intl-messageformat.
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.
@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.
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.
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.
This is now provided via IntlMessageFormat.FORMATS
.
from intl-messageformat.
Related Issues (20)
- Mustache (and Backbone) integration HOT 3
- Formatting dynamic lists? HOT 4
- Better way to display currently selected item from a list HOT 1
- How to use formatMessage API ? HOT 1
- Outdated browser support information in README
- values for 0
- Need default format for time Type HOT 1
- Support datetime type HOT 3
- JS Import, Webpack HOT 6
- Typescript typings HOT 1
- Allow passing date param in string format HOT 1
- Empty string in plural syntax throws error HOT 1
- Use Intl.PluralRules
- ES6 module for browser HOT 2
- Expose parentLocale info via public API HOT 3
- How can I output the 24 hour time format (14:00 instead 2:00 PM)? HOT 2
- If adding a judgement of environment variable can be better HOT 1
- Causing crash in production environment HOT 3
- How to define default value for context variables? HOT 2
- 3.0 - TypeError: Cannot read property 'parse' of undefined HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intl-messageformat.