Experiment: Modularize nicegui.js with Rollup bundler - #115
Draft
evnchn wants to merge 1 commit into
Draft
Conversation
- Split monolithic nicegui.js into organized modules in src/ - colors.js: Color utilities - constants.js: Python-style constants (True/False/None) - elements.js: Element access helpers - events.js: Event handling and throttling - render.js: Vue rendering logic - utils.js: General utilities - app.js: Vue app creation and socket handlers - quasar-hack.js: Quasar CSS fixes - index.js: Entry point with public API exports - Add Rollup build system with package.json and rollup.config.mjs - IIFE format with beautified output for debugging - External dependencies: Vue, Quasar, Socket.IO - Watch mode for development workflow - Restore public API compatibility: - All functions exposed on window object - Added window.app and window.mounted_app getters - Add pre-commit hook to auto-rebuild on JS changes - Document new workflow in CONTRIBUTING.md - Save original file as nicegui.old.js for reference Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this branch does
Splits the monolithic nicegui.js into the same organized ES modules as the esbuild branch (app.js, colors.js, constants.js, elements.js, events.js, render.js, utils.js, quasar-hack.js) but uses Rollup as the bundler. Outputs IIFE format with beautified output for debugging, external Vue/Quasar/Socket.IO dependencies, and adds a pre-commit hook to auto-rebuild on JS changes.
Status
Experimental — one of two paired JS bundler experiments (see also: temp/esbuild-refactor). This branch uses Rollup. Together they allow comparing bundler ergonomics and output for the same modularization.
Files changed
17 files, key additions:
nicegui/static/src/*.js(8 modules),nicegui/static/rollup.config.mjs,nicegui/static/package.jsonUpstream PR
None yet