Commit graph

205 commits

Author SHA1 Message Date
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
Houston (Bot)
c64dfdd3d8
[ci] release (#7254)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-02 10:51:28 -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
Houston (Bot)
ba865f5d64
[ci] release (#7190)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-30 16:53:55 -04:00
Erika
f5a8cffac2
fix(vercel): Fix typo in README 🤦‍♀️ (#7208) 2023-05-25 14:59:25 +02:00
Houston (Bot)
55a0439e00
[ci] release (#7181)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-23 16:24:16 -04:00
Houston (Bot)
cbdb0fdbd6
[ci] release (#7169)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-23 11:06:53 -04:00
Houston (Bot)
64d2aba583
[ci] release (#7163)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-22 15:16:13 -04:00
Houston (Bot)
d880293f79
[ci] release (#7161)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-22 09:48:21 -04:00
Houston (Bot)
0616ef2551
[ci] release (#7130)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-21 00:00:31 +08:00
Houston (Bot)
31cbf4357e
[ci] release (#7090)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-18 12:31:59 -04: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
826e028900
Add files field to packages (#7104) 2023-05-17 16:54:00 +08: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
Houston (Bot)
0fc026f63c
[ci] release (#7065)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-11 15:14:17 -04:00
Houston (Bot)
a44e755cc6
[ci] release (#7043)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-09 17:37:15 -04:00
Houston (Bot)
e54dcd5943
[ci] release (#7037)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-08 13:17:09 -04:00
Houston (Bot)
50bf66e4df
[ci] release (#7005)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-05 13:23:18 -04:00
Houston (Bot)
170140083c
[ci] release (#6996)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-04 16:19:01 -04:00
Houston (Bot)
51c8e7fe29
[ci] release (#6977)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-04 12:49:17 -04:00
Houston (Bot)
297a1dae51
[ci] release (#6954)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-02 15:13:10 -04: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
Houston (Bot)
d0cf3a2c01
[ci] release (#6924)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-01 10:58:03 -04:00
Houston (Bot)
06c527330a
[ci] release (#6914)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-27 22:12:14 +08:00
Houston (Bot)
c6f1264586
[ci] release (#6863)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-25 22:48:36 +08:00
Nathaniel Blackburn
43230b2cac
Align adapter setup (#6874) 2023-04-19 09:36:46 +02:00
Houston (Bot)
763b7500e5
[ci] release (#6842)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-14 12:11:17 -04:00
Bjorn Lu
2e3125e180
Fix vercel edge private env vars (#6841) 2023-04-14 21:46:24 +08:00
Chris Swithinbank
00a2e1d7c7
Fix warning syntax in Vercel integration README (#6840) 2023-04-14 12:08:31 +02:00
Houston (Bot)
b105ccb9ca
[ci] release (#6835)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-13 14:41:56 -04:00
Ivo Ilić
c1e8f42a20
Added a caution about rewrites only working for static files (#6517)
Currently using rewrite with static files works but server rendered files with either edge or serverless function don't get rewritten.
See: https://github.com/withastro/astro/issues/6446
2023-04-12 14:21:59 -04:00
Houston (Bot)
b2254bd786
[ci] release (#6818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-12 08:51:55 -04:00
Houston (Bot)
b1d07bcf40
[ci] release (#6809)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-11 13:10:00 -04:00
Houston (Bot)
a5601a3cd3
[ci] release (#6807)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-10 16:57:31 +08:00
Nathaniel Blackburn
84a4648884
Revert vercel env fix (#6776) 2023-04-10 16:40:29 +08:00
Houston (Bot)
d531239201
[ci] release (#6769)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-07 17:25:00 -04:00
Houston (Bot)
29e7b82b8d
[ci] release (#6720)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-05 13:38:45 -04: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
Houston (Bot)
07e8a1bab4
[ci] release (#6694)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-31 16:32:28 +02:00
Houston (Bot)
af108e4b4a
[ci] release (#6652)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-28 13:17:46 -04:00
Houston (Bot)
12d42f47bd
[ci] release (#6646)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-24 13:17:01 -04:00
Houston (Bot)
dfbd09b711
[ci] release (#6634)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-24 13:49:12 +08:00
Houston (Bot)
66e006028c
[ci] release (#6612)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-22 20:53:15 +08:00
Houston (Bot)
6afb1efea8
[ci] release (#6541)
* [ci] release

* nit: typo in #6594 changeset

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-03-21 08:03:46 -04:00
Houston (Bot)
43daac7a9b
[ci] release (#6476)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-13 16:05:43 -04:00