Skip to content

feat(next): auto-initialize overlay and runtime from loader preamble#3

Merged
Narrator merged 2 commits intomainfrom
feat/next-auto-init
Mar 19, 2026
Merged

feat(next): auto-initialize overlay and runtime from loader preamble#3
Narrator merged 2 commits intomainfrom
feat/next-auto-init

Conversation

@Narrator
Copy link
Member

Summary

  • Replace DomscribeDevProvider with automatic initialization via the turbopack loader preamble — the overlay and runtime now initialize without requiring a React component in the tree
  • The preamble injects import('@domscribe/next/auto-init') guarded by a __DOMSCRIBE_AUTO_INIT__ window flag to ensure single execution across multiple transformed files
  • Default overlay to true in withDomscribe() so the overlay appears out of the box
  • Remove @domscribe/next/runtime subpath export and DomscribeDevProvider component entirely
  • Remove DomscribeDevProvider from all Next.js test fixture layouts (template + generated)

Motivation

Vite and standalone webpack integrations auto-initialize without source changes, but Next.js required users to manually add <DomscribeDevProvider /> to their root layout. This caused the overlay to silently not appear on the cal.com demo because the component was missing. This PR eliminates that friction.

Breaking change

@domscribe/next/runtime subpath export is removed. Users should remove <DomscribeDevProvider /> from their root layout — it's no longer needed.

Test plan

  • nx test domscribe-transform — turbopack loader tests pass (362 tests), including new preamble auto-init assertion
  • nx test domscribe-next — all 35 tests pass, including 3 new auto-init tests and updated overlay default
  • nx integration domscribe-test-fixtures — manifest validation on Next.js fixtures
  • nx e2e domscribe-test-fixtures — overlay appears on Next.js fixtures without DomscribeDevProvider

Replace DomscribeDevProvider with automatic initialization via the
turbopack loader preamble. The preamble now injects
`import('@domscribe/next/auto-init')` guarded by a
`__DOMSCRIBE_AUTO_INIT__` flag, so runtime + overlay initialize
without requiring a React component in the tree.

- Add @domscribe/next/auto-init side-effect module
- Inject auto-init import in turbopack loader preamble with dedup guard
- Default overlay option to true in withDomscribe()
- Remove DomscribeDevProvider and @domscribe/next/runtime subpath
- Remove DomscribeDevProvider from all Next.js test fixture layouts

BREAKING CHANGE: @domscribe/next/runtime subpath export is removed.
Users no longer need DomscribeDevProvider in their root layout.
…and webpack

Add the same console.error filter already present in the turbopack
loader preamble to the Vite and Webpack plugins. Suppresses React's
"Invalid prop `data-ds` supplied to React.Fragment" warning that fires
when a component resolves to Fragment at runtime via a dynamic
expression.
@nx-cloud
Copy link

nx-cloud bot commented Mar 19, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 2d5047d

Command Status Duration Result
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 48s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 48s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 43s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 44s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 37s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 38s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 18s View ↗
nx run domscribe-test-fixtures:integration--vit... ✅ Succeeded 28s View ↗
Additional runs (18) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-19 05:22:44 UTC

@Narrator Narrator merged commit 7a9d4ff into main Mar 19, 2026
24 checks passed
@Narrator Narrator deleted the feat/next-auto-init branch March 19, 2026 05:25
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.

1 participant