Skip to content

refactor: internalize callback helpers#1083

Merged
tunnckoCore merged 2 commits intomasterfrom
refactor/internal-callback-helpers
Apr 16, 2026
Merged

refactor: internalize callback helpers#1083
tunnckoCore merged 2 commits intomasterfrom
refactor/internal-callback-helpers

Conversation

@tunnckoCore
Copy link
Copy Markdown
Member

Summary

  • replace external once and dezalgo runtime deps with internal helpers in src/utils.js
  • keep only the helper behavior actually used by formidable
  • add parity-oriented tests translated to node:test

Why

Formidable only uses a small subset of the behavior from these packages:

  • once(cb) semantics
  • dezalgo(cb) semantics
  • preservation of own properties on wrapped callbacks

We do not use once.strict() or once.proto(), so those are intentionally not carried over.

This also removes the need for the transitive helper packages behind them (wrappy and asap) from formidable's runtime dependency graph.

Testing

  • translated the relevant upstream-style behavior into:
    • test-node/utils/once.test.js
    • test-node/utils/dezalgo.test.js
  • ran full test suite successfully with pnpm run test

@tunnckoCore tunnckoCore merged commit aaf1e43 into master Apr 16, 2026
9 checks passed
@tunnckoCore tunnckoCore deleted the refactor/internal-callback-helpers branch April 16, 2026 01:06
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.

1 participant