Skip to content

fix: decouple shared REST utilities from Axios and verify tree-shaking - #98

Closed
urbankrepel-povio wants to merge 3 commits into
mainfrom
codex/optional-axios-peer
Closed

fix: decouple shared REST utilities from Axios and verify tree-shaking#98
urbankrepel-povio wants to merge 3 commits into
mainfrom
codex/optional-axios-peer

Conversation

@urbankrepel-povio

@urbankrepel-povio urbankrepel-povio commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Shared REST utility declarations imported Axios types even for native consumers. Remove those imports, accept unknown errors in message matching, and support native Headers as well as Axios-style header records.

Preserve every existing root export, including RestClient, RestInterceptor, and their types. Consumers can continue using those imports; no migration is required. Native consumers can tree-shake unused Axios exports in a bundle or use the dedicated subpaths for direct runtime imports.

Add an isolated consumer check to CI covering:

  • Direct non-Axios subpath imports and strict declaration compilation with Axios absent.
  • A bundled native/shared-helper import from the root with Axios absent: inspect the output for Axios imports and execute the resulting bundle.
  • Legacy root exports and types with Axios installed, plus the dedicated Axios entry point.

Boundary: unbundled root imports still load Axios, and root declarations retain the Axios-specific types for compatibility. Rolldown warns about the absent peer before treating it as external and eliminating the unused import; this check does not establish missing-peer resolution behavior for every bundler.

Local validation: build, typecheck, lint, optional-peer consumer checks, tree-shaking checks, and both full test modes. CI results are separate from local checks.

@urbankrepel-povio urbankrepel-povio changed the title fix!: isolate Axios from native and shared runtime imports fix: decouple shared REST utilities from Axios and verify tree-shaking Sep 11, 2026
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