fief-dev / fief

Users and authentication management SaaS
https://www.fief.dev
Other
538 stars 44 forks source link

Include htmx.org and hyperscript.org as part of javascript bundle. #430

Open i-am-mike-davis opened 1 month ago

i-am-mike-davis commented 1 month ago

The Administration UI requires htmx.org and hyperscript.org from unpkg.com. Without these packages, all htmx functions on the UI break (e.g. adding redirect URIs). This commit attempts to include these packages as part of the javascript bundle as described in the Hypermedia Systems book: https://hypermedia.systems/extending-html-as-hypermedia/

frankie567 commented 1 month ago

~This is working right now in production, I don't see the point of those changes.~

Sorry, closed this a bit abruptly, I saw your discussion topic after ☺️ That might be indeed interesting, I'll have a closer look

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.59%. Comparing base (ed0fe87) to head (02c6618).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #430 +/- ## ======================================= Coverage 91.59% 91.59% ======================================= Files 239 239 Lines 8093 8093 ======================================= Hits 7413 7413 Misses 680 680 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

i-am-mike-davis commented 1 month ago

~This is working right now in production, I don't see the point of those changes.~

Sorry, closed this a bit abruptly, I saw your discussion topic after ☺️ That might be indeed interesting, I'll have a closer look

No worries :smile:

For readers of the thread, link to the discussion article: https://github.com/orgs/fief-dev/discussions/431

frankie567 commented 1 month ago

So, I agree with the objective of the PR and I think it would be a great addition.

However, just adding htmx and hyperscript as JS dependency is not sufficient here: we need to bundle it with Rollup (like we do for CSS and the code editor module for example) and include it in our template header.

i-am-mike-davis commented 1 month ago

So, I agree with the objective of the PR and I think it would be a great addition.

However, just adding htmx and hyperscript as JS dependency is not sufficient here: we need to bundle it with Rollup (like we do for CSS and the code editor module for example) and include it in our template header.

Can you please point me to the file containing the template header?

i-am-mike-davis commented 2 weeks ago

@frankie567 check out the new changes that bundle htmx and hyperscript with Rollup. Big shout out to @nathanbowman