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

feat: route manifest refactor #12597

Merged
merged 24 commits into from
Dec 16, 2024
Merged

Conversation

florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Dec 3, 2024

Changes

  • Fixes an issue where some special routes would not be included early enough in the route manifest, and so not passed to the astro:routes:resolved hook
  • I used this opportunity to refactor some things around default routes

Testing

Docs

N/A

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: e5c769a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 3, 2024
Copy link

codspeed-hq bot commented Dec 3, 2024

CodSpeed Performance Report

Merging #12597 will not alter performance

Comparing feat/route-manifest-refactor (e5c769a) with main (8b1cecd)

Summary

✅ 4 untouched benchmarks

@florian-lefebvre
Copy link
Member Author

/snapshot routemanifest-refactor

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Snapshots have been released for the following packages:

  • astro@experimental--routemanifest-refactor
  • @astrojs/markdown-remark@experimental--routemanifest-refactor
  • @astrojs/markdoc@experimental--routemanifest-refactor
  • @astrojs/mdx@experimental--routemanifest-refactor
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--routemanifest-refactor tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info astro
🦋  info npm info @astrojs/prism
🦋  info npm info @astrojs/rss
🦋  info npm info create-astro
🦋  info npm info @astrojs/db
🦋  info npm info @astrojs/alpinejs
🦋  info npm info @astrojs/markdoc
🦋  info npm info @astrojs/mdx
🦋  info npm info @astrojs/partytown
🦋  info npm info @astrojs/preact
🦋  info npm info @astrojs/react
🦋  info npm info @astrojs/sitemap
🦋  info npm info @astrojs/solid-js
🦋  info npm info @astrojs/svelte
🦋  info npm info @astrojs/tailwind
🦋  info npm info @astrojs/vue
🦋  info npm info @astrojs/web-vitals
🦋  info npm info @astrojs/internal-helpers
🦋  info npm info @astrojs/markdown-remark
🦋  info npm info @astrojs/studio
🦋  info npm info @astrojs/telemetry
🦋  info npm info @astrojs/underscore-redirects
🦋  info npm info @astrojs/upgrade
🦋  info astro is being published because our local version (0.0.0-routemanifest-refactor-20241209145150) has not been published on npm
🦋  warn @astrojs/prism is not being published because version 3.2.0 is already published on npm
🦋  warn @astrojs/rss is not being published because version 4.0.10 is already published on npm
🦋  warn create-astro is not being published because version 4.11.0 is already published on npm
🦋  warn @astrojs/db is not being published because version 0.14.1 is already published on npm
🦋  warn @astrojs/alpinejs is not being published because version 0.4.0 is already published on npm
🦋  info @astrojs/markdoc is being published because our local version (0.0.0-routemanifest-refactor-20241209145150) has not been published on npm
🦋  info @astrojs/mdx is being published because our local version (0.0.0-routemanifest-refactor-20241209145150) has not been published on npm
🦋  warn @astrojs/partytown is not being published because version 2.1.2 is already published on npm
🦋  warn @astrojs/preact is not being published because version 4.0.0 is already published on npm
🦋  warn @astrojs/react is not being published because version 4.0.0 is already published on npm
🦋  warn @astrojs/sitemap is not being published because version 3.2.1 is already published on npm
🦋  warn @astrojs/solid-js is not being published because version 5.0.0 is already published on npm
🦋  warn @astrojs/svelte is not being published because version 7.0.1 is already published on npm
🦋  warn @astrojs/tailwind is not being published because version 5.1.3 is already published on npm
🦋  warn @astrojs/vue is not being published because version 5.0.1 is already published on npm
🦋  warn @astrojs/web-vitals is not being published because version 3.0.1 is already published on npm
🦋  warn @astrojs/internal-helpers is not being published because version 0.4.2 is already published on npm
🦋  info @astrojs/markdown-remark is being published because our local version (0.0.0-routemanifest-refactor-20241209145150) has not been published on npm
🦋  warn @astrojs/studio is not being published because version 0.1.2 is already published on npm
🦋  warn @astrojs/telemetry is not being published because version 3.2.0 is already published on npm
🦋  warn @astrojs/underscore-redirects is not being published because version 0.4.0 is already published on npm
🦋  warn @astrojs/upgrade is not being published because version 0.4.1 is already published on npm
🦋  info Publishing "astro" at "0.0.0-routemanifest-refactor-20241209145150"
🦋  info Publishing "@astrojs/markdoc" at "0.0.0-routemanifest-refactor-20241209145150"
🦋  info Publishing "@astrojs/mdx" at "0.0.0-routemanifest-refactor-20241209145150"
🦋  info Publishing "@astrojs/markdown-remark" at "0.0.0-routemanifest-refactor-20241209145150"
🦋  success packages published successfully:
🦋  [email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  Creating git tags...
🦋  New tag:  [email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
Build Log

> [email protected] build /home/runner/work/astro/astro
> turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*"

• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/db, @astrojs/internal-helpers, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/studio, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/upgrade, @astrojs/vercel, @astrojs/vue, @astrojs/web-vitals, @benchmark/adapter, @benchmark/timer, astro, create-astro
• Running build in 29 packages
• Remote caching enabled
::group::@astrojs/prism:build
cache miss, executing 80300a22a864fd64

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-prism
> astro-scripts build "src/**/*.ts" && tsc -p ./tsconfig.json

::endgroup::
::group::@astrojs/telemetry:build
cache miss, executing 4bb3aed72bfb7af4

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/telemetry
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/internal-helpers:build
cache miss, executing 4e353dde5d140dd6

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/internal-helpers
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/upgrade:build
cache miss, executing c549164b3f9c72e6

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/upgrade
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::create-astro:build
cache miss, executing ad179350359e9899

> [email protected] build /home/runner/work/astro/astro/packages/create-astro
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::@astrojs/markdown-remark:build
cache miss, executing e7d6c2d2d30f5e35

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/markdown/remark
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::astro:build
cache miss, executing cdbf40ae733a6073

> [email protected] build /home/runner/work/astro/astro/packages/astro
> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" --copy-wasm && tsc


> [email protected] prebuild /home/runner/work/astro/astro/packages/astro
> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts"

::endgroup::
::group::@astrojs/studio:build
cache miss, executing 4617db72627e272c

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/studio
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/partytown:build
cache miss, executing 15bb4fb67cc3723d

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/svelte:build
cache miss, executing 8eb75e6e6ef9c83b

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/tailwind:build
cache miss, executing e17fd413b2413714

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/sitemap:build
cache miss, executing b379e77fde88851c

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/react:build
cache miss, executing 1d9ad5f4b3a439b1

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/solid-js:build
cache miss, executing 8fbdfa7f7d82eac9

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/solid
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/mdx:build
cache miss, executing 11cb4cfb582ba438

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/markdoc:build
cache miss, executing ecb8b9c345e253fd

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/markdoc
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/preact:build
cache miss, executing f87e294f09ecb19f

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/preact
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/underscore-redirects:build
cache miss, executing 6c9ad9c517524ebd

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/underscore-redirects
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@benchmark/timer:build
cache miss, executing 175c83060b51b4d1

> @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/timer
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@benchmark/adapter:build
cache miss, executing 0c81666d5d3b8ded

> @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/adapter
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/rss:build
cache miss, executing 90772259921cded0

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/alpinejs:build
cache miss, executing f6f58189136b0b05

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vue:build
cache miss, executing 24da075fc1048902

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/db:build
cache miss, executing 86b1572e31d564c9

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/db
> astro-scripts build "src/**/*.ts" && tsc && pnpm types:virtual


> @astrojs/[email protected] types:virtual /home/runner/work/astro/astro/packages/db
> tsc -p ./tsconfig.virtual.json

::endgroup::
::group::@astrojs/web-vitals:build
cache miss, executing 3316db3294d5a6f4

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/web-vitals
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::

 Tasks:    25 successful, 25 total
Cached:    0 cached, 25 total
  Time:    47.611s 

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

The code looks good to me however the comment that proceeds the use of injectServerIslandRoute is very unclear; maybe it needs some rewording

@florian-lefebvre florian-lefebvre merged commit 564ac6c into main Dec 16, 2024
16 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/route-manifest-refactor branch December 16, 2024 14:52
@astrobot-houston astrobot-houston mentioned this pull request Dec 16, 2024
@AmeerArsala
Copy link

undo this. This PR causes issues with server islands with Cloudflare Pages. There becomes a 405 Method Not Allowed response from wrangler.

@florian-lefebvre
Copy link
Member Author

Downgrade to astro 5.0.5 (make sure to pin the version), there will soon be a PR merged addressing this on the adapters side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants