Skip to content
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

web: ESBuild performance + Live reload #13026

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

GirlBossRush
Copy link
Contributor

Details

This PR features two primary improvements to our ESBuild script:

Use of ESBuild's built-in watcher

Previously, we used Chokidar to track file changes ourselves, building all entry points if any file is changed. We can now limit rebuilds to the specific files within each entry, additionally getting a second performance boost from ESbuild's context caching.

Live-reload

Previously, modifying the front-end required manually refreshing the page, often several times in a a row to ensure the reload "caught" ESBuild's compiled output. ESBuild events are now relayed to the browser, allowing for automatic reloading.

This also includes a few ease of use behaviors such as...

  • Logging which file contains errors preventing a build from completion
    • e.g. "Where's that syntax error my IDE isn't showing me?"
  • Logging when the when build process has crashed
    • e.g. "Is it still building or am I editing the wrong file?"

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@GirlBossRush GirlBossRush added enhancement New feature or request javascript Pull requests that update Javascript code labels Feb 14, 2025
@GirlBossRush GirlBossRush self-assigned this Feb 14, 2025
@GirlBossRush GirlBossRush requested a review from a team as a code owner February 14, 2025 02:07
Copy link

netlify bot commented Feb 14, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 631f46a
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67b61d9265b0fd0008f5049b
😎 Deploy Preview https://deploy-preview-13026--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 14, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 631f46a
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67b61d92a63e2d000803057d
😎 Deploy Preview https://deploy-preview-13026--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.67%. Comparing base (a714c78) to head (631f46a).
Report is 90 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13026      +/-   ##
==========================================
+ Coverage   92.62%   92.67%   +0.04%     
==========================================
  Files         792      792              
  Lines       40222    40222              
==========================================
+ Hits        37256    37274      +18     
+ Misses       2966     2948      -18     
Flag Coverage Δ
e2e 48.02% <ø> (+<0.01%) ⬆️
integration 24.12% <ø> (ø)
unit 90.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rissson rissson changed the title ESBuild performance + Live reload web: ESBuild performance + Live reload Feb 14, 2025
Copy link
Member

@BeryJu BeryJu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GirlBossRush GirlBossRush merged commit 5eb6d62 into goauthentik:main Feb 27, 2025
86 checks passed
@GirlBossRush GirlBossRush deleted the live-reload-v1 branch February 27, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants