@geotab/zenith 2.0.0-beta.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +35 -1
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -42,7 +42,41 @@ Zenith library provides components defined in Zenith Design System. It includes
42
42
 
43
43
  ### 2.0.0
44
44
 
45
- * Add support for EcmaScript modules
45
+ We're excited to announce that **Zenith now supports EcmaScript Modules** (ESM)! This major release brings modern JavaScript module support to help you build better, more efficient applications.
46
+
47
+ **Why ESM Support Matters**
48
+
49
+ ESM is the modern standard for JavaScript modules in frontend development, bringing significant advantages:
50
+ * Superior tree-shaking: ESM's static structure enables bundlers to analyze your imports at build time and eliminate unused code more effectively, resulting in smaller bundle sizes
51
+ * Future-proof: ESM is the JavaScript standard moving forward, ensuring long-term compatibility
52
+
53
+ #### Important migration notes
54
+
55
+ While this major release does not include any API changes, there's a critical configuration requirement:
56
+
57
+ **Avoid Mixing Module Systems**
58
+
59
+ Your bundler must import all JavaScript files from either dist (CommonJS) or esm (ESM) — never both. Mixing imports can cause issues with React context and other shared state. Problematic example:
60
+ ```
61
+ import { Button } from '@geotab/zenith'; // May use ESM
62
+ import { Card } from '@geotab/zenith/dist/Card'; // Uses CommonJS
63
+ // ❌ This mixing can break React context!
64
+ ```
65
+
66
+ Good example:
67
+ ```
68
+ import { Button } from '@geotab/zenith'; // May use ESM
69
+ import { Card } from '@geotab/zenith/esm/Card'; // Uses ESM as well
70
+ ```
71
+
72
+ #### Recommended Approach
73
+
74
+ Since many modern bundlers prioritize ESM by default, we recommend one of these strategies:
75
+
76
+ * **Use ESM** (recommended): ensure your bundler configuration prioritizes the esm directory
77
+ * **Use CommonJS** (for compatibility): configure your bundler to prioritize CommonJS and ensure all imports use consistent paths
78
+
79
+ Upgrade today to take advantage of modern JavaScript module support and improved tree-shaking capabilities!
46
80
 
47
81
  ### 1.26.6
48
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geotab/zenith",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0",
4
4
  "description": "Zenith components library on React",
5
5
  "main": "dist/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -11,9 +11,6 @@
11
11
  "**/react-chartjs/dateAdapter.ts",
12
12
  "**/react-chartjs/dateAdapter.js"
13
13
  ],
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
14
  "scripts": {
18
15
  "test": "npm run clean && npm run test-build && jest",
19
16
  "start": "npm run storybook --loglevel verbose",
@@ -45,6 +42,7 @@
45
42
  "@babel/preset-env": "^7.24.3",
46
43
  "@babel/preset-react": "^7.24.1",
47
44
  "@babel/preset-typescript": "^7.24.1",
45
+ "@storybook/addon-docs": "^9.1.15",
48
46
  "@storybook/addon-links": "^9.1.15",
49
47
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
50
48
  "@storybook/react-webpack5": "^9.1.15",
@@ -71,8 +69,7 @@
71
69
  "style-loader": "^4.0.0",
72
70
  "typescript": "^5.4.3",
73
71
  "webpack": "^5.96.1",
74
- "xml2js": "^0.6.0",
75
- "@storybook/addon-docs": "^9.1.15"
72
+ "xml2js": "^0.6.0"
76
73
  },
77
74
  "dependencies": {
78
75
  "chart.js": "^4.4.6",
@@ -99,5 +96,8 @@
99
96
  "last 1 firefox version",
100
97
  "last 1 safari version"
101
98
  ]
99
+ },
100
+ "publishConfig": {
101
+ "access": "public"
102
102
  }
103
103
  }