Browser entry points
Small behavior. Clear ownership. A page that stays understandable.
Choose an independent component app or enhance the HTML already on the page. Both entry points resolve colocated TypeScript through the SSG; your browser code decides what happens next.
Choose the boundary
RegorApp
Component behaviorRegister the parts you need, create fresh reactive state, and mount a focused UI. Try independent reviews, shared module loading, and explicit source ownership.
Explore RegorApp ↗PageScript
DOM enhancementKeep the server-rendered content and add page-specific behavior. Inspect emitted tags, placement, source paths, and every loading or metadata option.
Explore PageScript ↗Two working approaches
Enhance the paragraph
Existing content gains one focused interaction.
Keep content readable before JavaScript runs. A scoped entry point can add calculations, event handlers, and small improvements to an existing document. Choose a separate component app when reactive state and reusable templates make the feature easier to understand.
Each example loads a colocated entry using its guide as the source owner. Neither entry-point component has appearance variants.
Compare responsibilities
| Need | RegorApp | PageScript |
|---|---|---|
| Visible root | An app mount element | A script element |
| UI ownership | Browser template and registered components | Existing HTML, selected by your script |
| State | Refs and computed values in each createApp context | Your chosen DOM or JavaScript state |
| Initialization | Entry point explicitly calls createApp | Entry point runs its enhancement code |
| Multiple instances | Create one app with fresh state per mount | Scope queries and listeners to each region |
| Source resolution | src and optional sourceRelPath | src and optional sourceRelPath |
| Script placement and metadata | Uses the internal default PageScript | teleport, type, loading flags, and native metadata |
| Appearance | Components inside the app | Enhanced HTML and its components |
From source to page
ResolveFind the source owner Relative src uses the MDX directory. sourceRelPath changes that owner.
BundleRecord the local entry The SSG bundles local TypeScript into a browser asset. External URLs stay external.
EmitInclude the script A native module tag points to the emitted asset; RegorApp also supplies an app mount.
InitializeOwn the behavior Register and mount component apps, or attach scoped listeners to the rendered document.
A repeated module URL executes once. Entry points that serve multiple mounts must initialize every matching instance.