Skip to content

Conversation

@Ehevi
Copy link

@Ehevi Ehevi commented Sep 7, 2025

I DON'T have JIRA ticket

  • explain what this PR does
  • if it is new feature explain how plan to use it
  • test are added
  • documentation is changed or added
  • FLP integration tests were ran successful

Summary

This PR makes the demo applications in Framework/docs/demo/ actually runnable. Until now, all demo pages would stall on Loading… because the framework’s renderer.js imports Mithril from an absolute path. Unless Mithril is provided at that path, the browser request 404s, window.m never exists, and the demos cannot render. The problem appears both when serving files locally with a static server as well as the hosted GitHub Pages demo (see the Advanced frontend demo).

What this PR does

  • Adds a proper demo server project under Framework/docs/demo/project/
    • Uses the HttpServer from WebUi.
    • Provides clean routes (/frontend, /chart, /notification, /template-1, /template-2).
    • Includes its own Readme with setup and usage instructions.
  • Documents the Mithril issue in a new demo Readme.
    • Explains that Mithril must be served explicitly because of the absolute import.
    • Provides two ways to run demos:
      • Full server approach (recommended) – use the new demo server project.
      • Manual workaround (quick & dirty) – copy or paste Mithril into /mithril/mithril.min.js and serve docs statically.
  • Updates the main Framework/README.md:
    • Links to the new demo README as the reliable way to run demos locally.

Why this is needed

  • Previously, none of the demos worked locally or on GitHub Pages due to the missing /mithril/mithril.min.js.
Screenshot 2025-09-07 at 20 12 06 Screenshot 2025-09-07 at 12 07 34
  • Onboarding developers had no guidance on how to run demos successfully.
  • This PR makes demos reproducible, documents the options, and sets up a recommended backend-based solution.

Next steps / open questions

  • Should the hosted GitHub Pages demo be updated to include a /mithril folder or switched to a CDN import?
  • Long-term: consider patching renderer.js to allow overriding the Mithril URL via window.WEBUI_MITHRIL_URL.
  • Acknowledgement: This PR fixes running demos locally. However, it does not address the GitHub Pages–hosted demo, which will still 404 /mithril/mithril.min.js. Fixing the hosted demo (e.g. by publishing Mithril at the site root or switching the import to a CDN) is out of scope for this PR.

@Ehevi Ehevi force-pushed the advanced-frontend-demo-fix branch 3 times, most recently from 867d909 to 16bc0d9 Compare September 7, 2025 18:28
@Ehevi Ehevi force-pushed the advanced-frontend-demo-fix branch from 2b5569f to b2e8f46 Compare September 7, 2025 18:32
@Ehevi Ehevi marked this pull request as ready for review September 7, 2025 18:38
@Ehevi Ehevi requested a review from graduta as a code owner September 7, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant