You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Use valid JavaScript identifiers for exports in vanilla browser modules
BREAKING CHANGE: Previous kebab-case keys in the `window` object changed to camelCase global vbariables. Usage of shims or tools loading UMD modules becomes easier. See the migration guide for more information.
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ Lightweight time zone listing and date converting. Intended for adding time zone
17
17
* Generated from the official time zone database version 2018g. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
18
18
* Minimal interface for time zone lookup and conversions. Parsing, formatting and manipulating dates is usually the task for a higher-level date library.
19
19
20
+
**Attention**: export identifiers in vanilla browser modules changed in the version 2.0.0. See the [migration guide] for more information.
21
+
20
22
### Table of Contents
21
23
22
24
-[Synopsis](#synopsis)
@@ -83,6 +85,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
83
85
84
86
## Release History
85
87
88
+
* 2018-06-10 v2.0.0 Use proper identifiers in vanilla browser modules.
86
89
* 2018-11-17 v1.8.0 Include time zone data for years 1970-2038.
87
90
* 2018-11-17 v1.7.0 Include full time zone data separately loadable.
88
91
* 2018-11-06 v1.6.0 Upgrade the time zone database to the version 2018g.
@@ -96,7 +99,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
96
99
97
100
## License
98
101
99
-
Copyright (c) 2018 Ferdinand Prantl
102
+
Copyright (c) 2018-2019 Ferdinand Prantl
100
103
101
104
Licensed under the MIT license.
102
105
@@ -107,3 +110,4 @@ Licensed under the MIT license.
Names of global variables that expose the exported objects in vanilla JavaScript modules changed. Basically, convert the kebab-case keys exposing the global objects to camelCase. For example: `window['timezone-support']` to `window.timezoneSupport`.
4
+
5
+
Nothing else changed. File names of scripts in the `dist` directory did not change. The structure of objects exported from these files did not change either. The behaviour of exposed functions did not change.
6
+
7
+
## Renamed Variables
8
+
9
+
Names of global variables that expose the exported objects in vanilla JavaScript modules changed. They do not contain hyphens any more and they became valid JavaScript identifiers. It was necessary to satisfy tools, which integrate UMD modules via shims.
The `lookup-convert` file is meant to be used together with a `data*` file. The name of the object-exposing variable (`timezoneSupport`) can be the same as the one exposed from `index*` files. It allows for easier dependency modifications without additional code changes in dependency sources.
25
+
26
+
The `data*` files are not meant to be used together; just one of them is supposed to be used with the `lookup-convert` file. The exposing variable name can be the same (`timezoneData`). It allows for easier swapping of data-files when having the exposing variable called always `timezoneData`.
27
+
28
+
## Change Examples
29
+
30
+
Replace keys that you used to consume objects exported from files in the `dist` directory:
@@ -202,13 +202,13 @@ Custom time zone data can be used if the module `lookup-convert` is loaded inste
202
202
If you want to use the time zone data for years 2012-2022 published by this project, you can simplify your code by using a bundled package with both data and code.
@@ -238,7 +238,7 @@ See the function [populateTimeZones](./API.md#populatetimezones) for more inform
238
238
239
239
Except for the time zone data for the three year spans bundled with this module, other data modules can be generated to customize the year span and thus the overall package size. There is a command line tool [`create-timezone-data`](./API.md#data-generator) for this included in this package.
240
240
241
-
For example, you can generate time zone data for years 1978-2028 and save it to the module `data-1978-2028.js` in the CommonJS format, which you wil bundle to your application:
241
+
For example, you can generate time zone data for years 1978-2028 and save it to the module `data-1978-2028.js` in the CommonJS format, which you will bundle to your application:
0 commit comments