Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
This file is not shipped in the npm package — the tarball root is `lib/`, which carries
`README_NPM.md` as its readme.

## [Unreleased]

### Fixed

- The import-time `wasmUrl: "/scichart.wasm"` default could overwrite the app's own
`SciChartSurface.configure(...)` when chart code is lazy-loaded and `configureDefaults` is
evaluated after it. The default is now applied only while `SciChartSurface.isWasmConfigured`
is false, so the app's configuration wins in either order. Requires scichart 6.0.8, which adds
that flag.

### Changed

- `scichart` peer dependency raised to `>=6.0.8`.
- Surfaces returned from `initChart` are always marked as externally lifecycle-managed; the
guard for cores without the flag is gone now that the peer floor includes it.

## [2.0.0]

The 2.0 line targets SciChart.js v6 and is built and verified against `scichart` 6.0.1.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The SciChartReact itself is MIT licensed, find the core library licensing info a
### Prerequisites

- `react` 16.14+
- `scichart` 6.0.0+ — for scichart 3.x-5.x use scichart-react 1.x
- `scichart` 6.0.8+ — for scichart 3.x-5.x use scichart-react 1.x

### Installing

Expand All @@ -39,15 +39,17 @@ new CopyPlugin({ patterns: [{ from: "node_modules/scichart/_wasm/", to: "" }] })

Find detailed info at [Deploying Wasm Docs](https://www.scichart.com/documentation/js/v6/2d-charts/surface/deploying-wasm/)

By default scichart-react applies the following configuration:
By default scichart-react applies the equivalent of:

```typescript
SciChartSurface.configure({
wasmUrl: "/scichart.wasm"
});
```

These defaults are applied at import time by the `configureSciChartDefaults` module, which is bundled whenever your app uses the chart components. Your own `SciChartSurface.configure(...)` / `loadWasmFromCDN()` calls always run after it and take precedence.
The core's own default is the page-relative `"scichart.wasm"`, which resolves to a different file on every route of a single-page app. The default is applied at import time by the `configureSciChartDefaults` module, which is bundled whenever your app uses the chart components.

It is applied only while your app has not configured wasm loading itself (`SciChartSurface.configure(...)`, `loadWasmFromCDN()`, `loadWasmLocal()`), so your configuration wins whichever module is evaluated first.

### Using

Expand Down
14 changes: 4 additions & 10 deletions README_NPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The SciChartReact itself is MIT licensed, find the core library licensing info a
### Prerequisites

- `react` 16.14+
- `scichart` 6.0.0+ — for scichart 3.x-5.x use scichart-react 1.x
- `scichart` 6.0.8+ — for scichart 3.x-5.x use scichart-react 1.x

### Installing

Expand All @@ -35,23 +35,17 @@ new CopyPlugin({ patterns: [{ from: "node_modules/scichart/_wasm/", to: "" }] })

Find detailed info at [Deploying Wasm Docs](https://www.scichart.com/documentation/js/v6/2d-charts/surface/deploying-wasm/)

**Notice that by default scichart-react applies the following configuration:**
By default scichart-react applies the equivalent of:

```typescript
SciChartSurface.configure({
wasmUrl: "/scichart.wasm"
});
```

**which is different from the core library configuration:**
The core's own default is the page-relative `"scichart.wasm"`, which resolves to a different file on every route of a single-page app. The default is applied at import time by the `configureSciChartDefaults` module, which is bundled whenever your app uses the chart components.

```typescript
SciChartSurface.configure({
wasmUrl: undefined
});
```

These defaults are applied at import time by the `configureSciChartDefaults` module, which is bundled whenever your app uses the chart components. Your own `SciChartSurface.configure(...)` / `loadWasmFromCDN()` calls always run after it and take precedence.
It is applied only while your app has not configured wasm loading itself (`SciChartSurface.configure(...)`, `loadWasmFromCDN()`, `loadWasmLocal()`), so your configuration wins whichever module is evaluated first.

### Using

Expand Down
10 changes: 5 additions & 5 deletions bundle-check/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundle-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"rimraf": "^5.0.10",
"rollup": "^4.24.4",
"rollup-plugin-esbuild": "^6.1.1",
"scichart": "6.0.1",
"scichart": "6.0.8",
"scichart-react": "file:../lib",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
Expand Down
8 changes: 4 additions & 4 deletions demos/electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demos/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"electron-squirrel-startup": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"scichart": "6.0.1",
"scichart": "6.0.8",
"scichart-react": "file:../../lib"
}
}
26 changes: 26 additions & 0 deletions demos/features/wasm-url-order/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# wasmUrl load-order repro

Reproduces the issue the SciChart.JS.Examples site worked around in
[3a6696f — update to scichart 6.0.6](https://github.com/ABTSoftware/SciChart.JS.Examples/commit/3a6696f079fe81b4786b4a5f28cc0e1145b2b9a2):
scichart-react applies `SciChartSurface.configure({ wasmUrl: "/scichart.wasm" })` when its
`configureDefaults` module is evaluated, and in a code-split app that can happen *after* the app's
own `configure` call, overwriting it.

The app is served under `/demo/` (like the Examples site in production) and configures
`wasmUrl: "/demo/scichart.wasm"`. Its only eager import from `scichart-react` is `SciChartGroup`;
the chart component is loaded through a synchronous `require.context`, evaluated after the app's
module body. `scichart-react` and `scichart` come from npm, not from this repo's `lib/`.

```
npm install
npm run build # broken variant
npm start # http://127.0.0.1:8090/demo/
```

Expected: `wasmUrl: /scichart.wasm`, a 404 for `/scichart.wasm`, the chart never renders.

```
npm run build:fixed # adds `import "scichart-react/configureDefaults"` before the app's configure
```

Expected: `wasmUrl: /demo/scichart.wasm`, the chart renders.
Loading
Loading