Skip to content

fix(unplugin): fixed hot reloading in Bun (clone of #1834 for go-lang)#1838

Merged
samchon merged 1 commit into
nextfrom
fix/bun-again
May 6, 2026
Merged

fix(unplugin): fixed hot reloading in Bun (clone of #1834 for go-lang)#1838
samchon merged 1 commit into
nextfrom
fix/bun-again

Conversation

@samchon

@samchon samchon commented May 6, 2026

Copy link
Copy Markdown
Owner

This pull request updates the way source files are loaded in the bunTypiaPlugin for Bun. Instead of using Bun.file().text(), it now loads the file as a module with a text loader, which can improve compatibility and reliability with Bun's module system.

Build process improvements:

  • Changed the file loading mechanism in the build.onLoad handler of bunTypiaPlugin to use dynamic import with { with: { type: "text" } } instead of Bun.file().text(), ensuring better integration with Bun's loader system.

@samchon samchon self-assigned this May 6, 2026
@samchon samchon added the bug Something isn't working label May 6, 2026
@samchon samchon closed this May 6, 2026
@samchon samchon reopened this May 6, 2026
@samchon samchon marked this pull request as ready for review May 6, 2026 10:01
Copilot AI review requested due to automatic review settings May 6, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Bun-specific @typia/unplugin integration to load source files via Bun’s module loader (dynamic import() with type: "text") instead of reading them directly with Bun.file().text(), aiming to improve compatibility with Bun’s loader system and hot reloading behavior.

Changes:

  • Replaced Bun.file(id).text() with a dynamic import using Bun’s text loader in the build.onLoad handler.

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

Comment on lines +131 to +133
const source = wrap<Source>(
(await import(`${args.path}?`, { with: { type: "text" } })).default,
);
Comment on lines +131 to +133
const source = wrap<Source>(
(await import(`${args.path}?`, { with: { type: "text" } })).default,
);
@samchon samchon merged commit 9eeb5ae into next May 6, 2026
16 checks passed
@samchon samchon deleted the fix/bun-again branch May 6, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants