BLOG-290 Migrate the frontend JS runtime to bun #294
Reference in New Issue
Block a user
Delete Branch "BLOG-290_migrate_to_bun"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
This change migrates the frontend environment from Node.js/pnpm to Bun to improve build performance and runtime efficiency. The migration includes updating CI/CD workflows, Docker configurations, and the SvelteKit adapter. Additionally, the PR introduces stricter linting rules via eslint-plugin-simple-import-sort and a global restriction on relative imports to enforce the use of path aliases ($lib/...), ensuring a cleaner and more maintainable import structure across the project. Backend environment variables were also renamed for consistency.
Package Changes
Screenshots
No response
Reference
Resolves #290.
Checklist
--bunto lint and checkBLOG-290 Migrate the frontend JS runtime to bunto BLOG-290 Migrate the frontend js runtime to bunBLOG-290 Migrate the frontend js runtime to bunto BLOG-290 Migrate the frontend JS runtime to bun/improve
PR Code Suggestions ✨
Correct invalid Tailwind CSS syntax
The
:variant syntax for targeting descendant elements is incorrect. The attributeselector should be enclosed in square brackets. This syntax error prevents Tailwind
CSS from applying the intended styles, breaking the component's layout.**
frontend/src/lib/common/framework/components/ui/command/command-dialog.svelte [34]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies an invalid syntax for Tailwind CSS v4's
**:variant when used with attribute selectors. Theexisting_code**:data-command-group:px-2is incorrect and would fail to apply styles, whereas theimproved_code**:[data-command-group]:px-2is the correct syntax. This is a valuable correction that fixes a styling bug.Add missing package.json to image
The final runner stage is missing the
package.jsonfile. Some Node.js packages mayattempt to read
package.jsonat runtime to check for versions or other metadata,which would cause a crash if the file is not present.
frontend/Dockerfile [20-28]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that the
package.jsonfile is missing from the final runner stage in the Dockerfile. While not an immediate bug, some packages rely on this file at runtime, and its absence could lead to difficult-to-debug crashes. Adding it is a best practice that improves the image's robustness.Improve incomplete ESLint glob pattern
The glob patterns to ignore relative CSS imports are incomplete. They only cover
paths in the current and parent directories, but will incorrectly flag valid deeper
relative imports like
../../styles.css. Using a more general pattern will correctlyignore all relative CSS imports.
frontend/eslint.config.js [56-67]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that the ESLint glob patterns for ignoring relative CSS imports are incomplete. The existing patterns
!./**/*.cssand!../**/*.cssdo not cover deeper relative paths. The proposed change to!**/*.cssis more robust and correctly covers all relative CSS imports, improving the accuracy of the linting rule.f7ec5fd7a2ee97c4d81e