Skip to content

Updates to origin#512

Merged
coreymartin merged 5 commits intomainfrom
develop
Mar 31, 2026
Merged

Updates to origin#512
coreymartin merged 5 commits intomainfrom
develop

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

If this change should result in new package versions please add a changeset before merging. You can do so by clicking the link provided by changeset bot below.

## Summary

- Add optional `initialWidth` prop to all SVG-based chart components
(Line, Bar, StackedArea, Pie, Scatter, Composed, Funnel, Waterfall,
Sankey, SparklineBar) to enable server-side rendering via
`renderToStaticMarkup`
- Update the shared `useResizeWidth` hook to accept an `initialWidth`
fallback — used when no `ResizeObserver` measurement is available (e.g.
Node.js environments), with the observer taking over seamlessly on the
client
- Rename the existing partial `width` prop on LineChart and BarChart to
`initialWidth` for consistent semantics across all charts

## Motivation

Charts currently render with 0 width in Node.js because `ResizeObserver`
is unavailable. This blocks the Lighthouse team's pipeline for
generating chart PNGs for Slack: `renderToStaticMarkup` → SVG string →
`sharp`/`resvg` → PNG. The `initialWidth` prop provides a
pre-measurement fallback with zero breaking changes — existing consumers
are unaffected.

## Test plan

- [x] Unit tests added for `useResizeWidth` fallback behavior (4 new
tests)
- [x] `initialWidth` added to Line and BarGrouped Storybook args for
discoverability
- [x] `yarn build` passes
- [x] `yarn test:unit` passes (420 tests, 7 files)
- [x] `yarn lint` passes (0 errors)
- [x] `yarn format` passes

Made with [Cursor](https://cursor.com)

GitOrigin-RevId: c7671c95535be6ce26fa402e03a0db4533265822
@github-actions github-actions bot requested a review from a team as a code owner March 31, 2026 00:38
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Mar 31, 2026

The following public packages have changed files:

Changed Current version
@lightsparkdev/origin 0.14.1

There is 1 existing changeset for this branch. If additional changes have been made that require different versions for any package simply add another changeset. Any packages that depend on the planned releases will be updated and released automatically in a separate PR.

Each changeset corresponds to an update in the CHANGELOG for the packages listed in the changeset. Therefore, you should add a changeset for each noteable package change that this PR contains. For example, if a PR adds two features - one feature for packages A and B and one feature for package C - you should add two changesets. One changeset for packages A and B and one changeset for package C, with a description of each feature. The feature description will end up being the CHANGELOG entry for the packages in the changeset.

The following releases are planned based on the existing changesets:

Planned releases Update
@lightsparkdev/origin patch

Last updated by commit 75fbf51

@coreymartin coreymartin enabled auto-merge (squash) March 31, 2026 01:49
@coreymartin coreymartin changed the title Add initialWidth prop to Origin charts for SSR support ## Summary - Add opti Updates to origin Mar 31, 2026
Lightspark Eng and others added 3 commits March 31, 2026 01:50
Update public `js` sources with the latest code from the [public
repository](https://github.com/lightsparkdev/js-sdk) main branch.

This typically happens when new versions of the SDK are released and
version updates need to be synced. The PR should be merged as soon as
possible to avoid updates to webdev overwriting the changes in the
js-sdk develop branch.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Corey Martin <coreyn.martin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Lightspark Eng <engineering@lightspark.com>
GitOrigin-RevId: e763d6e6bed19b342e4c7b58a3d91a1a2cc8a71c
@coreymartin coreymartin merged commit 5ef5b36 into main Mar 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants