Skip to content

Change API to Addon instead of mixin#7

Closed
rxaviers wants to merge 4 commits intoglobalizejs:masterfrom
rxaviers:addons
Closed

Change API to Addon instead of mixin#7
rxaviers wants to merge 4 commits intoglobalizejs:masterfrom
rxaviers:addons

Conversation

@rxaviers
Copy link
Copy Markdown
Member

Depends on:

TODO:

  • Update docs accordingly.

@rxaviers
Copy link
Copy Markdown
Member Author

@rxaviers rxaviers force-pushed the addons branch 3 times, most recently from 391d585 to 74c5fed Compare April 28, 2015 22:30
@rxaviers
Copy link
Copy Markdown
Member Author

Examples updated to reflect addons.

The runtime production files can be compiled for the AMD example, but not (yet) for the CJS example.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary

@kborchers
Copy link
Copy Markdown
Collaborator

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.

@kborchers
Copy link
Copy Markdown
Collaborator

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.

@rxaviers
Copy link
Copy Markdown
Member Author

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;
@rxaviers
Copy link
Copy Markdown
Member Author

Rebased, only the addons change in here now. It still needs docs update.

@kborchers
Copy link
Copy Markdown
Collaborator

In general this looks good. I wonder if there is a more elegant way to do this rxaviers@fae8f30#diff-168726dbe96b3ce427e7fedce31bb0bcR23

@rxaviers
Copy link
Copy Markdown
Member Author

rxaviers commented May 2, 2015

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.

@kborchers
Copy link
Copy Markdown
Collaborator

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.

@rxaviers
Copy link
Copy Markdown
Member Author

rxaviers commented May 3, 2015

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) />
}} />

@kborchers
Copy link
Copy Markdown
Collaborator

Yeah, I think that's what I had before and I think I prefer that way for now.

@rxaviers
Copy link
Copy Markdown
Member Author

rxaviers commented May 4, 2015

I will change/revert and let you know.

@kborchers
Copy link
Copy Markdown
Collaborator

I would like to merge this. Can you revert that bit we talked about and ping me and I'll merge?

@rxaviers
Copy link
Copy Markdown
Member Author

Reverted

@kborchers
Copy link
Copy Markdown
Collaborator

Thanks landed

@kborchers kborchers closed this Jun 18, 2015
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

Successfully merging this pull request may close these issues.

2 participants