Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix unhandled exception when stopping app, fragile tests, and modernize CI - #1125

Open
davictran76 wants to merge 1 commit into
hyperapp:mainfrom
davictran76:fix/update-ci-node-version
Open

davictran76 wants to merge 1 commit into
hyperapp:mainfrom
davictran76:fix/update-ci-node-version

Conversation

@davictran76

Copy link
Copy Markdown

Description

This PR fixes an unhandled runtime exception when stopping an application, corrects fragile test assertions, and modernizes the GitHub Actions CI matrix.

1. Fix crash when stopping an app (index.js)

  • Problem: When stopping the app via dispatch(null), subscriptions is reassigned to identity function id. The guard if (subscriptions) evaluates to truthy, subsequently invoking id(null) -> null and passing null into patchSubs, which throws an error.
  • Fix: Added && state != null to ensure subscriptions are never patched once the application has terminated.

2. Fix DOM node reference breakage in tests (tests/index.test.js)

  • Tests referencing node.parentNode after a dispatch failed when tags changed because patch calls removeChild, resetting parentNode to null.
  • Retained a persistent reference to container before calling app(), reading from container.childNodes[0] directly.
  • Fixed Proxy access: changed div.style._props.color to div.style.color.

3. Modernize CI matrix (.github/workflows/ci.yml)

  • Updated Node.js matrix to supported LTS versions: [18.x, 20.x, 22.x].
  • Bumped actions/checkout and actions/setup-node to @v4.
  • Removed deprecated codecov global CLI.

Checklist

  • All 36 tests pass locally.
  • Code adheres to the minimal footprint philosophy.

@kinetoprotocol-dev kinetoprotocol-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good

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