feat!: modernize tooling and migrate to Standard Schema - #2
Merged
Conversation
Replace Zod with Standard Schema interface for event validation, enabling any compliant validator (zod 3.24+, valibot, arktype, etc.). - Build: vite → tsdown with dual ESM+CJS output - Lint/Format: eslint+prettier → oxlint+oxfmt (root-level via turbo) - Test: add vitest with happy-dom (18 tests across core + react) - CI/CD: GitHub Actions with OIDC NPM provenance, changesets - Deps: remove react-use, type-fest; add pnpm catalog for versions - Config: tsconfig.base.json, commitlint, husky hooks, .node-version - Delete playground/ (to be replaced by TanStack Start example) BREAKING CHANGE: EventMap now uses StandardSchemaV1 instead of z.ZodTypeAny. All schema validation uses the Standard Schema protocol.
Interactive example showing izod's iframe communication with Standard Schema validation (zod). Parent and child pages exchange typed messages through a handshake-based protocol. - Astro static site in examples/astro-demo/ - GitHub Pages deploy workflow (.github/workflows/deploy.yml) - Add astro + zod to pnpm catalog
Disable child frame navigation in happy-dom settings to prevent fetch attempts to iframe URLs during test teardown.
Add @izod/react example using child.useCreate and parent.useConnect hooks alongside the existing @izod/core example. Restructure pages into /core and /react paths with a landing page at root. - Add @astrojs/react integration with semver@7.7.4 override - Add ReactParent and ReactChild components with client:only directive - Move core example pages to /core subdirectory - Add landing page with links to both examples
Parse vitest coverage-summary.json from each package and post a markdown table as a PR comment, upserting via HTML comment marker to avoid duplicates. Uses issues:write permission (not pull-requests).
- Add coverage/ to .gitignore - Rewrite root README for Standard Schema and updated API - Add @izod/core README with full createChild/connectToParent docs - Add @izod/react README with child.useCreate/parent.useConnect docs - Apply oxfmt formatting across touched files
- Add .oxfmtrc.json with singleQuote: true to match old .prettierrc - Add coverage/ to .gitignore - Add per-package README badges for bundle size, npm version, types - Reformat all source files with corrected quote style
Switch from issues:write to pull-requests:write to fix 403 on PR comments. Guard the coverage comment step with a same-repo check so fork PRs cannot use the write token.
Coverage Report
Updated by CI — 2026-05-16 11:32 UTC |
Core (55% → 93% statements): add connectToParent handshake, child-side emit, inbound event dispatch, origin filtering, namespace filtering, destroy cleanup, and validation edge cases. React (73% → 95% statements): add handshake pending state, onHandshakeError callback, parent.useConnect handshake and error flows.
Pin upload-pages-artifact and deploy-pages to their commit SHAs to match the pinning convention used in the CI workflow.
Replace the inline useAsyncCallback with a proper implementation matching react-use's useAsyncFn: race condition protection via call ID tracking, unmount guards, argument forwarding, promise return from execute, and stale-while-reloading state preservation.
Replace state.loading with a ref in useAsyncCallback's dependency array so the execute callback stays referentially stable, preventing the React demo parent from re-initiating the handshake in a loop. Extract shared demo styles into ParentLayout and ChildLayout Astro components so core and React examples share identical styling without duplication. Center-align the base index page.
Model AsyncState as a 4-variant discriminated union (matching react-use) so value/error are accessible on all variants while preserving narrowing. Move @standard-schema/spec from devDependencies to dependencies in @izod/core since it's re-exported in public type declarations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@standard-schema/spec) for event data validation, enabling any compliant validator (zod 3.24+, valibot, arktype, effect-schema, etc.)@izod/coreand@izod/react//#tasks), vitest+happy-dom for testing, commitlint+husky for git hooks, changesets for release managementreact-use(replaced with inline state),type-fest,vite,eslintand plugins; add pnpm catalog for centralized version managementBreaking Changes
EventMaptype:Record<string, z.ZodTypeAny>→Record<string, StandardSchemaV1>z.infer<>types replaced withStandardSchemaV1.InferOutput<>zodis no longer a peer dependency — consumers choose their own Standard Schema validator.js) and CJS (.cjs) instead of ESM-only (.es.js)Test plan
pnpm run typecheck— 3/3 turbo tasks passpnpm run test— 18/18 tests pass (13 core + 5 react)pnpm run build— dual ESM+CJS output verified in both packagespnpm run lint— oxlint: 0 warnings, 0 errors