Skip to content

refactor!: rewrite with improvements#30

Merged
pi0 merged 26 commits intomainfrom
feat/mark-2
Aug 2, 2022
Merged

refactor!: rewrite with improvements#30
pi0 merged 26 commits intomainfrom
feat/mark-2

Conversation

@danielroe
Copy link
Copy Markdown
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
Copy Markdown

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

@dungonfq
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

expose function renderPreloadLinks And function renderPrefetchLinks Flag to disable prefetching dynamic chunks

5 participants