Skip to content

Version 1.2.0#15

Merged
JosunLP merged 7 commits intomainfrom
development
Jan 24, 2026
Merged

Version 1.2.0#15
JosunLP merged 7 commits intomainfrom
development

Conversation

@JosunLP
Copy link
Copy Markdown
Collaborator

@JosunLP JosunLP commented Jan 24, 2026

  • Füge Logo zur Konfiguration und Kopfzeile der VitePress-Dokumentation hinzu

  • Add tests for router, store, and view modules; update Vite config for new modules

  • Created router.test.ts to test router module exports and functionality.
  • Created store.test.ts to test store creation, state management, actions, and persistence.
  • Created view.test.ts to test view rendering, directives, and template creation.
  • Updated vite.config.ts to include new router, store, and view modules for bundling.
  • Update changelog and README to document new Router, Store, and View modules; bump version to 1.2.0

  • Fix regex in bq-for directive to prevent ReDoS by requiring non-whitespace start

  • feat(router): enhance query parameter handling and add multi-value support

  • Updated the query parameter structure to support multi-value keys, allowing duplicate query parameters to be stored as arrays.
  • Enhanced the parseQuery function to correctly handle and return multi-value query parameters.
  • Added tests to verify the correct parsing of single and multiple query parameters, including edge cases with duplicates.

feat(signal): add peek method to Computed class

  • Introduced a peek method in the Computed class to read the current computed value without tracking dependencies.
  • This method allows access to the cached value while avoiding unnecessary reactivity.

feat(store): implement state proxy for lazy signal reading

  • Created a state proxy using Proxy to lazily read signal values, improving performance by avoiding unnecessary object creation.
  • Updated the getCurrentState method to return a shallow copy of the state for subscriber notifications.

fix(view): add security warnings for dynamic expression evaluation

  • Added security considerations to the view module regarding the use of new Function() for evaluating expressions.
  • Emphasized the importance of using trusted sources for expressions to mitigate security risks.

test(router): implement comprehensive router tests with mocked history

  • Developed a suite of tests for the router module, including route matching, parameter extraction, query string parsing, and navigation functionality.
  • Mocked the History API to facilitate testing in environments without full browser support.

test(store): update store tests to skip localStorage tests if not available

  • Modified store tests to conditionally skip tests that require localStorage when it is not available, improving test reliability across environments.
  • fix(router): escape backslashes in path regex to ensure proper processing

  • docs(store): clarify shallow reactivity and update state mutation examples
    test(signal): add tests for peek functionality in computed signals

* Füge Logo zur Konfiguration und Kopfzeile der VitePress-Dokumentation hinzu

* Add tests for router, store, and view modules; update Vite config for new modules

- Created `router.test.ts` to test router module exports and functionality.
- Created `store.test.ts` to test store creation, state management, actions, and persistence.
- Created `view.test.ts` to test view rendering, directives, and template creation.
- Updated `vite.config.ts` to include new router, store, and view modules for bundling.

* Update changelog and README to document new Router, Store, and View modules; bump version to 1.2.0

* Fix regex in bq-for directive to prevent ReDoS by requiring non-whitespace start

* feat(router): enhance query parameter handling and add multi-value support

- Updated the query parameter structure to support multi-value keys, allowing duplicate query parameters to be stored as arrays.
- Enhanced the `parseQuery` function to correctly handle and return multi-value query parameters.
- Added tests to verify the correct parsing of single and multiple query parameters, including edge cases with duplicates.

feat(signal): add peek method to Computed class

- Introduced a `peek` method in the `Computed` class to read the current computed value without tracking dependencies.
- This method allows access to the cached value while avoiding unnecessary reactivity.

feat(store): implement state proxy for lazy signal reading

- Created a state proxy using `Proxy` to lazily read signal values, improving performance by avoiding unnecessary object creation.
- Updated the `getCurrentState` method to return a shallow copy of the state for subscriber notifications.

fix(view): add security warnings for dynamic expression evaluation

- Added security considerations to the view module regarding the use of `new Function()` for evaluating expressions.
- Emphasized the importance of using trusted sources for expressions to mitigate security risks.

test(router): implement comprehensive router tests with mocked history

- Developed a suite of tests for the router module, including route matching, parameter extraction, query string parsing, and navigation functionality.
- Mocked the History API to facilitate testing in environments without full browser support.

test(store): update store tests to skip localStorage tests if not available

- Modified store tests to conditionally skip tests that require localStorage when it is not available, improving test reliability across environments.

* fix(router): escape backslashes in path regex to ensure proper processing

* docs(store): clarify shallow reactivity and update state mutation examples
test(signal): add tests for peek functionality in computed signals
@JosunLP JosunLP self-assigned this Jan 24, 2026
Copilot AI review requested due to automatic review settings January 24, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces version 1.2.0 of bQuery.js, adding three major new modules to the library: Router, Store, and View. These additions transform bQuery into a more comprehensive framework for building modern single-page applications.

Changes:

  • Added Router module for SPA client-side routing with History API support, navigation guards, route parameters, and query string parsing
  • Added Store module for signal-based state management with getters, actions, subscriptions, and localStorage persistence
  • Added View module for declarative DOM bindings using Vue/Alpine-style directives without requiring a compiler
  • Added peek() method to Computed class for reading values without tracking dependencies
  • Updated build configuration, package exports, documentation, and comprehensive test coverage for all new modules

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
package.json Version bumped to 1.2.0, added exports for router, store, and view modules
vite.config.ts Added build configuration entries for three new modules
src/router/index.ts New SPA routing module with History API, navigation guards, and route matching
src/store/index.ts New state management module with signal-based reactive stores and persistence
src/view/index.ts New declarative DOM binding module with directive-based templates
src/reactive/signal.ts Added peek() method to Computed class for non-tracking value access
src/index.ts, src/full.ts Updated to export new modules
tests/setup.ts Added mocks for History API, Location, and localStorage for testing
tests/router.test.ts Comprehensive router tests (1093 lines)
tests/store.test.ts Comprehensive store tests (352 lines)
tests/view.test.ts Comprehensive view tests (380 lines)
tests/signal.test.ts Added tests for peek() functionality
docs/guide/router.md Complete documentation for Router module
docs/guide/store.md Complete documentation for Store module with shallow reactivity warnings
docs/guide/view.md Complete documentation for View module with security warnings
docs/.vitepress/config.ts Added logo and navigation entries for new modules
README.md Updated with examples and documentation links for new modules
CHANGELOG.md Detailed changelog entry for version 1.2.0

…eichen korrekt zu escapen und die Handhabung von Platzhaltern zu optimieren. Füge umfassende Tests hinzu, um die Funktionalität zu überprüfen.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 11 comments.

JosunLP and others added 5 commits January 24, 2026 19:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…glichen und verbessere die Dokumentation für die Router- und View-Module mit Beispielen zur Schlüssel-Rekonsiliation.
…zu und verbessere die Fehlerbehandlung in den Tests für die View-Module
@JosunLP JosunLP merged commit ad97772 into main Jan 24, 2026
8 checks passed
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.

2 participants