Skip to content

[pull] next from storybookjs:next#816

Merged
pull[bot] merged 73 commits into
code:nextfrom
storybookjs:next
Jun 6, 2026
Merged

[pull] next from storybookjs:next#816
pull[bot] merged 73 commits into
code:nextfrom
storybookjs:next

Conversation

@pull

@pull pull Bot commented Jun 6, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ndelangen added 30 commits June 1, 2026 16:57
- Added a new background color service with manager, preview, and server components.
- Integrated service registration in Storybook's manager and preview files.
- Established a communication channel for state synchronization between manager and preview.
- Created tests for service registration and subscription behavior.
- Added a new background color service with manager, preview, and server components.
- Integrated service registration in Storybook's manager and preview files.
- Established a communication channel for state synchronization between manager and preview.
- Created tests for service registration and subscription behavior.
…zation

- Updated service registration to automatically join the cross-peer sync protocol without a separate connect step.
- Introduced a schema validation mechanism for state synchronization to ensure integrity across runtimes.
- Implemented last-write-wins logic for concurrent state updates, improving conflict resolution.
- Added comprehensive tests for service registration, state synchronization, and validation behavior.
- Removed deprecated service-server-channel integration, consolidating functionality into service-sync.
- Added a new project configuration for the open-service internal demo in Playwright.
- Updated Storybook's preview components to synchronize body background color with the open-service background demo.
- Introduced a new event for when the preview iframe finishes loading, improving state synchronization.
- Enhanced the Viewport component to conditionally render the iframe based on addon loading state.
- Added end-to-end tests for the open-service background demo to ensure consistent behavior after reloads.
- Removed the PREVIEW_IFRAME_LOADED_EVENT export from the postMessage channel as it is no longer utilized.
- Simplified the IFrame component by eliminating the event dispatch for iframe load completion.
- Updated the PostMessageTransport class to remove references to the now-removed event.
- Enhanced the Viewport component to streamline iframe rendering logic.
- Adjusted the provider module to clean up state management related to addon loading.
- Updated ManagerProvider to run addon register callbacks before the first render, ensuring manager-side listeners are ready for preview JS events.
- Refactored the provider module to remove unused API handling logic during initialization.
- Simplified open-service tests by consolidating welcome-request retry logic and improving clarity in test cases for welcome-reply handling.
- Adjusted end-to-end tests to validate the reload bootstrap path and ensure synchronization between manager and preview components.
- Updated README to clarify the merging of `staticInputs` and handler overrides in service registration.
- Improved type safety in `server.test-d.ts` by adding type expectations for input and context in service handlers.
- Adjusted service registration tests to ensure handlers and load hooks are correctly defined on service definitions.
- Enhanced type definitions in `types.ts` to reflect the correct structure for service query registrations.
- Updated docgen service definition to ensure the load hook is correctly associated with the query definition.
…a81' of github.com:storybookjs/storybook into norbert/service-clients
- Consolidated service registration logic into a unified service registry, simplifying the registration process across different runtimes (manager, preview, server).
- Updated the channel integration to automatically read from `globalThis.__STORYBOOK_ADDONS_CHANNEL__`, eliminating the need for manual channel setup.
- Removed deprecated `setServiceChannel` and `clearServiceChannel` functions, streamlining the service-client API.
- Enhanced documentation to clarify the new registration flow and channel handling.
- Updated tests to reflect changes in service registration and channel synchronization behavior.
- Updated service channel events to replace deprecated welcome-request and welcome-reply with sync-start and sync-start-reply for improved clarity and consistency.
- Refactored service registration and synchronization logic to ensure seamless integration across manager and preview components.
- Enhanced documentation to reflect changes in event handling and service registration flow.
- Updated tests to validate the new sync-start initialization process and ensure proper state synchronization between peers.
- Updated import paths for `defineService` in multiple files to use the new `storybook/open-service` entry point, ensuring consistency across the codebase.
- Enhanced the build configuration to include the new `open-service` entry point for better module resolution.
- Updated README documentation to reflect the new import structure and clarify the usage of the `storybook/open-service` API.
- Simplified the assignment of the Storybook addons channel by removing the type declaration for `ServiceChannel`, ensuring a cleaner integration with the global object.
- Enhanced code readability by directly assigning the channel to `globalThis.__STORYBOOK_ADDONS_CHANNEL__` without type casting.
- Updated README to clarify the behavior of leaf and hub channel sync, specifying the new test file for leaf registration.
- Refactored comments in `service-sync.ts` to improve clarity on the transport mechanism for service registration.
- Introduced `service-transport-leaf.test.ts` to implement comprehensive tests for leaf channel synchronization, ensuring robust validation of the registration process and state management.
- Enhanced the synchronization logic in `service-transport.ts` to prevent drift between leaf and hub registrations.
- Eliminated `getServiceChannel` from `exports.ts`, `index.mock.ts`, `index.ts`, and `preview.ts` to streamline the API and remove unused functionality.
- Updated `README.md` to reflect the removal of `getServiceChannel`, clarifying the current available API methods.
- Introduced OpenServiceMissingChannelError to handle cases where the Storybook addons channel is not installed.
- Updated service registration logic to throw this error when the channel is missing, enhancing robustness and clarity in error reporting.
- Modified ESLint configuration to include new test directories for e2e-sandbox and e2e-internal.
- Updated Playwright configuration to reflect the new test directory structure.
- Added multiple new E2E test files for various Storybook addons, including accessibility, actions, backgrounds, controls, docs, and more.
- Implemented tests to validate functionality and integration of new features in the Storybook environment.
- Updated the `preview.ts` and `manager.ts` files to streamline the Open Service API exports, focusing on registration and channel functionality.
- Removed deprecated exports and consolidated type definitions to enhance maintainability and clarity in the API surface.
- Adjusted comments to better reflect the intended usage and architecture of the Open Service API.
- Streamlined imports in `manager.tsx` and `index.ts` to utilize the new `storybook/open-service` entry point, enhancing consistency across the codebase.
- Removed deprecated exports from `exports.ts`, `index.mock.ts`, and `index.ts` to simplify the API surface and improve maintainability.
- Updated comments in various files to better reflect the intended usage and architecture of the Open Service API.
- Removed the web server configuration from Playwright settings to streamline the setup.
- Updated E2E test documentation to clarify the execution process with internal Storybook.
- Added a step in CI to run internal Storybook in the background before executing E2E tests.
- Implemented a wait mechanism to ensure Storybook is ready before running tests, improving reliability.
- Removed unnecessary conditional checks for channel transport before assigning to `globalThis.__STORYBOOK_ADDONS_CHANNEL__`, simplifying the code.
- Enhanced clarity by directly assigning the channel, ensuring a more straightforward integration with the global object.
- Replaced `getServiceChannel` and `setServiceChannel` with `getChannel` and `setChannel` across multiple files to unify channel handling.
- Updated global channel assignment logic to improve clarity and maintainability.
- Introduced `clearChannel` for better channel management during tests and service registration.
- Enhanced documentation to reflect changes in channel handling and API usage.
- Introduced `ensureChannel` to streamline channel setup, ensuring a noop channel is installed when none exists.
- Updated various files to replace direct channel installation with `ensureChannel`, improving clarity and consistency.
- Added comprehensive tests for channel management to validate functionality and prevent regressions.
- Improved comments and documentation to reflect changes in channel handling and testing practices.
…book

- Removed unnecessary channel installation logic from `storybook.setup.ts` to streamline the setup process.
- Updated `channel-slot.ts` to introduce `onChannelReplaced` for better handling of channel instance changes.
- Enhanced service registration logic to ensure proper wiring of services to the channel, improving reliability.
- Improved documentation and comments across various files to clarify channel management and service registration processes.
- Added tests to validate the new channel handling behavior and ensure robustness in service registration.
- Updated the Vitest plugin to use project-specific configuration for coverage and setup files, improving flexibility.
- Enhanced channel management by setting a no-op channel in the load function, ensuring proper channel handling in development mode.
- Streamlined setup file handling to prevent duplication and improve clarity in the configuration process.
ndelangen and others added 27 commits June 5, 2026 11:50
Replaced the import path for channel management in the addons module to reference the internal channels directory, improving code organization and consistency across the codebase.
Removed the queued telemetry errors array and streamlined the error handling process by directly emitting prepared telemetry errors. This change enhances code clarity and reduces unnecessary complexity in the telemetry error management.
Deleted the open-service client module to streamline the codebase and eliminate unused functionality. This change enhances overall code clarity and reduces complexity in service management.
Eliminated the state schema validation logic from the open-service module, including related fixtures and tests. This change simplifies the service definition and enhances code clarity by removing unused functionality.
Updated the test for the getChannel function to ensure proper cleanup of global and environment variables using a try-finally block. This change improves test reliability and maintains a clean state after execution.
Modified the channel assignment in the AddonStore class to explicitly cast the channel as a Channel type. This change enhances type safety and ensures proper type handling within the addon management logic.
Updated the applyRegistration function in the service registry to explicitly allow only 'staticInputs' for query overrides and 'handler' for command overrides. This change enhances type safety by preventing unsupported keys from being merged into the definitions, improving overall code clarity and maintainability.
Updated the parseStampedSnapshot function to include additional validation for the version parameter, ensuring it is a safe integer and non-negative. This change improves type safety and robustness in handling service snapshots.
Eliminated the 5-second wait time in the open-service background example tests to improve test execution speed and efficiency. This change enhances the overall performance of the test suite.
Introduced a new fixture, `undefinedOutputQueryServiceDef`, to expose a query that returns `undefined`, ensuring consumers handle it correctly. Updated the `useServiceQuery` tests to verify that `undefined` is treated as an initialized value, preventing unnecessary recomputations on re-renders. This change enhances the robustness of the service query handling.
…ort and WebsocketTransport

Modified the PostMessageTransport class to use globalThis.CHANNEL_OPTIONS for configuration, ensuring consistent access to channel options. Additionally, updated the WebsocketTransport class to directly instantiate the WebSocket without referencing globalThis, improving code clarity and maintainability.
…t and WebsocketTransport

Updated both PostMessageTransport and WebsocketTransport classes to utilize a local CHANNEL_OPTIONS constant instead of directly referencing globalThis.CHANNEL_OPTIONS. This change improves code clarity and consistency in accessing channel options across the transport implementations.
Enhanced the README documentation for the remote command execution section, clarifying the roles of requester and responder, the command invocation process, and the event structure. This update aims to provide clearer guidance on how commands are executed across different runtimes, improving overall understanding for developers.
…okjs/storybook into norbert/remote-command-execution
…cution

OpenService: Implement remote command execution
Resolve docgen service conflicts by adopting next's id-based API and
getDocgenForAllComponents while keeping load hooks on the service
definition per the restricted registration model on this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
…types

- Consolidate channel wiring behind a single connectServiceToChannel entry
  point and capture one channel reference (removes a broadcast/listener
  channel-divergence hazard).
- Use nanoid for the identity-critical client/call id instead of Math.random.
- Drop spurious `as unknown as Channel` casts in the addon stores.
- Move @preact/signals-core and deepsignal to devDependencies so they are
  bundled into core's dist (fixes resolution in symlinked sandboxes).
- Fix useServiceQuery input typing by inferring TInput/TOutput as direct type
  parameters so the void-vs-input arg branch reads the concrete query type.

Co-authored-by: Cursor <cursoragent@cursor.com>
…n state to objects

- Replace hand-rolled channel-payload parsers with Valibot schemas in
  service-channel.ts; derive payload types from the schemas and narrow with
  v.safeParse in the transport (removes the duplicated parse/isRecord helpers).
- Constrain service state to a plain object at the defineService boundary via
  a ServiceState type (rejects primitives, null, and arrays), matching the
  deep-signal / deep-reconcile requirements. Add type tests and document it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The setup-file ordering / context.project.config change is unrelated test
infra and does not belong in the open-service PR. Restore the next version.

Co-authored-by: Cursor <cursoragent@cursor.com>
The save-from-controls Playwright test failed once in CI with stale preview
text, but passes consistently locally (including CI=true). Retrigger checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Open Service: Add sync between server, manager and preview
@pull pull Bot locked and limited conversation to collaborators Jun 6, 2026
@pull pull Bot added the ⤵️ pull label Jun 6, 2026
@pull pull Bot merged commit 78e4393 into code:next Jun 6, 2026
5 of 6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants