Skip to content

feat!: dynamic routes plugin overhaul#4525

Merged
brc-dd merged 27 commits intomainfrom
fix/vite-6
Feb 24, 2025
Merged

feat!: dynamic routes plugin overhaul#4525
brc-dd merged 27 commits intomainfrom
fix/vite-6

Conversation

@brc-dd
Copy link
Member

@brc-dd brc-dd commented Jan 27, 2025

TODO:

  • Review handleHotUpdate code across codebase. Migrate to hotUpdate if needed. Avoid running same hook twice.
    • main plugin
    • hmr fix plugin, fixes markdown snippet changes are not updating the content #4567
    • static data plugin
    • dynamic route plugin -- handle hmr for watch files (track below)
    • local search plugin -- hmr not working (track in separate pr along with other performance fixes and stable index, needs discarding docs from index on deletion/update too)
  • Do full page reload on changes in path and data loader files, and their (transitive) deps. Avoid server restart if possible. Ensure that page data is updated.
    • data loader
    • path loader
      • (transitive) deps
      • watched files -- track below
      • page data -- track below
  • Allow specifying deps for path loaders - fixes When using "Dynamic Routes" to render raw content, how to keep hot reload working. #4569, fixes Watch files in Path Loader #3937
    • basic implementation
    • cache invalidation and hmr
  • fixes [Dynamic Routes]: Add transformPageData configure #2637
    • basic implementation
    • cache invalidation and hmr (route data of dynamic routes isn't updated on hmr, it doesn't pass through the core plugin's handleHotUpdate since the files are virtual)
  • out of sync maps in createMarkdownToVueRenderFn (c2ab5b0 didn't fix that because pages are later mapped inside that function)
  • import.meta.hot now accepts id instead of url. Fix those.
  • Don't use stale cache after full server restart. (Ensure it's always cleared/re-created.) (9f54714)
  • Export type helper fn for path loader.
  • Add e2e tests for hmr.
  • Update docs.

@brc-dd brc-dd marked this pull request as draft January 27, 2025 11:10
@brc-dd brc-dd changed the title fix: hmr not working in dynamic routes plugin fix: dynamic routes plugin overhaul Jan 27, 2025
@brc-dd brc-dd added the build Related to the build system label Jan 27, 2025
@brc-dd brc-dd self-assigned this Jan 27, 2025
@brc-dd brc-dd marked this pull request as ready for review February 24, 2025 19:53
@brc-dd brc-dd changed the title fix: dynamic routes plugin overhaul feat!: dynamic routes plugin overhaul Feb 24, 2025
@brc-dd brc-dd merged commit a62ea6a into main Feb 24, 2025
10 checks passed
@brc-dd brc-dd deleted the fix/vite-6 branch February 24, 2025 20:01
brc-dd added a commit that referenced this pull request Feb 27, 2025
brc-dd added a commit that referenced this pull request Feb 27, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

build Related to the build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown snippet changes are not updating the content Watch files in Path Loader [Dynamic Routes]: Add transformPageData configure

1 participant