Skip to content

Conversation

fnagel
Copy link
Member

@fnagel fnagel commented Nov 19, 2015

This PR introduces compiled formatters & parsers by using globalize-compile. It's using the lastet 1.1 rc6 of globalize.

We probably want to have the Grunt compile-globalize task to be more flexible -- not sure if we need to process other widgets dependencies with this.

Big thank you to @rxaviers for his help how to do this and quick bugfixes!

@fnagel
Copy link
Member Author

fnagel commented Nov 19, 2015

@jzaefferer @scottgonzalez @rxaviers

Ready for a first review!

Copy link
Member

Choose a reason for hiding this comment

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

@rxaviers Do you have an ETA on 1.1.0?

Copy link
Member

Choose a reason for hiding this comment

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

Nope. Technically the rc.6 is pretty close to 1.1.0. But, writing a blog post about it (for the release) is the biggest uncertainty on my end.

Copy link
Member

Choose a reason for hiding this comment

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

Can I help with that? Is that the blog post I've reviewed before?

Copy link
Member

Choose a reason for hiding this comment

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

The post you've reviewed is certainly a big portion of it, but 1.1.0 should include more (e.g., unit formatting). You are welcome to help. :)

@scottgonzalez
Copy link
Member

Overall, this looks good to me. The actual changes are fairly small :-)

@fnagel
Copy link
Member Author

fnagel commented Nov 25, 2015

Fixed the jshint tests.

@scottgonzalez
Copy link
Member

I'd say this is good to land.

Copy link
Member

Choose a reason for hiding this comment

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

While this package is pretty convenient, it also blows up an installed node_modules folder by 250 to 300 MB. @rxaviers is there any way to get an English-only cldr-data, since that's all we care about here (I think)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, we're actually compiling several locales.

Copy link
Member

Choose a reason for hiding this comment

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

Another idea: Can we install cldr-data as part of the compile-globalize grunt task? That'll make the task run a little longer, but avoid a lot of overhead for every other CI run and local install. Since we're committing the result to the repo, it seems pointless to install the dependency all the time.

Copy link
Member

Choose a reason for hiding this comment

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

Answering the first questions, although I see your line of thought is going somewhere else already...

@rxaviers is there any way to get an English-only cldr-data, since that's all we care about here (I think)?

No, cldr-data allows you to choose one of the coverage options given by CLDR (for instance, modern or full only).

@jzaefferer
Copy link
Member

Also reviewed the whole thing. Looks like the issue in tests/unit/date/helper.js is the only one that needs to be addressed before this can land, everything else can happen elsewhere.

@scottgonzalez
Copy link
Member

Looks good.

@fnagel
Copy link
Member Author

fnagel commented Dec 2, 2015

Just checking why the unit tests fail...

@fnagel
Copy link
Member Author

fnagel commented Dec 2, 2015

Mhh, this seems like a bug. Unit test does not fail when system date is November 30th.
Sadly these tests are not really documented. @rxaviers Any idea regarding the bug or the tests?

https://travis-ci.org/jquery/jquery-ui/builds/94433780#L257-L261
https://github.com/fnagel/jquery-ui/blob/datepicker-globalize/tests/unit/date/core.js#L160-L171

@fnagel
Copy link
Member Author

fnagel commented Dec 2, 2015

@scottgonzalez Merging this anyway, ok? Issue seems unrelated to the actual changes in this PR.

@jzaefferer
Copy link
Member

Would help to know which of the 5 assertions in that test is failing. The stack should tell, but only points at qunit.js.

Is the test failing without the changes from this branch? Then merging anyway seems fine.

@rxaviers
Copy link
Member

rxaviers commented Dec 2, 2015

Yeap, knowing which assertion (of the 5) is failing would help. Also, is a Globalize call providing a wrong result? If so, knowing which would help me to provide a quicker response.

@fnagel
Copy link
Member Author

fnagel commented Dec 2, 2015

The last test in this set is failing. Just tested this, fails on current datepicker branch too.

@fnagel
Copy link
Member Author

fnagel commented Dec 2, 2015

Also, is a Globalize call providing a wrong result?

There are no console errors or similar issues. Anything else I could check?

@jzaefferer
Copy link
Member

Let's merge then.

You can rewrite the assertion to get more useful output:

equal( firstMonth.month(), lastMonth.month() - 1 ); 

Also noticed that this against $.date(), so it'll change with the system time. Looks like other tests avoid that by calling setFullDate, for example date.setFullDate( 2012, 9, 16 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants