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

refactor!: rewrite with improvements #30

Merged
merged 26 commits into from
Aug 2, 2022
Merged

refactor!: rewrite with improvements #30

merged 26 commits into from
Aug 2, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented May 4, 2022

Description

This PR ended up being a little more than I had intended. In short, it:

  1. switches to vitest
  2. adds support for shouldPrefetch
  3. moves publicPath to a function (buildAssetsURL) that is responsible for returning the public path of an asset - currently on rendererContext but it could easily be moved to ssrContext if we want per-request capability
  4. normalises a 'parsed resource' type that is cached on rendererContext
  5. removes unused _dynamicEntrypoints cache
  6. does not prefetch prefetches of dynamic dependencies
  7. does not also add preload tags for styles that should be rendered as well
  8. adds more attributes to prefetch links
  9. adds support for rendering preload/prefetch to headers (renderResourceHeaders)

Closes #28, resolves #20, resolves #24.

Breaking changes

  • shouldPrefetch and shouldPreload now have a different function type: (resource: ParsedResource) => boolean
  • createBundleRunner integration has been removed
  • manifest is no longer normalized by default (instead users are recommended to normalise it themselves with normalizeClientManifest which can be imported from vue-bundle-renderer/legacy)
  • clientManifest and publicPath options can no longer be provided to createRenderer

@danielroe danielroe requested a review from pi0 May 4, 2022 21:42
@danielroe danielroe self-assigned this May 4, 2022
@ErwanLent
Copy link

Hoping this PR goes out soon! 🤞🤞🤞 @danielroe @pi0 i'll buy you both a beer 😝

@dungonfq
Copy link

dungonfq commented Jun 3, 2022

Hi @danielroe @pi0, is there any plan to merge this PR on future? I'm facing the issue with prefetch nuxt/nuxt#14093. Hope this PR can fix our problem 🌟

@kosmeln
Copy link

kosmeln commented Jul 25, 2022

Is there any movement for this? We'd love to see that sooner - for our APP see all chunks preloaded is really a blocker.

@pi0
Copy link
Member

pi0 commented Jul 27, 2022

@danielroe is working on final rewrite items to release as a major version 🚀

@pi0 pi0 changed the title refactor: improvements refactor!: rewrite with improvements Aug 2, 2022
@pi0 pi0 merged commit dad6993 into main Aug 2, 2022
@pi0 pi0 deleted the feat/mark-2 branch August 2, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants