Skip to content

refactor: bundle connect-history-api-fallback#181

Merged
chenjiahan merged 1 commit intomainfrom
neverland/fix-history-api-fallback-import
Apr 1, 2026
Merged

refactor: bundle connect-history-api-fallback#181
chenjiahan merged 1 commit intomainfrom
neverland/fix-history-api-fallback-import

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

This PR switches connect-history-api-fallback to a typed dynamic import so the server bundle can load it without relying on a runtime external. It also moves the package into devDependencies and adds the matching type package to keep the build self-contained.

Testing

  • pnpm build
  • pnpm lint

Related Links

None

@chenjiahan chenjiahan changed the title fix: load connect-history-api-fallback via dynamic import refactor: bundle connect-history-api-fallback Apr 1, 2026
@chenjiahan chenjiahan marked this pull request as ready for review April 1, 2026 08:53
Copilot AI review requested due to automatic review settings April 1, 2026 08:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes connect-history-api-fallback load via a typed dynamic import so it can be included in the server build output rather than relied on as a runtime external.

Changes:

  • Replace require('connect-history-api-fallback') with await import('connect-history-api-fallback') (typed via @types/connect-history-api-fallback).
  • Stop externalizing connect-history-api-fallback in the server build config to allow bundling it.
  • Move connect-history-api-fallback to devDependencies and add its type package.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/server.ts Switches history API fallback middleware loading from require to dynamic import() and aligns middleware typing.
rslib.config.ts Removes connect-history-api-fallback from externals so it can be bundled into the server output.
package.json Moves connect-history-api-fallback to devDependencies and adds @types/connect-history-api-fallback.
pnpm-lock.yaml Lockfile updates for the dependency move and added type packages.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 8ea2b58 into main Apr 1, 2026
7 checks passed
@chenjiahan chenjiahan deleted the neverland/fix-history-api-fallback-import branch April 1, 2026 09: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.

2 participants