BladeRunnerJS / brjs

BladeRunnerJS (BRJS) is an open source development toolkit and framework for modular construction of large single-page HTML5 apps. It consists of a set of conventions, supporting tools and micro-libraries that make it easy to develop, test, deploy and maintain complex JavaScript apps.
http://bladerunnerjs.org/
GNU Lesser General Public License v3.0
229 stars 36 forks source link

Upgrade momentjs to version 2.9 #1228

Open james-s-turner opened 9 years ago

james-s-turner commented 9 years ago

This version splits momentjs into two parts

  1. The core library (11.6K zipped)
  2. Library that includes lots of locales (42K zipped)

In many apps they don't need the full set of supplied locales so lots of uneeded code is downloaded. We should probably supply a minimal locales file for English only, then users can create cutdown versions and put that in their app libs.

We have had a Caplin issue raised that the whole of moment is downloaded just to use the date-formatting functions needed for our br.i18n.Translator function. https://jira.caplin.com/browse/PCTLIBRARY-1223 It would be good to not download the whole of moment just to use our i18n

andy-berry-dev commented 9 years ago

This sounds like a quick win. One for 1.0?

charliehw commented 9 years ago

There is a discrepancy between the way the date parsing and date formatting is handled within brjs which causes some problems when parsing dates in some locales. The DateParser uses momentjs, and its bundled localisation config to parse dates in most cases. However the DateFormatter uses the Translator, which in turn uses i18n properties for localisation.

A specific issue this causes is when parsing dates in MMM format in DE locale. Parsing fails because: The formatter formats the month name to "Mär" (from an i18n property) The parser expects the month name to be "Mär." (from the momentjs locale configuration)

There are probably other localisation issues caused by this discrepancy.

charliehw commented 9 years ago

The encoding of some of the localised characters is also broken in the moment.js file we are currently using. e.g. German März should be März

andy-berry-dev commented 9 years ago

I've asked @thanhc to verify whether the encoding issues are specific to the 'thirdparty' bundler or the library itself.