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: Astro support #21

Closed

Conversation

feugy
Copy link
Member

@feugy feugy commented Dec 4, 2023

📓 What's in there?

This PR brings Astro first-class support with a dedicated component.

🧪 How to test?

There's a new example application.

  1. build your package locally pnpm -F @vercel/speed-insights build
  2. get new deps pnpm i
  3. edit the example app, to see it sending metrics to the production intake (will 404 because of the lack or route, but you'll see the payloads): edit apps/astro/src/components/BaseHead.astro to add <SpeedInsights scriptSrc="https://va.vercel-scripts.com/v1/speed-insights/script.js">
  4. run the app: cd apps/astro && pnpm dev
  5. visit localhost:4321 with your dev tools open and see the reports with correct framework name and route.

❗ Notes to reviewers

This component is one-of-its-kind: we don't want to bundle it with tsup like for Vue, Sveltekit, React or Next.
Astro will care of packaging it when it'll bundle the customer's astro app.

So this index.astro file is copied after running tsup directly into dist/

This is draft until we find a way to pass beforeSend to injectSpeedInsights() utility

@feugy feugy requested a review from a team December 4, 2023 16:19
Copy link

linear bot commented Dec 4, 2023

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
speed-insights-nextjs ❌ Failed (Inspect) Dec 6, 2023 6:02pm
speed-insights-nuxt ❌ Failed (Inspect) Dec 6, 2023 6:02pm
speed-insights-remix ❌ Failed (Inspect) Dec 6, 2023 6:02pm
speed-insights-sveltekit ❌ Failed (Inspect) Dec 6, 2023 6:02pm
speed-insights-vue ❌ Failed (Inspect) Dec 6, 2023 6:02pm

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.

3 participants