Skip to content

Prepare context for apps using dom without template. - #100

Merged
koculu merged 3 commits into
mainfrom
prepare-context-for-apps-with-no-template
Oct 14, 2026
Merged

koculu merged 3 commits into
mainfrom
prepare-context-for-apps-with-no-template

Conversation

@koculu

@koculu koculu commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Support context scopes in existing DOM and detect duplicate Regor runtimes at import time.

Changes

createApp(context, { element }) now applies :context and r-context without requiring a template:

<aside :context="user">
  <span>{{ name }}</span>
</aside>
  • Support context on the mount root while preserving its identity and cleanup behavior.
  • Preserve and bind <template> content.
  • Evaluate r-if within the element’s context, including hosts that also use r-for.
  • Leave r-pre subtrees untouched during preparation and binding.
  • Throw RegorRuntimeMismatch when another runtime is imported, including separate copies of the same version.
  • Preserve the import-time guard through bundling and minification.
  • Update package version to 1.7.5.

The runtime guard detects releases containing the guard within the same JavaScript global environment.

Validation: all 593 tests pass, plus TypeScript, lint, and declaration-generation checks.

@koculu
koculu merged commit d49fc0f into main Oct 14, 2026
1 check passed
@koculu
koculu deleted the prepare-context-for-apps-with-no-template branch October 14, 2026 04:22
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