Conversation
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
* Initial plan * feat: add per-component sanitizer options Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: clarify component sanitizer baseline Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: warn about sensitive component sanitizer opts Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * test: cover sanitizer allowTags overrides Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * perf: precompute component sanitizer allowlists Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Signed-off-by: Jonas Pfalzgraf <info@josunlp.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
* Initial plan * Add previous props to beforeUpdate hook Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * Refine beforeUpdate old props implementation Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * Fix beforeUpdate typing regressions Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Signed-off-by: Jonas Pfalzgraf <info@josunlp.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
* Initial plan * feat: add component signal subscriptions Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * chore: document signal subscription tracking Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: address signal integration review feedback Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: tighten component signal typing Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: resolve eslint failure in component signal test Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: handle reconnect lifecycle and signal effect errors Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: preserve reconnect signal wiring after hook errors Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: skip beforeUpdate for signal rerenders Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Signed-off-by: Jonas Pfalzgraf <info@josunlp.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
* Initial plan * feat: add trusted safeHtml fragment support Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * chore: finalize trusted safeHtml support Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: address trusted safeHtml review feedback Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: fix second trusted safeHtml review follow-up Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * refactor: split trusted html helpers from sanitizer Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * refactor: tighten trusted html branding Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: tighten trusted html internals Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Signed-off-by: Jonas Pfalzgraf <info@josunlp.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
* Initial plan * fix: reuse component style element on rerender Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * chore: finalize component style reuse fix Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * test: tighten style reuse regression assertions Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
…#63) * Initial plan * feat: add storybook template helper Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs: clarify storybook when fallback behavior Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: keep storybook helpers out of full bundle Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix: sanitize storybook helper output Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * test: tighten storybook helper security coverage Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * feat: enhance storyHtml with improved boolean attribute handling and sanitization tests * fix: update storyHtml example to reflect correct boolean attribute output * fix: defensive tag delimiter and parser comments per code review Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
- Update CHANGELOG.md for version 1.6.0 release notes including added features, changes, fixes, and security improvements. - Enhance README.md to document new boolean attribute helpers and Storybook integration. - Update bun.lock to reflect dependency upgrades for Storybook and happy-dom. - Modify definition.md to include new Storybook helpers and component state management features. - Revise components.md to demonstrate new boolean attribute handling and typed state in components. - Update getting-started.md with Storybook authoring examples and improved module descriptions. - Enhance security.md to clarify sanitization practices and introduce trusted fragment handling. - Revise index.md to highlight new Storybook helpers in the feature list. - Update llms.txt to reflect the new version 1.6.0. - Bump version in package.json to 1.6.0 and update devDependencies for Storybook.
There was a problem hiding this comment.
Pull request overview
Release PR for @bquery/bquery v1.6.0, expanding the component system’s typing/reactivity capabilities, adding secure Storybook authoring helpers, and improving trusted HTML composition while updating docs/CI accordingly.
Changes:
- Added
bool()boolean-attribute helper andtrusted()fragment composition for safer/ergonomic template authoring. - Expanded component typings + runtime behavior for typed state, declared
signals, richer lifecycle metadata, and style-node reuse across re-renders. - Introduced
@bquery/bquery/storybookentry point (storyHtml(),when()), plus CI/docs/package updates for the new release.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Adds Storybook entry point to library build + alias map. |
| tsconfig.component-test.json | Adds a dedicated TS config for type-checking (currently scoped to component test). |
| .github/workflows/test.yml | Runs the new test:types step in CI before tests. |
| package.json | Bumps version to 1.6.0, adds ./storybook export, adds test:types, updates dev deps. |
| bun.lock | Locks updated Storybook + happy-dom versions. |
| src/storybook/index.ts | Adds storyHtml() and when() helpers with sanitization + boolean shorthand parsing. |
| src/security/trusted-html.ts | Introduces SanitizedHtml branding + trusted() marker for safe fragment splicing. |
| src/security/sanitize.ts | Updates sanitizeHtml() to return branded SanitizedHtml; re-exports trusted helpers/types. |
| src/security/index.ts | Re-exports trusted() + branded types from the public security module surface. |
| src/component/html.ts | Adds bool() and enhances safeHtml() to splice trusted() fragments without double-escaping. |
| src/component/types.ts | Adds typed state/signal generics, lifecycle hook typing updates, sanitizer extension options. |
| src/component/component.ts | Implements signal-driven re-renders, lifecycle arg changes, per-component sanitize allowlist, and style reuse. |
| src/component/library.ts | Updates default input/textarea beforeUpdate fast-path to use old/new props; avoids unnecessary re-renders. |
| src/component/index.ts | Re-exports new helpers/types from the component entry point. |
| src/full.ts | Exposes new component/security exports from the full bundle entry point (excluding Storybook). |
| tests/storybook.test.ts | Adds coverage for Storybook helpers and sanitization behavior. |
| tests/security.test.ts | Adds coverage for trusted() composition. |
| tests/component.test.ts | Adds coverage for bool(), trusted fragment splicing, typed state/signals, lifecycle changes, sanitizer merging, style reuse. |
| tests/setup.ts | Updates global getComputedStyle shim. |
| README.md | Documents v1.6.0 features (bool/trusted/storybook/typed state/signals) and updates examples. |
| CHANGELOG.md | Adds 1.6.0 release notes. |
| AGENT.md | Updates version + module map to include Storybook helpers and new exports. |
| llms.txt | Updates version and feature summaries for LLM-targeted repo overview. |
| docs/index.md | Updates landing-page features to mention signals + Storybook helpers. |
| docs/guide/getting-started.md | Adds Storybook import/examples and updates module import list. |
| docs/guide/components.md | Updates component guide for bool/trusted/state/signals/lifecycle + sanitizer options + Storybook helpers. |
| docs/guide/security.md | Documents trusted fragment composition with trusted() and safeHtml. |
| docs/definition.md | Updates module tree and examples for new component/security/storybook features. |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…nent state keys (#65) * Initial plan * Address review feedback for test typing and setup Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * Finalize review feedback fixes Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * Export component state key type Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * Default component state key generic Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Release PR for @bquery/bquery@1.6.0, extending the component system’s ergonomics and typing, adding a dedicated Storybook authoring entry point, and introducing trusted-fragment composition for safe HTML templates—alongside docs, tests, and CI workflow updates.
Changes:
- Add
bool()boolean-attribute markers forhtml/safeHtml, plustrusted()/ brandedSanitizedHtml+TrustedHtmlfor safe fragment composition. - Expand component typing and runtime behavior: typed state helpers, declared
signalssubscriptions, richer lifecycle hooks (beforeUpdate(newProps, oldProps),updated(change?)), sanitizer allowlist extension, and style element reuse. - Introduce
@bquery/bquery/storybookentry point (storyHtml,when), update docs/tests, and add CI type-checking for tests.
Reviewed changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Adds Storybook build entry. |
| tsconfig.component-test.json | Adds TS project for test type-check. |
| tests/view.test.ts | Tightens signal object typing. |
| tests/utils.test.ts | Uses safer hasOwnProperty.call checks. |
| tests/storybook.test.ts | Adds Storybook helper test coverage. |
| tests/store.test.ts | Adds explicit store generics in tests. |
| tests/signal.test.ts | Adds typed fetch mock helper. |
| tests/setup.ts | Adjusts getComputedStyle binding for typing. |
| tests/security.test.ts | Adds trusted-fragment test + SanitizedHtml assertions. |
| tests/router.test.ts | Tightens route typings; simplifies guard test. |
| tests/motion.test.ts | Improves ViewTransition mocking/typing. |
| tests/core.test.ts | Strengthens null checks and expectations. |
| tests/component.test.ts | Adds coverage for bool/trusted/state/signals/lifecycle updates. |
| src/storybook/index.ts | New storyHtml/when helpers with sanitization. |
| src/store/watch.ts | Relaxes action arg typing to any[]. |
| src/store/types.ts | Updates Actions typing to use ThisType. |
| src/store/persisted.ts | Relaxes action arg typing to any[]. |
| src/store/mapping.ts | Relaxes action arg typing to any[]. |
| src/store/define-store.ts | Relaxes action arg typing to any[]. |
| src/security/trusted-html.ts | Adds brands + trusted() marker utilities. |
| src/security/sanitize.ts | Returns branded SanitizedHtml; re-exports trusted types/helpers. |
| src/security/index.ts | Updates public security exports/types. |
| src/full.ts | Re-exports new component/security types and helpers. |
| src/component/types.ts | Adds typed state/signals + updated lifecycle types + sanitize options. |
| src/component/library.ts | Updates default components to new beforeUpdate signature. |
| src/component/index.ts | Exposes bool and new component public types. |
| src/component/html.ts | Adds bool() and trusted fragment splicing in safeHtml. |
| src/component/component.ts | Implements typed state helpers, signals subscription, lifecycle changes, sanitizer options, style reuse. |
| package.json | Bumps to 1.6.0; adds ./storybook export; adds test:types. |
| llms.txt | Updates module/version documentation for 1.6.0. |
| docs/index.md | Adds Storybook helpers to feature list. |
| docs/guide/security.md | Documents trusted() + safe fragment composition. |
| docs/guide/getting-started.md | Adds Storybook and new imports/examples. |
| docs/guide/components.md | Documents typed state/signals, bool/trusted, lifecycle updates, Storybook helpers. |
| docs/definition.md | Updates module map and examples for new APIs. |
| bun.lock | Updates Storybook + happy-dom versions. |
| README.md | Updates examples/imports; adds Storybook helpers overview. |
| CHANGELOG.md | Adds 1.6.0 release notes. |
| AGENT.md | Updates version and module/API summaries. |
| .github/workflows/test.yml | Adds CI step to type-check tests. |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…tization (#66) * Initial plan * fix review follow-up for state updates and storybook sanitization Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix storybook attribute value scanning Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * fix storybook interpolation boundary parsing Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> * docs align storybook attribute scan jsdoc Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Release PR for @bquery/bquery v1.6.0, expanding the component/security surface area and adding a dedicated Storybook authoring entry point while tightening typings and CI validation.
Changes:
- Added
@bquery/bquery/storybookwithstoryHtml()/when()plus build + export-map wiring. - Enhanced component authoring with
bool()boolean-attribute markers, typed state, signal-driven re-renders, richer lifecycle hook signatures, and style-node reuse across renders. - Introduced trusted-fragment composition via
trusted()+ brandedSanitizedHtml, and updated tests/docs/CI to reflect the new APIs and stricter typing.
Reviewed changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Adds the Storybook entry to Vite library build inputs. |
| tsconfig.component-test.json | Adds a dedicated TS config to type-check tests/ alongside src/. |
| tests/view.test.ts | Tightens signal generic typing in a style-binding test. |
| tests/utils.test.ts | Uses Object.prototype.hasOwnProperty.call for broader runtime compatibility. |
| tests/storybook.test.ts | Adds coverage for storyHtml() sanitization + boolean shorthand + when(). |
| tests/store.test.ts | Makes store tests explicitly type action signatures via generics. |
| tests/signal.test.ts | Adds a typed fetch mock helper to satisfy Bun’s augmented fetch shape. |
| tests/setup.ts | Wraps/binds getComputedStyle to match expected global signature. |
| tests/security.test.ts | Adds trusted() coverage and updates expectations for branded sanitizer outputs. |
| tests/router.test.ts | Tightens route typing and simplifies a guard teardown test. |
| tests/motion.test.ts | Improves View Transition mocking to match Document['startViewTransition'] typing. |
| tests/core.test.ts | Strengthens null assertions and clarifies delegated-event expectations. |
| tests/component.test.ts | Adds extensive coverage for bool(), trusted(), typed state/signals, and lifecycle changes. |
| src/storybook/index.ts | Introduces Storybook helpers with sanitizer allowlist inference and boolean shorthand support. |
| src/store/watch.ts | Relaxes action generic constraint to any[] to preserve action parameter typing. |
| src/store/types.ts | Changes Actions typing to use ThisType for this-context typing inside actions. |
| src/store/persisted.ts | Aligns action generic constraint with updated store typing. |
| src/store/mapping.ts | Aligns action generic constraint with updated store typing. |
| src/store/define-store.ts | Aligns action generic constraint with updated store typing. |
| src/security/trusted-html.ts | Adds SanitizedHtml/TrustedHtml branding + trusted() fragment wrapper utilities. |
| src/security/sanitize.ts | Returns branded SanitizedHtml, re-exports trusted(), and exports related types. |
| src/security/index.ts | Updates security module exports to include trusted() and new branded types. |
| src/full.ts | Re-exports new component/security types and bool() / trusted() from the full bundle. |
| src/component/types.ts | Adds typed state/signals types, lifecycle hook metadata, and per-component sanitizer options. |
| src/component/library.ts | Updates default components’ beforeUpdate to use new (newProps, oldProps) signature and improves skip-render logic. |
| src/component/index.ts | Re-exports bool() and new component types. |
| src/component/html.ts | Adds bool() helper, integrates trusted-fragment splicing into safeHtml, and brands safeHtml output. |
| src/component/component.ts | Adds typed state/signals plumbing, signal-driven rerenders, style element reuse, lifecycle enhancements, and sanitizer allowlist merging. |
| package.json | Bumps version to 1.6.0, adds ./storybook export, and adds test:types script. |
| llms.txt | Updates version and documents new Storybook/trusted/component capabilities. |
| docs/index.md | Updates marketing feature bullets for signals + Storybook helpers. |
| docs/guide/security.md | Documents trusted() composition with safeHtml and updated imports. |
| docs/guide/getting-started.md | Adds Storybook helper imports and documents new APIs. |
| docs/guide/components.md | Updates component guide for bool(), typed state/signals, lifecycle changes, sanitizer options, and Storybook helpers. |
| docs/definition.md | Updates module map and examples for bool(), trusted(), and Storybook helpers. |
| bun.lock | Updates lockfile for Storybook/happy-dom patch bumps and related dependency graph changes. |
| README.md | Updates examples/imports for bool(), trusted(), and Storybook helpers; refreshes wording. |
| CHANGELOG.md | Adds 1.6.0 release notes describing new APIs, changes, and fixes. |
| AGENT.md | Updates version and documents new Storybook/module/API surface for contributors. |
| .github/workflows/test.yml | Adds CI step to run bun run test:types before unit tests. |
This pull request introduces version 1.6.0 of
@bquery/bquery, bringing significant improvements to the component system, documentation, and security features. The main highlights are the addition of new helpers for boolean attributes and trusted HTML fragments, expanded typed state and signal support for components, and dedicated Storybook authoring helpers. Documentation and examples are updated throughout to reflect these enhancements.Component system enhancements:
bool()helper for ergonomic boolean attribute interpolation inhtmlandsafeHtmltemplates, making it easier to handle attributes likedisabledandchecked. (F89b154dL44R44, [1] [2] F79c186fL193R193, [3]render(), lifecycle hooks, and state accessors. ExportedComponentSignalLikeandComponentSignalstypes for external reactive inputs. (F89b154dL44R44, docs/guide/components.mdR158-R210)updated()can now receive attribute-change metadata, andbeforeUpdate()receives both new and old props. (F89b154dL44R44, [1] [2]Storybook integration:
@bquery/bquery/storybookentry point withstoryHtml()andwhen()helpers for secure, ergonomic web-component story authoring. (F89b154dL44R44, [1] [2] [3] [4] [5]Security improvements:
trusted()for safely reusing sanitized HTML fragments insafeHtmltemplates, preventing double-escaping and improving secure markup composition. (F89b154dL44R44, [1] [2] [3] [4] [5] [6]Documentation and workflow updates:
README.md,AGENT.md, and guides to cover new helpers, typed state, signal support, trusted fragment composition, and Storybook integration. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]These changes collectively make the library more robust, ergonomic, and secure, especially for component and Storybook usage.