-
Notifications
You must be signed in to change notification settings - Fork 9
feat: implement html and bundled webapps #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5662bc0 to
a43b56a
Compare
e072dd8 to
b9822d4
Compare
c4e7e1f to
96881a1
Compare
6b79342 to
a14edd2
Compare
There was a problem hiding this comment.
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 implements support for HTML and bundled webapps, expanding beyond the existing iFrame and Superset types. The implementation adds the ability to create webapps with plain HTML content or uploaded zip bundles containing complete web applications.
Key changes include:
- Added HTML and Bundle webapp types with corresponding content storage fields
- Implemented backend views to serve HTML content and bundle files
- Created type-aware form fields with preview capabilities for different webapp types
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/webapps/features/WebappForm/WebappForm.tsx | Added type-specific form fields (HTML editor, bundle uploader) with preview functionality |
| frontend/src/webapps/features/WebappIframe/WebappIframe.tsx | Updated to construct URLs based on webapp type (HTML/Bundle/iFrame) |
| backend/hexa/webapps/models.py | Added content and bundle fields to Webapp model, made url optional |
| backend/hexa/webapps/views.py | Implemented views to serve HTML content and bundle files from webapps |
| backend/hexa/webapps/schema/mutations.py | Added content input flattening logic to handle different webapp types |
| frontend/src/graphql/types.ts | Updated GraphQL types to support WebappContentInput union type |
| backend/hexa/webapps/tests/ | Added comprehensive test coverage for views and mutations |
| frontend/next.config.js | Added rewrites to proxy webapp content requests to backend |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c144c85 to
93d6db4
Compare
This commit adds support for HTML and bundled React applications as new webapp types, in addition to the existing iFrame and Superset types. Changes include: - Add HTML and BUNDLE webapp types to models and GraphQL schema - Make url field optional (not needed for HTML/Bundle types) - Add content field for HTML webapps - Add bundle field for bundled React apps (stored as zip) - Add type-aware form fields with preview functionality - Add bundle upload with drag-and-drop support - Add HTML editor with live preview - Add webapp serving endpoints for HTML and Bundle types - Extract webapp type label logic to helper function - Add comprehensive tests for new functionality - Add translations for new features
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
11a953e to
471362f
Compare
| """ | ||
| Directive to ensure exactly one field is provided in an input type. | ||
| """ | ||
| directive @oneOf on INPUT_OBJECT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applies oneOf on InputType to only allow either content, bundle or html
bramj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed yesterday: The UX is great and it's working well 👍
I was able to migrate the site https://github.com/BLSQ/site-pev-rdc-reports to a web app, and after making sure to build it with relative paths to the assets, it worked great!
The problem is: with the current implementation, every link from the web app is served by hitting a path like for example /bundle/assets/styles.css, and every call to /bundle/* will call the database of the .zip, extract it and return the correct file.
My fear is that when web apps start containing for example large json files to serve data, we'll start seeing performance issues soon (I suppose memory issues because of unzipping).
So we should explore an alternative approach such as unzipping on storage after upload and storing the bucket name on the web app. When serving the app we can then serve directly from the blob storage.
A short, meaningful PR description. Explain the goal of the PR and the ideas behind it.
Closed : HEXA-1455, HEXA-1442
Changes
Please list / describe the changes in the codebase for the reviewer(s).
How/what to test
Screenshots / screencast
Screen.Recording.2025-12-17.at.09.06.47.mov