adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

includeTimeZone: '2010-2020' broken #231

Closed kekbur closed 7 years ago

kekbur commented 7 years ago

The latest release of moment-timezone (0.5.12) has broken the ember-moment configuration option includeTimeZone: '2010-2020'. The new truncated time zone data file covers years 2012-2022.

$ ember build -prod
[...]
The Broccoli Plugin: [Funnel] failed with:
Error: ENOENT: no such file or directory, lstat '[...]/tmp/funnel-input_base_path-qB4w31tO.tmp/builds/moment-timezone-with-data-2010-2020.js'

Trying to use 2012-2022 as the configuration value produces the following output:

$ ember build -prod
ember-moment: Please specify the moment-timezone dataset to include as either "all", "2010-2020", or "none".

Would it be possible to support configuration value truncated, which would automatically select the current truncated time zone dataset?

joestein216 commented 7 years ago

Seems like ember-moment is doing the right thing and moment-timezone introduced a breaking change in a patch release.

This workaround kept me going today:

https://github.com/moment/moment-timezone/issues/466

I can't really think of a way to keep the includeTimeZone options in sync with moment-timezone unless moment-timezone also followed and provided a 'truncated' option; which sounds like a more robust solution.

Maybe 'recent' over 'truncated'

jasonmit commented 7 years ago

I released ember-cli-moment-shim 3.0.3 to lock moment-timezone to <= 0.5.11 and I'm in the process of versioning 3.1.0 which will support 2012-2022 and will warn, but continue, if you have 2010-2020 set.

If you use 2010-2020 you'll see a deprecation warning to change the config option from "2010-2020" to "subset". This signifies you only want the "modern" subset of data and avoid another future bug in a few years when they rename the file again and change its content.

If your app targets 2010-2020, I'd lock the dependency of moment-timezone to <= 0.5.11. If your app is flexible enough to accept 2012-2022 (and whatever it becomes in the future) then don't worry about it.

jasonmit commented 7 years ago

3.1.0 was just versioned with the deprecation of "2010-2020" and the new option name "subset" (will scale better :)).

RobbieTheWagner commented 4 years ago

Can someone better explain how these subsets work? It saves some bytes to use the subset, instead of all, but I am unclear on when they change and if it might break things.