@carbon/charts-svelte 1.6.3 → 1.6.5

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 (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +29 -15
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.6.5](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.4...v1.6.5) (2023-02-27)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-svelte
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.6.4](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.3...v1.6.4) (2023-02-03)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-svelte
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.6.3](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.2...v1.6.3) (2022-12-23)
7
23
 
8
24
  **Note:** Version bump only for package @carbon/charts-svelte
package/README.md CHANGED
@@ -50,8 +50,8 @@ This is an overview of using Carbon Charts with common Svelte set-ups.
50
50
  building apps that support client-side rendering (CSR) and server-side rendering
51
51
  (SSR). SvelteKit is powered by [Vite](https://github.com/vitest-dev/vitest).
52
52
 
53
- In your `vite.config.js`, add `@carbon/charts` and `carbon-components` to
54
- `ssr.noExternal` to avoid externalizing the dependencies for SSR.
53
+ `@carbon/charts` and `carbon-components` should not be externalized for SSR when
54
+ building for production.
55
55
 
56
56
  ```js
57
57
  // vite.config.js
@@ -61,7 +61,10 @@ import { sveltekit } from '@sveltejs/kit/vite';
61
61
  export default {
62
62
  plugins: [sveltekit()],
63
63
  ssr: {
64
- noExternal: ['@carbon/charts', 'carbon-components'],
64
+ noExternal:
65
+ process.env.NODE_ENV === 'production'
66
+ ? ['@carbon/charts', 'carbon-components']
67
+ : [],
65
68
  },
66
69
  };
67
70
  ```
@@ -136,11 +139,14 @@ export default {
136
139
  onwarn: (warning, warn) => {
137
140
  // omit circular dependency warnings emitted from
138
141
  // "d3-*" packages and "@carbon/charts"
139
- if (
140
- warning.code === 'CIRCULAR_DEPENDENCY' &&
141
- /^node_modules\/(d3-|@carbon\/charts)/.test(warning.importer)
142
- ) {
143
- return;
142
+ if (warning.code === 'CIRCULAR_DEPENDENCY') {
143
+ if (
144
+ warning.ids.some((id) =>
145
+ /node_modules\/(d3-|@carbon\/charts)/.test(id)
146
+ )
147
+ ) {
148
+ return;
149
+ }
144
150
  }
145
151
 
146
152
  // preserve all other warnings
@@ -149,18 +155,26 @@ export default {
149
155
  };
150
156
  ```
151
157
 
152
- #### Dynamic imports
158
+ #### Code-splitting
153
159
 
154
- If using [dynamic imports](https://rollupjs.org/guide/en/#dynamic-import), set
155
- `inlineDynamicImports: true` in `rollup.config.js` to enable code-splitting.
160
+ If using [dynamic imports](https://rollupjs.org/guide/en/#dynamic-import), use
161
+ `type="module"` alongside `output.dir` for code-splitting.
156
162
 
157
- Otherwise, you may encounter the Rollup error
158
- `Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.`
163
+ ```diff
164
+ # index.html
165
+ - <script src="build/bundle.js"></script>
166
+ + <script type="module" src="build/index.js"></script>
167
+ ```
159
168
 
160
169
  ```diff
170
+ # rollup.config.js
161
171
  export default {
162
- + inlineDynamicImports: true,
163
- };
172
+ output: {
173
+ - format: "iife",
174
+ - file: "public/build/bundle.js",
175
+ + dir: "public/build",
176
+ }
177
+ }
164
178
  ```
165
179
 
166
180
  ### Webpack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts-svelte",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "Carbon charting components for Svelte",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "homepage": "https://github.com/carbon-design-system/carbon-charts#readme",
52
52
  "dependencies": {
53
- "@carbon/charts": "^1.6.3",
53
+ "@carbon/charts": "^1.6.5",
54
54
  "@carbon/telemetry": "0.1.0"
55
55
  },
56
56
  "peerDependencies": {