Skip to content

Remove unused function warnings#700

Merged
proggeramlug merged 7 commits into
PerryTS:mainfrom
TheHypnoo:feat/remove-unused-functions
May 12, 2026
Merged

Remove unused function warnings#700
proggeramlug merged 7 commits into
PerryTS:mainfrom
TheHypnoo:feat/remove-unused-functions

Conversation

@TheHypnoo
Copy link
Copy Markdown
Contributor

Summary

  • Removes unused helper functions and compatibility wrappers that no longer have call sites across HIR lowering, codegen, runtime, extensions, stdlib, and publish code.
  • Restricts monomorphization constraint helpers to module-private visibility instead of exposing private implementation types through a wider API.
  • Keeps test-only helpers available behind #[cfg(test)] where the only remaining users are unit tests.

Removed as clearly unused

  • Old native-instance rewrite helpers in perry-hir::js_transform; the active class-field rewrite path now handles this behavior.
  • Wrapper helpers such as fresh_global, type extraction aliases, unused tarball/error/fetch helpers, unused promise wait wrappers, and stale Redis/codegen helper entry points.
  • The old async generator step driver; the code now uses build_async_step_driver_direct, and the removed variant had no call sites.
  • Runtime pointer/string helpers in map/set/bigint that had been superseded by newer representation-aware paths.

Reviewed but intentionally left in place

  • maybe_force_lazy, because it documents and implements lazy JSON array materialization plumbing that may be exercised by future accessor paths.
  • write_stream_end1_impl, because it appears to be intended support for writeStream.end(chunk) even though the current method table only registers the zero-argument form.
  • create_fs_constants_object, because it is a compatibility-style runtime helper for fs.constants; removing it would be riskier than the warning suggests.
  • JSON/SSO helpers such as sso_emit_enabled, nanbox_pointer_f64, and stringify_value_with_replacer, because they are tied to partially wired migration or replacer support.
  • WebSocket pump declarations and JS runtime conversion helpers, because they are feature/API-facing surfaces rather than obviously disposable code.
  • CLI helpers such as compile_for_web, merge_p12_files, get_type_at_position, and encode_nil, because they look like unfinished or externally useful capabilities rather than safe dead-code removals.

Validation

  • git diff --check
  • cargo build

The build still reports unrelated warnings for unreachable patterns, unused fields, feature-gated declarations, and intentionally retained helper functions. This PR focuses only on functions that were clear to remove or narrow safely.

@proggeramlug proggeramlug merged commit c12adc1 into PerryTS:main May 12, 2026
9 checks passed
@TheHypnoo TheHypnoo deleted the feat/remove-unused-functions branch May 12, 2026 17:41
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