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

fix(hot-reload): fix actions conflicts during hot-reload + change transpilation phase #633

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

aralroca
Copy link
Collaborator

Fixes #118
Related #628 (first step)
Related #556 (first step)
Related #470 (first step)

In this PR I have changed:

  • I've made the transpilation part of the actions to be during the first build instead of a second build.
  • I've removed the plugin usage in the second build since it is done in a previous process.
  • Now the actions are bundled in a single file, which will allow later to make the change of build strategy that we plan to do to improve req/sec and change the import dynamic by a static in build-time (this will be done in another PR, but it is already aligned to be done).
  • The ids of the actions are now deterministic, so it avoids bugs with the hot-reload. Instead of using an incremental number, which paths during build concurrency can change order, and was the bug of conflicts during hot-reload, they now keep an id based on a hash of the filename.

Before:

process

Now:

now_process

Future (next PRs, but we have some blocks from new Bun APIs that are coming soon):

  • Reduce to 2 builds (server + client) even if there are 100 or more pages.

The multi-build of the current client pages is as workaround because IIFE was not supported in Bun. We need it to make the pages interactive during HTML streaming. But now Bun has supported IIFE, although it is experimental and there is no documentation yet, but this will probably improve build times considerably.

Copy link

pkg-pr-new bot commented Nov 16, 2024

Open in Stackblitz

brisa-adapter-vercel

bun add https://pkg.pr.new/brisa-build/brisa/brisa-adapter-vercel@633

brisa

bun add https://pkg.pr.new/brisa-build/brisa@633

brisa-tailwindcss

bun add https://pkg.pr.new/brisa-build/brisa/brisa-tailwindcss@633

brisa-pandacss

bun add https://pkg.pr.new/brisa-build/brisa/brisa-pandacss@633

create-brisa

bun add https://pkg.pr.new/brisa-build/brisa/create-brisa@633

www

bun add https://pkg.pr.new/brisa-build/brisa/www@633

commit: 9af082c

@aralroca aralroca merged commit 1bb6870 into canary Nov 16, 2024
5 of 8 checks passed
@aralroca aralroca deleted the aralroca/build-optimizations branch November 16, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug actions: hotreloading change the action id and break
1 participant