Change API to Addon instead of mixin#7
Conversation
|
This is specially interesting: https://github.com/kborchers/react-globalize/pull/7/files#diff-406807581e0b49f296c2beb81859ba21R51 |
391d585 to
74c5fed
Compare
|
Examples updated to reflect addons. The runtime production files can be compiled for the AMD example, but not (yet) for the CJS example. |
examples/amd/bower.json
Outdated
|
So I feel like this is a bit much for a single PR. Can you break out b8bbb14 into its own PR as well as the AMD/CJS stuff into another PR so that there would be a total of 3 PRs? I would like to review each of those separately. |
|
OK, I merged the other PRs so if you could break this into 1 PR for the Mixin->Addon change and another PR for the AMD/CJS stuff and rebase both that would be great. |
|
Absolutely, this needs to be broken down. Doing it... |
- More permissive `react` and `globalize` dependency range; - Bump `globalize` up to 1.0.0; - Browserify is used in the examples, not by this package;
|
Rebased, only the addons change in here now. It still needs docs update. |
|
In general this looks good. I wonder if there is a more elegant way to do this rxaviers@fae8f30#diff-168726dbe96b3ce427e7fedce31bb0bcR23 |
|
Yeap, me too. This line enables https://github.com/kborchers/react-globalize/pull/7/files#diff-406807581e0b49f296c2beb81859ba21R51, which renders the element (assuming it's a GlobalizeReact element) and get its output. |
|
Yeah, I know what it does I just don't like how it does it. Directly calling render() rather than letting React handle rendering "feels" wrong but not sure if there's a better way. |
|
I have no idea how to make that hack look better. But, one way to certainly get rid of it is to, well, get rid of it 😃. Instead of allowing ReactGlobalize elements to be passed as options, we allow Globalize. outputs: (as it was) task count 1000 formatted - <FormatMessage ref="formattedTask" locale={this.state.locale} path="task" variables={{
count: 1000,
- formattedCount: <FormatNumber locale={this.state.locale} value={1000} />
+ formattedCount: Globalize(this.state.locale).formatNumber(1000) />
}} /> |
|
Yeah, I think that's what I had before and I think I prefer that way for now. |
|
I will change/revert and let you know. |
|
I would like to merge this. Can you revert that bit we talked about and ping me and I'll merge? |
This reverts commit fae8f30.
|
Reverted |
|
Thanks landed |
Depends on:
TODO: