Skip to content

Remove @babylonjs/gui-editor dependency and mark as external#427

Closed
tracygardner wants to merge 4 commits intomainfrom
claude/externalize-gui-editor-gCjlf
Closed

Remove @babylonjs/gui-editor dependency and mark as external#427
tracygardner wants to merge 4 commits intomainfrom
claude/externalize-gui-editor-gCjlf

Conversation

@tracygardner
Copy link
Contributor

@tracygardner tracygardner commented Mar 20, 2026

Summary

This PR removes the @babylonjs/gui-editor package as a direct dependency and marks it as an external module in the Rollup build configuration. This change indicates the package is no longer bundled with the application.

Changes

  • Removed @babylonjs/gui-editor from package.json dependencies
  • Added @babylonjs/gui-editor to the external array in Rollup's rollupOptions configuration to prevent bundling attempts

Implementation Details

By marking the package as external in Rollup, any imports of @babylonjs/gui-editor will be treated as external dependencies rather than being bundled into the final build output. This is useful when the package is either:

  • Provided by the runtime environment separately
  • No longer needed in the application
  • Loaded dynamically from an external source

https://claude.ai/code/session_01W3JSg9Nh34J36sZj9FnkdJ

Summary by CodeRabbit

  • Chores
    • Moved an external UI/editor package out of runtime dependencies so it will no longer be installed at runtime.
    • Updated build/optimization settings to exclude that package from dependency processing and treat it as external during bundling; no public APIs or exported entities changed.

It is only a transitive dependency of @babylonjs/inspector (a devDependency)
and is not used directly by the application. Removing it from dependencies
and marking it as a Rollup external prevents it from inflating the bundle.

https://claude.ai/code/session_01W3JSg9Nh34J36sZj9FnkdJ
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 29e5e70e-a41e-48a5-a98e-8f4a7df1eadf

📥 Commits

Reviewing files that changed from the base of the PR and between 07fc630 and 0ebb72e.

📒 Files selected for processing (1)
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • package.json

📝 Walkthrough

Walkthrough

Removed @babylonjs/gui-editor from runtime dependencies and updated Vite config to exclude and treat @babylonjs/gui-editor as external during optimization and bundling, preventing it from being included in the final build.

Changes

Cohort / File(s) Summary
Dependency update
package.json
Moved @babylonjs/gui-editor from dependencies to devDependencies (same version). No other metadata or scripts changed.
Build configuration
vite.config.mjs
Added @babylonjs/gui-editor to optimizeDeps.exclude and listed it as external in build.rollupOptions while keeping input: "index.html". Formatting of the exclude list was adjusted.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibbled lines and cleared the trail,
One package shifted, light as a tale.
Vite skips the bundle, rollup waves goodbye,
I twitch my whiskers and hum a lullaby. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: moving @babylonjs/gui-editor to devDependencies and marking it as external in Vite configuration to prevent bundling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/externalize-gui-editor-gCjlf
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
vite.config.mjs (1)

1-305: ⚠️ Potential issue | 🟡 Minor

Prettier check is failing for this file in CI.

Pipeline reports a formatting issue in vite.config.mjs; please run Prettier and commit the formatted file to unblock checks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vite.config.mjs` around lines 1 - 305, Prettier formatting is failing for
vite.config.mjs; reformat the file with your project's Prettier settings (e.g.,
run prettier --write vite.config.mjs or npm/yarn format) and commit the changes
so CI passes; ensure the exported default config (export default { ... }),
plugin blocks (cssInjectedByJsPlugin, VitePWA, viteStaticCopy), and the custom
writeBundle hooks (create-flock-proxy, copy-library-files) remain functionally
unchanged after formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@vite.config.mjs`:
- Around line 1-305: Prettier formatting is failing for vite.config.mjs;
reformat the file with your project's Prettier settings (e.g., run prettier
--write vite.config.mjs or npm/yarn format) and commit the changes so CI passes;
ensure the exported default config (export default { ... }), plugin blocks
(cssInjectedByJsPlugin, VitePWA, viteStaticCopy), and the custom writeBundle
hooks (create-flock-proxy, copy-library-files) remain functionally unchanged
after formatting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3376272-53ff-4b3c-a693-a50d45b4fe4e

📥 Commits

Reviewing files that changed from the base of the PR and between b3824be and 8d58bf2.

📒 Files selected for processing (2)
  • package.json
  • vite.config.mjs
💤 Files with no reviewable changes (1)
  • package.json

claude added 3 commits March 20, 2026 14:14
The Rollup external only covers the build phase; Vite's esbuild pre-bundler
also needs to be told to skip these packages. Without this, esbuild fails
when processing the inspector bundle which has a hardcoded require() for
@babylonjs/gui-editor.

https://claude.ai/code/session_01W3JSg9Nh34J36sZj9FnkdJ
The inspector bundle is CommonJS and must be pre-bundled by esbuild so it
can run in the browser. Excluding it caused Vite to serve the raw CJS bundle
directly, breaking all its require() calls and cascading into ERR_FAILED
errors for @babylonjs/gui files.

@babylonjs/gui-editor alone in the exclude list is enough: Vite passes
excluded entries as esbuild externals, so the inspector is pre-bundled with
gui-editor left as an unresolved external reference.

https://claude.ai/code/session_01W3JSg9Nh34J36sZj9FnkdJ
The inspector's CJS bundle has a hardcoded require() for it, so it must be
installed locally for the dev server to resolve. As a devDependency it is
installed during development but excluded from the production bundle via
rollupOptions.external and optimizeDeps.exclude.

https://claude.ai/code/session_01W3JSg9Nh34J36sZj9FnkdJ
@tracygardner tracygardner deleted the claude/externalize-gui-editor-gCjlf branch March 20, 2026 14:32
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