Conversation
Bump DataVis & DataVis NITRO versions, fix type issues.
## Architecture
DataVis NITRO is now sourced from a git submodule at packages/datavis/
instead of a git URL npm dependency. The datavis code is pre-bundled
into the @mieweb/ui/datavis addon entry point (dist/datavis.js) so
consumers do not need to install datavis separately.
### Package structure
- Main package (@mieweb/ui): No datavis code -- unaffected consumers
pay zero cost for data visualization.
- Opt-in addon (@mieweb/ui/datavis): DataVisNITRO components are
pre-bundled in dist/datavis.js. Consumers simply import:
import { DataVisNitroGrid } from '@mieweb/ui/datavis';
- Source: packages/datavis/ (git submodule pinned to commit 2b32e15).
Developers must clone with --recurse-submodules or run:
git submodule update --init
### What changed
- Added packages/datavis as a git submodule (.gitmodules)
- package.json: datavis dependency changed from git URL to
file:./packages/datavis; removed wcdatavis from optionalDependencies
and devDependencies
- tsup.config.ts: removed datavis, wcdatavis, and jquery from the
external list so datavis is bundled from source into the addon
- src/components/DataVisNITRO/DataVisNITRO.tsx: updated imports from
wcdatavis/src/ to datavis/wcdatavis-lib/src/ (datavis bundles its
own vendored copy of the wcdatavis core library)
- src/types/wcdatavis.d.ts: updated module declarations to match new
import paths; removed Grid and index.js modules (WCDataVis-only)
- src/datavis.ts: removed WCDataVis re-export
- Deleted src/components/WCDataVis/ entirely
### Why wcdatavis was removed
The datavis package includes a vendored wcdatavis-lib/ that exports
ComputedView, Source, and other symbols needed by DataVisNITRO. The
standalone wcdatavis npm dependency (and its jQuery UI plugin setup)
was only needed by the legacy WCDataVis component which has been
removed.
### Dependencies
- jQuery remains as an optional dependency because
datavis/wcdatavis-lib uses it internally.
- wcdatavis is fully removed from all dependency sections.
- The packages/datavis/ submodule folder does NOT ship in the npm
package (the files field only includes dist/, README.md, LICENSE).
There was a problem hiding this comment.
Pull request overview
Adds a new opt-in @mieweb/ui/datavis entry point that bundles DataVis NITRO from a packages/datavis git submodule, while removing legacy WCDataVis usage and updating build/Storybook wiring accordingly.
Changes:
- Add
@mieweb/ui/datavisbuild entry + package export map and newDataVisNITROwrapper component/stories. - Update type shims for
datavis/wcdatavis-libandjquery, plus Storybook config/assets for local development. - Adjust dependencies/lockfiles for the new datavis sourcing approach (submodule + local
file:reference).
Reviewed changes
Copilot reviewed 13 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tsup.config.ts |
Adds datavis entry point and adjusts externals for the build. |
src/types/wcdatavis.d.ts |
Declares modules for datavis/wcdatavis-lib imports. |
src/types/jquery.d.ts |
Adds a minimal ambient module declaration for jquery + window globals. |
src/index.ts |
Notes DataVis is also exported via a separate entry point. |
src/datavis.ts |
New addon entry re-exporting DataVisNITRO components. |
src/components/DataVisNITRO/index.ts |
Barrel exports for DataVisNITRO components and types. |
src/components/DataVisNITRO/DataVisNITRO.tsx |
New React wrapper around DataVis NITRO grid/view. |
src/components/DataVisNITRO/DataVisNITRO.stories.tsx |
Storybook stories for the new DataVisNITRO components. |
src/components/Address/AddressForm.tsx |
Refactors Google Maps typings to local interfaces. |
pnpm-lock.yaml |
Lockfile updates for new/optional deps (datavis, jquery, font-awesome). |
package.json |
Adds ./datavis export, adds font-awesome peer, and adds datavis/jquery deps. |
package-lock.json |
Lockfile changes that currently conflict with the PR’s stated dependency changes. |
.storybook/public/sample-data.json |
Adds sample dataset for DataVisNITRO stories. |
.storybook/preview-head.html |
Attempts to load Font Awesome CSS for DataVis icons. |
.storybook/main.ts |
Adds Vite alias/optimizeDeps logic for DataVis-related deps. |
.gitmodules |
Adds packages/datavis git submodule definition. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update DataVisNITRO story description to reference datavis/wcdatavis-lib instead of the removed wcdatavis package - Move datavis from optionalDependencies to devDependencies only, since the file:./packages/datavis path would fail for npm consumers (the submodule folder is not shipped in the published package) - Guard readDependencyNames in .storybook/main.ts with existsSync and try-catch so Storybook does not crash if a package is not installed; remove the wcdatavis lookup entirely - Switch font-awesome in .storybook/preview-head.html from a /node_modules/ path (unreliable in static builds) to the cdnjs CDN - Add submodules: true to all actions/checkout@v4 steps in ci.yml, release.yml, and codeql.yml so the packages/datavis submodule is initialized during CI runs
Deploying ui with
|
| Latest commit: |
b08f0e0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d64136ca.ui-6d0.pages.dev |
| Branch Preview URL: | https://feature-datavis-nitro-submod.ui-6d0.pages.dev |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 20 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…scing for totalRows
- normalizeTypeInfo: add Array.isArray branch to convert [{field, type, ...}] to keyed map
- totalRows: use ?? instead of || so 0 is not treated as falsy
Addresses Copilot review feedback on PR #149.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 21 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { | ||
| DataGrid, | ||
| type DataGridProps, | ||
| type GridTableDef, | ||
| } from 'datavis/src/components/DataGrid'; |
There was a problem hiding this comment.
The exported DataVisNitroGridProps is built on types imported from deep datavis/src/... paths (DataGridProps, GridTableDef, etc.). Since datavis is only a local devDependency (file:./packages/datavis) and isn’t shipped to consumers, the generated dist/datavis.d.ts can end up referencing modules consumers can’t resolve. To keep the addon self-contained, avoid leaking datavis/src types in exported types (re-declare needed shapes locally) or ensure the DTS build inlines/rolls up those external types into dist/datavis.d.ts.
4e920db to
df032db
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 21 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
672bbe2 to
b08f0e0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
src/components/Address/AddressForm.tsx:311
- The effect sets up a persistent
place_changedlistener that callsonChange({ ...value, ...addressData }), but the dependency array only includesgooglePlaces?.enabled. This can capture stalevalue/onChange/googlePlacescallbacks and merge autocomplete data into an outdatedvaluesnapshot. Consider either including the referenced values in the deps (and re-initializing the listener when they change) or storingvalue/onChangein refs that the listener reads from.
// eslint-disable-next-line react-hooks/exhaustive-deps -- Only re-init when enabled flag changes; other deps are stable refs
}, [googlePlaces?.enabled]);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function normalizeTypeInfo(typeInfo: unknown): DataVisTypeInfoMap { | ||
| if (Array.isArray(typeInfo)) { | ||
| return Object.fromEntries( | ||
| typeInfo.filter(isObject).map((entry) => [entry.field, entry]) | ||
| ) as DataVisTypeInfoMap; | ||
| } | ||
|
|
||
| if (!isObject(typeInfo)) { | ||
| return {}; | ||
| } | ||
|
|
||
| const maybeOrdMap = typeInfo as DataVisTypeInfoOrdMap; | ||
| if ( | ||
| typeof maybeOrdMap.keys === 'function' && | ||
| typeof maybeOrdMap.get === 'function' | ||
| ) { | ||
| return Object.fromEntries( | ||
| maybeOrdMap.keys().map((field) => [field, maybeOrdMap.get?.(field) ?? {}]) | ||
| ); | ||
| } | ||
|
|
||
| return Object.fromEntries( | ||
| Object.entries(typeInfo).filter(([, value]) => isObject(value)) | ||
| ) as DataVisTypeInfoMap; | ||
| } |
There was a problem hiding this comment.
This PR introduces substantial new logic in DataVisNITRO.tsx (typeInfo normalization, column resolution/merging, tableDef merging, etc.) but there are no unit tests covering these behaviors. Since the repo runs Vitest with coverage thresholds in CI, consider adding a DataVisNITRO.test.tsx (or focused unit tests for the helper functions) to prevent regressions, especially around normalizeTypeInfo and derived column ordering.
| datavis-ace: | ||
| specifier: '=4.0.0-PRE.1' | ||
| version: 4.0.0-PRE.1 |
There was a problem hiding this comment.
pnpm-lock.yaml lists datavis-ace under the root importer’s dependencies, but package.json only declares it as an (optional) peerDependency and does not include it in dependencies/devDependencies. With pnpm install --frozen-lockfile in CI, this package.json/lockfile mismatch will cause installs to fail. Either add datavis-ace to devDependencies (common when also listed as a peer) or regenerate the lockfile so it matches the current package.json intent.
| datavis-ace: | |
| specifier: '=4.0.0-PRE.1' | |
| version: 4.0.0-PRE.1 |
feat: convert datavis to git submodule, remove wcdatavis
Architecture
DataVis NITRO is now sourced from a git submodule at packages/datavis/ instead of a git URL npm dependency. The datavis code is pre-bundled into the @mieweb/ui/datavis addon entry point (dist/datavis.js) so consumers do not need to install datavis separately.
Package structure
@mieweb/ui): No datavis code — unaffected consumers pay zero cost for data visualization.@mieweb/ui/datavis): DataVisNITRO components are pre-bundled in dist/datavis.js. Consumers simply import:import { DataVisNitroGrid } from '@mieweb/ui/datavis';packages/datavis/(git submodule pinned to commit 2b32e15). Developers must clone with--recurse-submodulesor rungit submodule update --init.What changed
packages/datavisas a git submodule (.gitmodules)package.json: datavis dependency changed from git URL tofile:./packages/datavis; removedwcdatavisfromoptionalDependenciesanddevDependenciestsup.config.ts: removeddatavis,wcdatavis, andjqueryfrom the external list so datavis is bundled from source into the addonsrc/components/DataVisNITRO/DataVisNITRO.tsx: updated imports fromwcdatavis/src/todatavis/wcdatavis-lib/src/src/types/wcdatavis.d.ts: updated module declarations to match new import paths; removed Grid and index.js modulessrc/datavis.ts: removed WCDataVis re-exportsrc/components/WCDataVis/entirelyWhy wcdatavis was removed
The
datavispackage includes a vendoredwcdatavis-lib/that exportsComputedView,Source, and other symbols needed by DataVisNITRO. The standalonewcdatavisnpm dependency was only needed by the legacy WCDataVis component which has been removed.Dependencies
jqueryremains as an optional dependency becausedatavis/wcdatavis-libuses it internally.wcdatavisis fully removed from all dependency sections.packages/datavis/submodule folder does NOT ship in the npm package (thefilesfield only includesdist/,README.md,LICENSE).