Commit graph

79 commits

Author SHA1 Message Date
matthewp
7ae6e89292 [ci] format 2023-06-29 20:21:41 +00:00
Matthew Phillips
154af8f5ea
Split support in the Vercel Serverless adapter (#7514)
* start of vercel split support

* Split Mode with the Vercel Adapter

* Write routes into the config.json

* Add a changeset

* Add docs

* Better changeset
2023-06-29 16:18:28 -04:00
Bjorn Lu
32bde967f4
Fix vercel redirects with trailingSlash always (#7447) 2023-06-22 23:40:08 +08:00
Nate Moore
39403c32fa
Unflag hybrid output (#7260)
* feat(hybrid): unflag hybrid output

* chore: cleanup rebase errors
2023-06-05 13:19:15 -05:00
matthewp
eb459577f0 [ci] format 2023-06-05 13:05:47 +00:00
Matthew Phillips
57f8d14c02
Redirects (#7067)
* Redirects spike

* Allow redirects in static mode

* Support in Netlify as well

* Adding a changeset

* Rename file

* Fix build problem

* Refactor to be more modular

* Fix location ref

* Late test should only run in SSR

* Support redirects in Netlify SSR configuration (#7167)

* Implement support for dynamic routes in redirects (#7173)

* Implement support for dynamic routes in redirects

* Remove the .only

* No need to special-case redirects in static build

* Implement support for redirects config in the Vercel adapter (#7182)

* Implement support for redirects config in the Vercel adapter

* Remove unused condition

* Move to a internal helper package

* Add support for the object notation in redirects

* Use status 308 for non-GET redirects (#7186)

* Implement redirects in Cloudflare (#7198)

* Implement redirects in Cloudflare

* Fix build

* Update tests b/c of new ordering

* Debug issue

* Use posix.join

* Update packages/underscore-redirects/package.json

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Update based on review comments

* Update broken test

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Test that redirects can come from middleware (#7213)

* Test that redirects can come from middleware

* Allow non-promise returns for middleware

* Implement priority (#7210)

* Refactor

* Fix netlify test ordering

* Fix ordering again

* Redirects: Allow preventing the output of the static HTML file (#7245)

* Do a simple push for priority

* Adding changesets

* Put the implementation behind a flag.

* Self review

* Update .changeset/chatty-actors-stare.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update docs on dynamic restrictions.

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Code review changes

* Document netlify static adapter

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Slight reword

* Update .changeset/twenty-suns-vanish.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Add a note about public/_redirects file

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-05 09:03:20 -04:00
Nate Moore
e0ca0d8c8a
Revert "feat(hybrid): unflag hybrid output (#7255)" (#7259)
This reverts commit bc5d6ed39f.
2023-05-31 12:06:24 -05:00
Nate Moore
bc5d6ed39f
feat(hybrid): unflag hybrid output (#7255) 2023-05-31 11:47:25 -05:00
matthewp
5c3c672d26 [ci] format 2023-05-17 13:26:03 +00:00
Happydev
719002ca5b
feat: hybrid output (#6991)
* update config schema

* adapt default route `prerender` value

* adapt error message for hybrid output

* core hybrid output support

* add JSDocs for hybrid output

* dev server hybrid output support

* defer hybrid output check

* update endpoint request warning

* support `output=hybrid` in integrations

* put constant variable out of for loop

* revert: reapply back ssr plugin in ssr mode

* change `prerender` option default

* apply `prerender` by default in hybrid mode

* simplfy conditional

* update config schema

* add `isHybridOutput` helper

* more readable prerender condition

* set default prerender value if no export is found

* only add `pagesVirtualModuleId` ro rollup input in `output=static`

* don't export vite plugin

* remove unneeded check

* don't prerender when it shouldn't

* extract fallback `prerender` meta

Extract the fallback `prerender` module meta out of the `scan` function.
It shouldn't be its responsibility to handle that

* pass missing argument to function

* test: update cloudflare integration tests

* test: update tests of vercel integration

* test: update tests of node integration

* test: update tests of netlify func integration

* test: update tests of netlify edge integration

* throw when `hybrid` mode is malconfigured

* update node integraiton `output` warning

* test(WIP): skip node prerendering tests for now

* remove non-existant import

* test: bring back prerendering tests

* remove outdated comments

* test: refactor test to support windows paths

* remove outdated comments

* apply sarah review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* docs: `experiment.hybridOutput` jsodcs

* test: prevent import from being cached

* refactor: extract hybrid output check to  function

* add `hybrid` to output warning in adapter hooks

* chore: changeset

* add `.js` extension to import

* chore: use spaces instead of tabs for gh formating

* resolve merge conflict

* chore: move test to another file for consitency

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-05-17 09:23:20 -04:00
Bjorn Lu
c91e837e96
Add edge-light and worker to vercel edge bundling (#7103) 2023-05-17 09:06:18 -04:00
Bjorn Lu
2994bc52d3
Build edge/worker runtime with webworker ssr target (#7101) 2023-05-17 15:44:20 +08:00
bluwy
c6b0a6982a [ci] format 2023-05-15 06:16:32 +00:00
Nathaniel Blackburn
06ca3702f8
Inject analytics env (#6876) 2023-05-15 14:13:47 +08:00
Erika
6063f56573
feat(vercel): Add support for image optimization API (#6845)
* feat(vercel): Add support for image optimization API

* chore: changeset

* feat: implement image service

* feat: dev service

* feat: full local service

* fix: move assets check to astro:config:done

* feat: update with new settings

* fix: remove unused param

* test: add tsets

* fix: rename to imageService

* docs: add docs

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* docs(vercel): Add Added In mentions

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-02 09:42:48 +02:00
Nathaniel Blackburn
43230b2cac
Align adapter setup (#6874) 2023-04-19 09:36:46 +02:00
Bjorn Lu
2e3125e180
Fix vercel edge private env vars (#6841) 2023-04-14 21:46:24 +08:00
Nathaniel Blackburn
84a4648884
Revert vercel env fix (#6776) 2023-04-10 16:40:29 +08:00
Nathaniel Blackburn
26daba8d9f
@astrojs/vercel: Fix vercel analytics id not being provided (#6751)
* fix wrong environment variable being used

* added changeset
2023-04-05 09:23:40 -04:00
Matthew Phillips
700a555499
Add back support for Astro.clientAddress to Vercel serverless (#6484) 2023-03-09 11:27:16 -05:00
Juan Martín Seery
0e378c3b87
fix(vercel): update getRequest to use undici (#6380)
* fix(vercel): update getRequest to use undici

* Changeset

* haha ts-expect-error is a double-edged sword

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-03-01 19:00:52 +00:00
Bjorn Lu
2eb73cb9d1
Use .mjs extension when building for netlify edge and vercel serverless (#6317) 2023-02-21 22:14:47 +08:00
Chris Swithinbank
0fe74b6648
Only inject Vercel analytics in production (#6258)
* Only inject Vercel analytics in production

* Add changeset
2023-02-16 09:19:08 -06:00
Justin Sun
23c60cfa45
feat(vercel): Add support for analytics (Audiences & Web Vitals) (#6148)
* feat(intergration/vercel): add vercel analytics support

* docs(intergration/vercel): add vercel analytics prop

* docs(intergration/vercel): bump version to 3.1.0

* Update packages/integrations/vercel/README.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* docs(intergration/vercel): add file name for example

* feat(intergration/vercel): convert analytics to ts and support in edge

* docs(intergration/vercel): move file names to code blocks as comments

* fix(intergration/vercel): remove unused import

* feat(intergration/vercel): add analytics support to static mode

* chore(intergration/vercel): revert version change

* style(intergration/vercel): add a blank line after astro import

* chore(intergration/vercel): generate file by changeset

* Update .changeset/eighty-bobcats-deliver.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/vercel/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/vercel/src/analytics.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* chore(intergration/vercel): simplify analytics script

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-02-08 13:32:20 -03:00
bholmesdev
c596c6c995 [ci] format 2023-02-01 22:18:03 +00:00
Daniel
b236b5cc8e
fix: solidjs integration for vercel edge build (adopting same mechanics as cloudflare) (#6085)
* fix solidjs integration for vercel deployment

* downgrade change to patch

---------

Co-authored-by: AirBorne04 <>
2023-02-01 17:16:18 -05:00
Erika
1f92d64ea3
Drop Node 14 support (#5782)
* chore: Update engines field

* fix(deps): Remove node-fetch

* feat(polyfills): Remove node-fetch for undici

* feat(webapi): Remove node-fetch from the webapis polyfills for undici

* feat(core): Remove node-fetch for undici in Astro core

* feat(telemetry): Remove node-fetch for undici

* feat(node): Remove node-fetch for undici in node integration

* feat(vercel): Remove node-fetch for undici in Vercel integration

* chore: update lockfile

* chore: update lockfile

* chore: changeset

* fix(set): Fix set directives not streaming correctly on Node 16

* Try another approach

* Debugging

* Debug fetch

* Use global fetch if there is one

* changeset for lit

* Remove web-streams-polyfill

* Remove web-streams-polyfill license note

* Update .changeset/stupid-wolves-explain.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-09 16:59:20 -05:00
Bjorn Lu
5eba34fcc6
Remove deprecated APIs (#5707)
* Remove deprecated Astro globals

* Remove deprecated hook param

* Fix test

* Add changeset

* Add TODO
2023-01-03 14:06:07 -05:00
Andrea De Masi
a467139e16
fix traced warnings from unexpected token (#5638)
* fix traced warnings from unexpected token

* Fixed styling
2022-12-19 15:07:00 -03:00
Juan Martín Seery
4d9ef23b67
fix(vercel): support node-fetch and Node 18 fetch (#5587) 2022-12-12 16:45:57 -03:00
Juan Martín Seery
a1885ea2f5
fix(vercel): Update request-transforms.ts (#5514)
* fix(vercel): Update set-cookie header hanlder

* Update from SvelteKit adapter

* Updated changeset
2022-12-02 20:38:40 -03:00
matthewp
6ff1399e98 [ci] format 2022-11-14 18:44:37 +00:00
Matthew Phillips
ee750087ce
Fix usage of the Image component with the Vercel adapter (#5361)
* Revert "Revert "Allow image-pool to be used as its own Worker (#5317)" (#5360)"

This reverts commit 20e60c6e08.

* Remove special image-pool.js moving around

* Merge in assetIncludes

* changeset

* Copy to chunk folder in SSR too

* Update tidy-shoes-yawn.md
2022-11-14 13:42:35 -05:00
matthewp
ff4f45b8eb [ci] format 2022-10-28 18:50:00 +00:00
Matthew Phillips
070da6a792
Throw error when trying to use the vercel static adapter in server mode (#5241) 2022-10-28 14:48:20 -04:00
Juan Martín Seery
abf41da774
fix(vercel): Include all files inside dist/ instead of only entry.mjs (#5175) 2022-10-24 11:24:52 -03:00
Juan Martín Seery
fad25aef2f
fix(vercel): fixed regression #5120 (#5127) 2022-10-19 14:24:26 -04:00
JuanM04
dd354f83e8 [ci] format 2022-10-14 20:21:16 +00:00
Juan Martín Seery
cd25abae59
feat(vercel): includeFiles and excludeFiles (#5085)
* refactor + include/excludeFiles

* Changeset

* Updated README.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Missing .js

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-10-14 17:19:35 -03:00
Juan Martín Seery
f8198d2502
feat(vercel): Edge improvements (#5086)
* Added error on "output" == "static"

* Minify output

* Changeset
2022-10-14 17:17:13 -03:00
matthewp
575bf9205e [ci] format 2022-10-12 21:27:56 +00:00
Matthew Phillips
e55af8a232
Node.js standalone mode + support for astro preview (#5056)
* wip

* Deprecate buildConfig and move to config.build

* Implement the standalone server

* Stay backwards compat

* Add changesets

* correctly merge URLs

* Get config earlier

* update node tests

* Return the preview server

* update remaining tests

* swap usage and config ordering

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/metal-pumas-walk.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/metal-pumas-walk.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/stupid-points-refuse.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/stupid-points-refuse.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Link to build.server config

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-10-12 17:25:51 -04:00
Juan Martín Seery
c1f991408b
fix(vercel): now works with monorepos (#5033)
* Upgraded nft

* Handle monorepo better

* Changeset

* Fixed common ancestor

* Fixed outdir
2022-10-10 11:37:03 -04:00
matthewp
55a1b5bb58 [ci] format 2022-09-28 20:57:35 +00:00
Matthew Phillips
d3091f89e9
Astro.cookies implementation (#4876)
* Astro.cookies implementation

* Remove unused var

* Fix build

* Add a changesetp

* Remove spoken-word expires
2022-09-28 16:55:27 -04:00
Bjorn Lu
fb91d04a5c
Set SSR target webworker for Vercel edge (#4884) 2022-09-27 08:40:10 -04:00
Juan Martín Seery
16113c3ae2
[vercel] Use Edge Functions instead of Edge Middlewares (#4713)
* Don't use middleware

* changeset

* breaking change
2022-09-12 14:40:48 -04:00
Ben Holmes
7820096e1b
fix: correctly add react-dom alias to Vercel edge (#4421)
* fix: correctly add react-dom alias to vercel edge

* chore: changeset
2022-08-22 11:46:02 -04:00
matthewp
6fa6369678 [ci] format 2022-07-27 15:52:44 +00:00
Matthew Phillips
54b33d50fd
Add errors to cloudflare/vercel adapters when no output config (#4068) 2022-07-27 11:50:48 -04:00