Skip to content

feat: bundle the Vercel Edge Middleware function#7492

Merged
ematipico merged 9 commits intofeat/vercel-edge-middlewarefrom
feat/vercel/create-edge-function-plt-575
Jun 28, 2023
Merged

feat: bundle the Vercel Edge Middleware function#7492
ematipico merged 9 commits intofeat/vercel-edge-middlewarefrom
feat/vercel/create-edge-function-plt-575

Conversation

@ematipico
Copy link
Copy Markdown
Member

@ematipico ematipico commented Jun 27, 2023

Changes

This PR adds logic to create the real Vercel Edge Middleware file. Check the documentation.

The content of the function will be something like this (this is pseudo code, but almost like the real deal):

import { onRequest } from './dist/middleware.hash.js';
import { createAPIContext } from 'astro/whatever';

export default async function middleware(request) {
  const url = new URL(request.url);

 const next = async () => {
 	const response = await fetch(url, {
 		headers: {
 			"x-astro-locals": serializeLocals(ctx.locals)
 		}
 	});
 	return response;
 };

  const ctx = createAPIContext(request, whateverElse);

  return onRequest(ctx, next);
}

The first import is the Astro Middleware.
The second import is something we don't have yet, but we will be required to call onRequest. As you can see, the next function is where we pass the locals, serialize them and contact the "origin server" (the actual lambda that renders the page).

As for now, locals are not part of this PR. The only goal is the creation of the middeware.js file, bundled via esbuild.

Talking with @matthewp , we moved middlewareEntryPoint from astro:build:done to astro:build:ssr. We agreed that this information belongs to SSR, like entryPoints.

Testing

I created a test case to check if the file emitted exists.
I also manually tested using a pet project.

Docs

Still early

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jun 27, 2023

🦋 Changeset detected

Latest commit: 3ec8bb0

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 pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) labels Jun 27, 2023
@ematipico ematipico force-pushed the feat/vercel/create-edge-function-plt-575 branch from 24ccaa7 to 06afd39 Compare June 27, 2023 11:58
@ematipico
Copy link
Copy Markdown
Member Author

!preview vercel-edge-middleware

@github-actions
Copy link
Copy Markdown
Contributor

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--vercel-edge-middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/underscore-redirects, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 31 packages�[0m �[2m• Remote caching enabled�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing logs �[2m22131898d4fb04cf�[0m �[33mcreate-astro:build: �[0mcache hit, suppressing logs �[2m8923896110073887�[0m �[32m@astrojs/telemetry:build: �[0mcache hit, suppressing logs �[2md5b919ea2e9792d8�[0m �[34m@astrojs/prism:build: �[0mcache hit, suppressing logs �[2me3cea146b484afb4�[0m �[36m@astrojs/internal-helpers:build: �[0mcache hit, suppressing logs �[2md6861eb4a622af5f�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing logs �[2m7f2fac8775910a9f�[0m �[32mastro:build: �[0mcache miss, executing �[2m39d3a7cf1224eebc�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627120036 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627120036 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627120036 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[33m@astrojs/react:build: �[0mcache miss, executing �[2m5cad66b2be1a811b�[0m �[36m@benchmark/timer:build: �[0mcache miss, executing �[2maf46e0f0a8d61c53�[0m �[32m@astrojs/preact:build: �[0mcache miss, executing �[2mc3e8918151af9f0a�[0m �[34m@astrojs/mdx:build: �[0mcache miss, executing �[2ma627f894450b45c5�[0m �[35m@astrojs/alpinejs:build: �[0mcache miss, executing �[2m176ec09d871e788d�[0m �[34m@astrojs/deno:build: �[0mcache miss, executing �[2m8ad88f0bae61b6ed�[0m �[35m@astrojs/rss:build: �[0mcache miss, executing �[2mf0ef4a83c0c66a2a�[0m �[33m@astrojs/underscore-redirects:build: �[0mcache miss, executing �[2m3e624fabf215fd10�[0m �[36m@astrojs/lit:build: �[0mcache miss, executing �[2m029c359696a83c60�[0m �[32m@astrojs/svelte:build: �[0mcache miss, executing �[2m443cb0bc1a690bb7�[0m �[33m@astrojs/react:build: �[0m �[33m@astrojs/react:build: �[0m> @astrojs/react@2.2.1 build /home/runner/work/astro/astro/packages/integrations/react �[33m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/react:build: �[0m �[35m@astrojs/rss:build: �[0m �[35m@astrojs/rss:build: �[0m> @astrojs/rss@2.4.3 build /home/runner/work/astro/astro/packages/astro-rss �[35m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/rss:build: �[0m �[34m@astrojs/mdx:build: �[0m �[34m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.19.7 build /home/runner/work/astro/astro/packages/integrations/mdx �[34m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/mdx:build: �[0m �[35m@astrojs/alpinejs:build: �[0m �[35m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.2 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[35m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/alpinejs:build: �[0m �[32m@astrojs/preact:build: �[0m �[32m@astrojs/preact:build: �[0m> @astrojs/preact@2.2.1 build /home/runner/work/astro/astro/packages/integrations/preact �[32m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/preact:build: �[0m �[36m@benchmark/timer:build: �[0m �[36m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[36m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@benchmark/timer:build: �[0m �[36m@astrojs/lit:build: �[0m �[36m@astrojs/lit:build: �[0m> @astrojs/lit@2.1.0 build /home/runner/work/astro/astro/packages/integrations/lit �[36m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/lit:build: �[0m �[34m@astrojs/deno:build: �[0m �[34m@astrojs/deno:build: �[0m> @astrojs/deno@4.2.0 build /home/runner/work/astro/astro/packages/integrations/deno �[34m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/deno:build: �[0m �[32m@astrojs/svelte:build: �[0m �[32m@astrojs/svelte:build: �[0m> @astrojs/svelte@3.0.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[32m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[32m@astrojs/svelte:build: �[0m �[33m@astrojs/underscore-redirects:build: �[0m �[33m@astrojs/underscore-redirects:build: �[0m> @astrojs/underscore-redirects@0.1.0 build /home/runner/work/astro/astro/packages/underscore-redirects �[33m@astrojs/underscore-redirects:build: �[0m> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json �[33m@astrojs/underscore-redirects:build: �[0m �[33m@astrojs/vue:build: �[0mcache miss, executing �[2m8c9a545b92f1faf9�[0m �[34m@astrojs/partytown:build: �[0mcache miss, executing �[2m6e9f6fc39554ce48�[0m �[36m@astrojs/markdoc:build: �[0mcache miss, executing �[2m3dac9ca0c686773e�[0m �[35m@astrojs/vercel:build: �[0mcache miss, executing �[2m61eb55a90e727233�[0m �[32m@astrojs/image:build: �[0mcache miss, executing �[2me41f4258fa652641�[0m �[33m@astrojs/prefetch:build: �[0mcache miss, executing �[2mbcc33cd774f4fec9�[0m �[34m@astrojs/tailwind:build: �[0mcache miss, executing �[2mbf0c25e8bf2e4854�[0m �[33m@astrojs/vue:build: �[0m �[33m@astrojs/vue:build: �[0m> @astrojs/vue@2.2.1 build /home/runner/work/astro/astro/packages/integrations/vue �[33m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[33m@astrojs/vue:build: �[0m �[35m@astrojs/solid-js:build: �[0mcache miss, executing �[2m3b9b88cca4a4a416�[0m �[36m@astrojs/node:build: �[0mcache miss, executing �[2m5154dc71bb7950e9�[0m �[34m@astrojs/partytown:build: �[0m �[34m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.3 build /home/runner/work/astro/astro/packages/integrations/partytown �[34m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/partytown:build: �[0m �[36m@astrojs/markdoc:build: �[0m �[36m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.3.3 build /home/runner/work/astro/astro/packages/integrations/markdoc �[36m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/markdoc:build: �[0m �[35m@astrojs/vercel:build: �[0m �[35m@astrojs/vercel:build: �[0m> @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627120036 build /home/runner/work/astro/astro/packages/integrations/vercel �[35m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/vercel:build: �[0m �[32m@astrojs/image:build: �[0m �[32m@astrojs/image:build: �[0m> @astrojs/image@0.17.1 build /home/runner/work/astro/astro/packages/integrations/image �[32m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/image:build: �[0m �[33m@astrojs/prefetch:build: �[0m �[33m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.3 build /home/runner/work/astro/astro/packages/integrations/prefetch �[33m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/prefetch:build: �[0m �[32m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m185cb15b0afec8e8�[0m �[34m@astrojs/tailwind:build: �[0m �[34m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@4.0.0 build /home/runner/work/astro/astro/packages/integrations/tailwind �[34m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/tailwind:build: �[0m �[35m@astrojs/solid-js:build: �[0m �[35m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.2.0 build /home/runner/work/astro/astro/packages/integrations/solid �[35m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/solid-js:build: �[0m �[36m@astrojs/node:build: �[0m �[36m@astrojs/node:build: �[0m> @astrojs/node@5.3.0 build /home/runner/work/astro/astro/packages/integrations/node �[36m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/node:build: �[0m �[32m@astrojs/turbolinks:build: �[0m �[32m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.2 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[32m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/turbolinks:build: �[0m �[33m@astrojs/netlify:build: �[0mcache miss, executing �[2maa1417f45ca20518�[0m �[34m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m756548f8868169f5�[0m �[33m@astrojs/netlify:build: �[0m �[33m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.3.0 build /home/runner/work/astro/astro/packages/integrations/netlify �[33m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/netlify:build: �[0m �[34m@astrojs/cloudflare:build: �[0m �[34m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.5.1 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[34m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/cloudflare:build: �[0m �[36m@astrojs/sitemap:build: �[0mcache miss, executing �[2m8beb0c9a48dd3873�[0m �[36m@astrojs/sitemap:build: �[0m �[36m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.3.3 build /home/runner/work/astro/astro/packages/integrations/sitemap �[36m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/sitemap:build: �[0m Tasks: 30 successful, 30 total Cached: 6 cached, 30 total Time: 1m45.162s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--vercel-edge-middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/internal-helpers 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/underscore-redirects 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-vercel-edge-middleware-20230627120036) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.4.3 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.8 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.5.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/image is not being published because version 0.17.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.19.7 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 4.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.2 is already published on npm 🦋 �[36minfo�[39m @astrojs/vercel is being published because our local version (0.0.0-vercel-edge-middleware-20230627120036) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/internal-helpers is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.5 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/underscore-redirects is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.2.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-vercel-edge-middleware-20230627120036"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vercel"�[39m at �[32m"0.0.0-vercel-edge-middleware-20230627120036"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-vercel-edge-middleware-20230627120036 🦋 @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627120036 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-vercel-edge-middleware-20230627120036 🦋 New tag: @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627120036

@ematipico
Copy link
Copy Markdown
Member Author

!preview vercel-edge-middleware

@github-actions
Copy link
Copy Markdown
Contributor

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--vercel-edge-middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/underscore-redirects, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 31 packages�[0m �[2m• Remote caching enabled�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing logs �[2m22131898d4fb04cf�[0m �[32m@astrojs/telemetry:build: �[0mcache hit, suppressing logs �[2md5b919ea2e9792d8�[0m �[34m@astrojs/internal-helpers:build: �[0mcache hit, suppressing logs �[2md6861eb4a622af5f�[0m �[33mcreate-astro:build: �[0mcache hit, suppressing logs �[2m8923896110073887�[0m �[36m@astrojs/prism:build: �[0mcache hit, suppressing logs �[2me3cea146b484afb4�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing logs �[2m7f2fac8775910a9f�[0m �[32mastro:build: �[0mcache miss, executing �[2m1b57f0211e8b3e7b�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627124653 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627124653 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-vercel-edge-middleware-20230627124653 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[36m@astrojs/svelte:build: �[0mcache miss, executing �[2m866d26f731022b60�[0m �[32m@astrojs/vue:build: �[0mcache miss, executing �[2m9c3e4df5c39ff5f6�[0m �[33m@astrojs/lit:build: �[0mcache miss, executing �[2mcd09b48f5bd4dbb0�[0m �[34m@astrojs/underscore-redirects:build: �[0mcache miss, executing �[2m226c4b3ee82323a7�[0m �[35m@astrojs/rss:build: �[0mcache miss, executing �[2ma0ff103699087278�[0m �[34m@astrojs/image:build: �[0mcache miss, executing �[2m0afe11c7d971d74f�[0m �[33m@astrojs/solid-js:build: �[0mcache miss, executing �[2m125c2821eced96a5�[0m �[35m@astrojs/partytown:build: �[0mcache miss, executing �[2m14a0034a908fdcbc�[0m �[36m@astrojs/preact:build: �[0mcache miss, executing �[2m424c4855e1f3eccb�[0m �[32m@astrojs/prefetch:build: �[0mcache miss, executing �[2m0692227f94f181b9�[0m �[32m@astrojs/vue:build: �[0m �[32m@astrojs/vue:build: �[0m> @astrojs/vue@2.2.1 build /home/runner/work/astro/astro/packages/integrations/vue �[32m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[32m@astrojs/vue:build: �[0m �[33m@astrojs/lit:build: �[0m �[33m@astrojs/lit:build: �[0m> @astrojs/lit@2.1.0 build /home/runner/work/astro/astro/packages/integrations/lit �[33m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/lit:build: �[0m �[36m@astrojs/svelte:build: �[0m �[36m@astrojs/svelte:build: �[0m> @astrojs/svelte@3.0.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[36m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[36m@astrojs/svelte:build: �[0m �[35m@astrojs/rss:build: �[0m �[35m@astrojs/rss:build: �[0m> @astrojs/rss@2.4.3 build /home/runner/work/astro/astro/packages/astro-rss �[35m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/rss:build: �[0m �[34m@astrojs/underscore-redirects:build: �[0m �[34m@astrojs/underscore-redirects:build: �[0m> @astrojs/underscore-redirects@0.1.0 build /home/runner/work/astro/astro/packages/underscore-redirects �[34m@astrojs/underscore-redirects:build: �[0m> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json �[34m@astrojs/underscore-redirects:build: �[0m �[34m@astrojs/image:build: �[0m �[34m@astrojs/image:build: �[0m> @astrojs/image@0.17.1 build /home/runner/work/astro/astro/packages/integrations/image �[34m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/image:build: �[0m �[33m@astrojs/solid-js:build: �[0m �[33m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.2.0 build /home/runner/work/astro/astro/packages/integrations/solid �[33m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/solid-js:build: �[0m �[36m@astrojs/preact:build: �[0m �[36m@astrojs/preact:build: �[0m> @astrojs/preact@2.2.1 build /home/runner/work/astro/astro/packages/integrations/preact �[36m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/preact:build: �[0m �[32m@astrojs/prefetch:build: �[0m �[32m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.3 build /home/runner/work/astro/astro/packages/integrations/prefetch �[32m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/prefetch:build: �[0m �[35m@astrojs/partytown:build: �[0m �[35m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.3 build /home/runner/work/astro/astro/packages/integrations/partytown �[35m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/partytown:build: �[0m �[33m@astrojs/alpinejs:build: �[0mcache miss, executing �[2ma2021b9d50ff5573�[0m �[34m@astrojs/tailwind:build: �[0mcache miss, executing �[2m1bac6b38a834938d�[0m �[36m@astrojs/markdoc:build: �[0mcache miss, executing �[2m6c3e55b3535580ce�[0m �[35m@astrojs/mdx:build: �[0mcache miss, executing �[2m8142d17facfbea20�[0m �[32m@astrojs/vercel:build: �[0mcache miss, executing �[2me8484cc0392e7b02�[0m �[33m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m53078bd79624c8c7�[0m �[34m@astrojs/deno:build: �[0mcache miss, executing �[2m0d570231a88079ba�[0m �[36m@astrojs/react:build: �[0mcache miss, executing �[2m02b6dd72ee847474�[0m �[33m@astrojs/alpinejs:build: �[0m �[33m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.2 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[33m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/alpinejs:build: �[0m �[34m@astrojs/tailwind:build: �[0m �[34m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@4.0.0 build /home/runner/work/astro/astro/packages/integrations/tailwind �[34m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/tailwind:build: �[0m �[36m@astrojs/markdoc:build: �[0m �[36m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.3.3 build /home/runner/work/astro/astro/packages/integrations/markdoc �[36m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/markdoc:build: �[0m �[35m@astrojs/mdx:build: �[0m �[35m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.19.7 build /home/runner/work/astro/astro/packages/integrations/mdx �[35m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/mdx:build: �[0m �[35m@astrojs/node:build: �[0mcache miss, executing �[2m0907bc9445186f86�[0m �[32m@astrojs/vercel:build: �[0m �[32m@astrojs/vercel:build: �[0m> @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627124653 build /home/runner/work/astro/astro/packages/integrations/vercel �[32m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/vercel:build: �[0m �[33m@astrojs/turbolinks:build: �[0m �[33m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.2 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[33m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/turbolinks:build: �[0m �[34m@astrojs/deno:build: �[0m �[34m@astrojs/deno:build: �[0m> @astrojs/deno@4.2.0 build /home/runner/work/astro/astro/packages/integrations/deno �[34m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/deno:build: �[0m �[36m@astrojs/react:build: �[0m �[36m@astrojs/react:build: �[0m> @astrojs/react@2.2.1 build /home/runner/work/astro/astro/packages/integrations/react �[36m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/react:build: �[0m �[35m@astrojs/node:build: �[0m �[35m@astrojs/node:build: �[0m> @astrojs/node@5.3.0 build /home/runner/work/astro/astro/packages/integrations/node �[35m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/node:build: �[0m �[32m@benchmark/timer:build: �[0mcache miss, executing �[2m38312ce0ae9c232b�[0m �[33m@astrojs/netlify:build: �[0mcache miss, executing �[2m8d340f9d506d76cb�[0m �[34m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m747a5f76c21e6e1d�[0m �[32m@benchmark/timer:build: �[0m �[32m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[32m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@benchmark/timer:build: �[0m �[33m@astrojs/netlify:build: �[0m �[33m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.3.0 build /home/runner/work/astro/astro/packages/integrations/netlify �[33m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/netlify:build: �[0m �[34m@astrojs/cloudflare:build: �[0m �[34m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.5.1 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[34m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/cloudflare:build: �[0m �[36m@astrojs/sitemap:build: �[0mcache miss, executing �[2mc08334d24993055f�[0m �[36m@astrojs/sitemap:build: �[0m �[36m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.3.3 build /home/runner/work/astro/astro/packages/integrations/sitemap �[36m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/sitemap:build: �[0m Tasks: 30 successful, 30 total Cached: 6 cached, 30 total Time: 1m26.783s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--vercel-edge-middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/internal-helpers 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/underscore-redirects 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-vercel-edge-middleware-20230627124653) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.4.3 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.8 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.5.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/image is not being published because version 0.17.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.19.7 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 4.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.2 is already published on npm 🦋 �[36minfo�[39m @astrojs/vercel is being published because our local version (0.0.0-vercel-edge-middleware-20230627124653) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/internal-helpers is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.5 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/underscore-redirects is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.2.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-vercel-edge-middleware-20230627124653"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vercel"�[39m at �[32m"0.0.0-vercel-edge-middleware-20230627124653"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-vercel-edge-middleware-20230627124653 🦋 @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627124653 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-vercel-edge-middleware-20230627124653 🦋 New tag: @astrojs/vercel@0.0.0-vercel-edge-middleware-20230627124653

@ematipico
Copy link
Copy Markdown
Member Author

I just tried the preview release in a pet project. I tracked a minor bug, which I fixed in the last commit. After the fix, I could see the bundled middleware.js.

The code contains the business logic of the astro middleware, plus some imported code because astro/middleware doesn't export a createAPIContext function, which will be done in a separate PR.

@ematipico ematipico marked this pull request as ready for review June 27, 2023 13:19
@ematipico ematipico requested a review from a team as a code owner June 27, 2023 13:26
@ematipico ematipico force-pushed the feat/vercel/create-edge-function-plt-575 branch from dd8e2f3 to 0c8b15b Compare June 27, 2023 13:34
@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label Jun 27, 2023
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@ematipico ematipico force-pushed the feat/vercel/create-edge-function-plt-575 branch from 0c8b15b to a89db6e Compare June 27, 2023 13:42
@ematipico ematipico requested a review from matthewp June 27, 2023 13:42
@ematipico ematipico requested review from bluwy and matthewp June 28, 2023 14:45
@ematipico ematipico force-pushed the feat/vercel/create-edge-function-plt-575 branch from cf2882d to 3ec8bb0 Compare June 28, 2023 14:49
@ematipico
Copy link
Copy Markdown
Member Author

I am going to merge it. The test fail is not related to my changes. Feel free to leave more feedback and I will address it in the next PR.

@ematipico ematipico merged commit 37aef59 into feat/vercel-edge-middleware Jun 28, 2023
@ematipico ematipico deleted the feat/vercel/create-edge-function-plt-575 branch June 28, 2023 15:00
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) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants