Skip to content

createComponent: move context into options, update docs/tests, bump version - #48

Merged
koculu merged 1 commit into
mainfrom
codex/update-createcomponent-method-parameters
Feb 1, 2026
Merged

koculu merged 1 commit into
mainfrom
codex/update-createcomponent-method-parameters

Conversation

@koculu

@koculu koculu commented Feb 1, 2026

Copy link
Copy Markdown
Member

Motivation

  • Simplify createComponent API to accept two parameters (template + options) and centralize configuration in an options object.
  • Make the component context pluggable via options.context for better extensibility and to avoid an extra positional parameter.

Description

  • Changed createComponent signature to createComponent(template, options) and derive the context from options.context with a default empty context in src/app/createComponent.ts.
  • Added context?: (head: ComponentHead<any>) => IRegorContext to CreateComponentOptions in src/api/types.ts and removed the direct context parameter/imports from the implementation.
  • Updated unit tests in tests/app/createComponent.spec.ts and examples/docs in README.md, docs-site/* and docs-site/public/sample.html to pass a single options object (including context and props).
  • Bumped package version to 1.1.5 in package.json.

Testing

  • No automated test suite was executed as part of this change; tests in tests/app/createComponent.spec.ts were updated to the new API signature but not run here.
  • Recommend running the test suite with yarn test or npm run test to verify all changes in CI.

Codex Task

@koculu
koculu merged commit 7e20153 into main Feb 1, 2026
1 check passed
@koculu
koculu deleted the codex/update-createcomponent-method-parameters branch February 1, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant