Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix full ICU on tests #4673

Merged
merged 2 commits into from
Apr 10, 2020
Merged

Fix full ICU on tests #4673

merged 2 commits into from
Apr 10, 2020

Conversation

Kmaschta
Copy link
Contributor

@Kmaschta Kmaschta commented Apr 10, 2020

Why tests on master are broken?
We haven't upgraded the package full-icu in a while, so with the publication of NodeJS 12.16.2, our version wasn't compatible.

Why we use full-icu to unit test React Admin?
I did some speleology, and found that 2017 commit for admin-on-rest 0.7: b7a2c98

At the time, <DateField /> component was introduced to Intl.DateTimeFormat to format date in many languages.
This works well on the browser, it also works well on unit tests since this API is supported by NodeJS. But by default NodeJS doesn't support all languages, so we had to add this package to test our implementation.
<NumberField /> also uses the Intl API.

Is full-icu obsolete, as explained on this issue of the package repository?
Since the version 8, at least, we can build NodeJS including full ICU with the command --with-intl=full-icu.
This would avoid installing another library to test React Admin.
This is even easier with nvm because you can run nvm install -s 12 --with-intl=full-icu
But we made the choice to ease contributors development, and not force them rebuilding their local NodeJS.

Will this package always be mandatory in the future?
Starting from NodeJS 13.x, NodeJS will be compiled with full-icu by default.
Hence, we might consider removing full-icu from the dev dependency when NodeJS 14.x will enter in Long Term Support (LTS) in October 2020.

@Kmaschta Kmaschta added the WIP Work In Progress label Apr 10, 2020
@Kmaschta Kmaschta added RFR Ready For Review and removed WIP Work In Progress labels Apr 10, 2020
@Kmaschta Kmaschta changed the title Fix ICU path Fix full ICU on tests Apr 10, 2020
@Kmaschta Kmaschta added WIP Work In Progress and removed RFR Ready For Review labels Apr 10, 2020
@Kmaschta Kmaschta added RFR Ready For Review and removed WIP Work In Progress labels Apr 10, 2020
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

Awesome!

@fzaninotto fzaninotto merged commit e078cb9 into master Apr 10, 2020
@fzaninotto fzaninotto deleted the fix-icu branch April 10, 2020 09:20
@fzaninotto fzaninotto added this to the 3.4.1 milestone Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants