Skip to content

Experiment: Modularize nicegui.js with esbuild bundler - #114

Draft
evnchn wants to merge 1 commit into
mainfrom
temp/esbuild-refactor
Draft

Experiment: Modularize nicegui.js with esbuild bundler#114
evnchn wants to merge 1 commit into
mainfrom
temp/esbuild-refactor

Conversation

@evnchn

@evnchn evnchn commented Mar 29, 2026

Copy link
Copy Markdown
Owner

What this branch does

Splits the monolithic nicegui.js into organized ES modules under src/ (app.js, colors.js, constants.js, elements.js, events.js, render.js, utils.js, quasar-hack.js) with an esbuild build system. Uses a footer workaround to flatten exports to window.* for backward compatibility. Preserves window.app and window.mounted_app public API.

Status

Experimental — one of two paired JS bundler experiments (see also: temp/rollup-refactor). This branch uses esbuild. Valuable as a reference for nicegui.js modularization approaches and bundler comparison.

Files changed

18 files, key additions: nicegui/static/src/*.js (8 modules), nicegui/static/build.mjs, nicegui/static/package.json

Upstream PR

None yet

- Split monolithic nicegui.js into organized modules in src/
- Add esbuild build system with build.mjs script
- Footer flattens exports to window.* for compatibility
- Restore public API: window.app and window.mounted_app
- Exclude generated nicegui.js from end-of-file-fixer

Alternative to Rollup - demonstrates footer workaround for
flattening window globals without nested structure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@evnchn evnchn added experimental Experiment/POC - preserve for reference javascript Pull requests that update javascript code labels Mar 29, 2026
@evnchn evnchn added the nicegui-js-refactor Reference material for any future nicegui.js modularization label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Experiment/POC - preserve for reference javascript Pull requests that update javascript code nicegui-js-refactor Reference material for any future nicegui.js modularization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant