dojo / i18n

:rocket: Dojo 2 - internationalization library.
http://dojo.io
Other
6 stars 19 forks source link

Remove `cldr-data` dependency #54

Closed mwistrand closed 7 years ago

mwistrand commented 7 years ago

Type: feature

Description:

Remove cldr-data as a dependency (making it just a development dependency), which makes CLDR optional for basic message loading/formatting capabilities. Since the presence of CLDR data can no longer be assumed, a couple additional changes were needed:

  1. cldr/load/webpack is drastically simplified, since all it needs to do is make sure the injected data are registered with Globalize.js
  2. cldr/load is somewhat more complicated, since it useful to now have the ability to check whether a particular CLDR object has been loaded (isLoaded).

If need be, isLoaded checks can be added to the individual formatter methods, but I left them out since Globalize.js already throws descriptive errors when the required CLDR packages have not been included.

Related Issue: #48

Please review this checklist before submitting your PR:

codecov-io commented 7 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@e082785). Click here to learn what that means. The diff coverage is 97.24%.

@@          Coverage Diff           @@
##             master   #54   +/-   ##
======================================
  Coverage          ?   98%           
======================================
  Files             ?    10           
  Lines             ?   350           
  Branches          ?    47           
======================================
  Hits              ?   343           
  Misses            ?     0           
  Partials          ?     7
Impacted Files Coverage Δ
src/main.ts 100% <ø> (ø)
src/cldr/load/webpack.ts 100% <100%> (ø)
src/cldr/locales.ts 100% <100%> (ø)
src/i18n.ts 96.55% <90.9%> (ø)
src/cldr/load.ts 96.77% <97.43%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e082785...328c3e3. Read the comment docs.