Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Oct 23, 2023

When using the Vite-based development server, the application build step already contains the list of known packages that would need to be prebundled. This information can be passed to Vite directly to avoid Vite needing to perform discovery on every output file that will be requested. This also avoids the Vite server behavior where Vite forces a reload of the page when it discovers a new dependency. This behavior can result in lost state during lazy loading of a route.

@clydin clydin marked this pull request as ready for review October 24, 2023 13:06
@clydin clydin requested a review from alan-agius4 October 24, 2023 13:56
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 24, 2023
Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM, just a typo

@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: rc This PR is targeted for the next release-candidate and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 24, 2023
…ges in vite prebundling

When using the Vite-based development server, the application build step already contains the
list of known packages that would need to be prebundled. This information can be passed to Vite
directly to avoid Vite needing to perform discovery on every output file that will be requested.
This also avoids the Vite server behavior where Vite forces a reload of the page when it discovers
a new dependency. This behavior can result in lost state during lazy loading of a route.
@clydin clydin force-pushed the esbuild/prime-prebundle-discovery branch from 88f87bd to 4470db5 Compare October 24, 2023 14:54
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Oct 24, 2023
@alan-agius4 alan-agius4 merged commit 9768c18 into angular:main Oct 25, 2023
@clydin clydin deleted the esbuild/prime-prebundle-discovery branch October 25, 2023 11:53
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@angular-devkit/build-angular:browser-esbuild reloads when navigating to lazy routes for the first time, causing navigation to fail.

2 participants