Commit graph

2130 commits

Author SHA1 Message Date
wulinsheng123
6a5f37a57e
Merge branch 'main' into add-Minification 2023-05-05 09:18:57 +08: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
Erika
71332cf969
fix: move service functions from astro/assets to astro/config so it can be imported (#6995)
* fix: move service functions from astro/assets to astro/config so people can import it

* chore: changeset
2023-05-04 15:57:23 -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
Erika
818252acda
Add caching for optimized images (#6990) 2023-05-04 17:49:55 +02:00
Robin Neal
ca329bbcae
Generate unique ids within each React island (#6976) 2023-05-04 15:23:00 +01:00
Emanuele Stoppa
17c074b202
chore: update middleware changeset (#6986) 2023-05-04 08:03:52 -04:00
wuls
a5369ae504 merge 2023-05-04 18:54:18 +08:00
Arsh
80e3d4d3d0
feature: configuration for css inlining behavior (#6659)
* feature(inline stylesheets): implement as experimental

* test: rename css-inline -> css-import-as-inline

* test(content collections): add de-duplication of css

* test: add new suite for inlineStylesheets configuration

* fix(inline stylesheets): did not act on propagated styles

* hack(inline stylesheets testing): duplicate fixtures

Content collections reuses build data across multiple fixture.builds, even though a configuration change may have changed it.
Duplicating fixtures avoids usage of the stale cache.
https://cdn.discordapp.com/attachments/1039830843440504872/1097795182340092024/Screenshot_87_colored.png

* refactor(css plugin): reduce nesting

* optimization(css rendering): merge <style> tags

Chrome, but not Safari or Firefox, is slower to match rules when they are split across multiple files or style tags.
https://nolanlawson.com/2022/06/22/style-scoping-versus-shadow-dom-which-is-fastest/

Having the abiility to inline stylesheets opens us up to this optimization.
Ideally, it would extend to propagated styles, but that ended up being a rabbit hole.

* typedocs(inlineStylesheets config): ensure consistency

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

* chore(build internals): update comment

* correct minor mistake in test

* test(inline stylesheets): unique package names for duplicate fixtures

* refactor(css build plugin): maps -> records

* refactor(css build plugin): remove use of spread operator

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-03 14:49:06 -04:00
Emanuele Stoppa
831b67cdb8
feat(astro): experimental middleware (#6721)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-03 17:40:47 +01:00
Atila Fassina
ad907196cb
Sitemap: support SSR routes (#6534)
* feat(sitemap): support SSR generated routes

* feat(sitemap): add changeset for SSR support

* refactor: move logic to `astro:build:done`

* generate route to obey `trailingSlash` setting

* add logic to respect "directory" build format

* integration(sitemap): add unit test for ssr support
2023-05-03 12:19:45 -04:00
Bjorn Lu
cac4a321e8
Support <Code inline /> to output inline code (#6959)
* Support `<Code inline />` to output inline code

* Fix typo

* Fix typo again

* Remove expected error

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-05-03 12:15:00 -04:00
Matthew Phillips
0883fd4875
Ensure multiple cookies set in dev result in multiple set-cookie headers (#6973)
* Ensure multiple cookies set in dev result in multiple set-cookie headers

* Adding a changeset

* Try connecting to localhost instead

* use localhost in the Host header

* Use 0.0.0.0

* localhost it is
2023-05-03 11:26:02 -04:00
Matthew Phillips
3326492b94
Implement scopedStyleStrategy (#6771)
* Implement scopedStyleStrategy

* Add changeset

* Update compiler

* Specify the eswalker version

* Update compiler

* Update .changeset/green-cups-hammer.md

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

* Update .changeset/green-cups-hammer.md

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

* 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>

* Update .changeset/green-cups-hammer.md

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

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-03 11:16:03 -04:00
Bjorn Lu
49514e4ce4
Upgrade shiki to v0.14.1 (#6932)
* Upgrade shiki

* Update themes

* Update languages

* Simplify

* Fix compat for other remark code

* Update theme again

* Fix language gen

* Add changeset

* Fix code

* Update test theme colors

* Update changeset

* Fix test again
2023-05-03 11:07:57 -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
Bjorn Lu
77270cc2cd
Avoid removing leading slash for build.assetsPrefix (#6969)
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-05-02 14:13:44 -04:00
Ben Holmes
b5482cee23
Fix: remove odd /1/ check on RSS canonicals (#6970)
* fix: remove odd `/1/` check on RSS canonicals

* chore: changeset
2023-05-02 13:48:44 -04:00
Matthew Phillips
b6797fc858
Update Solid ecosystem package logic to include packages with peerDep… (#6934)
* Update Solid ecosystem package logic to include packages with peerDep of Solid

* Remove solid as a noExternal

* Update the changeset
2023-05-02 13:23:28 -04:00
Bjorn Lu
72c6bf01fe
Fix content render imports flow (#6958) 2023-05-02 23:21:44 +08:00
Bjorn Lu
a8a319aef7
Fix astro-entry error on build with multiple JSX frameworks (#6967) 2023-05-02 23:18:34 +08:00
Erika
a695e44aed
fix(types): Fix getImage type requesting for a second parameter (#6961) 2023-05-02 14:23:37 +02: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
Arsh
367e617761
Make prerendering decision based on PageBuildData instead of BuildInternals (#6956)
* read prerender flag from PageBuildData

* add changeset
2023-05-01 16:15:04 -04:00
Nate Moore
895fa07d8b
fix: inline process.env boolean values (0, 1, false, true) (#6910) 2023-05-01 10:51:47 -05:00
Erika
e5bd084c01
fix: fix sharp semver range to allow for 0.32.0 (#6952)
* fix: fix sharp semver range to allow for 0.3é20

* fix: revert back to 0.31.0
2023-05-01 17:32:50 +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
Chell
50975f2ea3
Fix slot tags uncleaned in HTML String (#6948)
* fix: slot regex

* add slot test

* change set

* add test
2023-05-01 10:49:23 -04:00
Erika
dc062f6695
Upgrade to version 1.0.0 of the language server (#6953) 2023-05-01 16:41:21 +02:00
Chris Swithinbank
a98df9374d
Show injected custom 404 route in dev (#6940)
* Add unit test for injected 404 routes

* Add fixture test for injected 404 routes

* Use any route pattern to find custom 404

* Fix frozen lockfile error

* Use `route` instead of `pattern` to match custom 404

Dynamic catch-all routes can match against `/404/` but will then error because they’re not actually designed to handle a param of `'404'`. Testing `route` instead excludes dynamic routes (because they’ll contain dynamic segments inside square brackets). Not sure if someone might _want_ to render the 404 via a dynamic route, but we already don’t support that, so this doesn’t change anything.

* Fix injected 404 fixture

* Add tests for `src/pages/404.html`

* Add changeset

* Fix lockfile

* And again
2023-05-01 10:37:07 -04:00
Matthew Phillips
c405cef647
Catch errors that occur within the stream in the Node adapter (#6935)
* Catch errors that occur within the stream in the Node adapter

* Adding a changeset

* Better error message on completely uncaught errors within the stream

* Update test
2023-05-01 10:08:18 -04:00
Matthew Phillips
649d70934e
Configure redoc to be noExternal (#6933) 2023-05-01 09:31:44 -04:00
wulinsheng123
5e1970bf29
Merge branch 'main' into add-Minification 2023-04-29 07:30:14 +08:00
Bjorn Lu
2dca81bf21
Update dependencies to remove peer dep warnings (#6930) 2023-04-28 21:21:47 +08:00
Bjorn Lu
ac57b5549f
Upgrade undici to v5.22.0 (#6929) 2023-04-28 21:13:49 +08:00
Yan Thomas
d11d185951
Add missing code language in Cloudflare README (#6925) 2023-04-28 14:37:26 +08:00
Erika
ebae1eaf87
feat(image): Update image service config to allow passing settings to the service (#6848) 2023-04-27 18:16:40 +02:00
Bjorn Lu
de5a25f4e9
Fix changeset publish (#6923) 2023-04-27 22:55:48 +08: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
Bjorn Lu
b89042553e
Fix tsconfig alias baseUrl handling for "." and ".." imports (#6920) 2023-04-27 18:30:17 +08:00
Bjorn Lu
465a1a5efe
Fix changeset version run (#6917) 2023-04-27 17:15:58 +08:00
Daniel
081b2402cf
esbuild respects vite.build.minify option (#6222)
* esbuild respects `vite.build.minify` option
* Docs update
---------
Co-authored-by: AirBorne04 <>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-04-27 10:11:05 +02:00
wulinsheng123
c78a9824d8
Merge branch 'main' into add-Minification 2023-04-26 21:04:13 +08:00
Phil Nash
4ea716e569
Adds extra elements to RSS items. (#6707) 2023-04-26 13:58:53 +01:00
wulinsheng123
9236c62994
Merge branch 'main' into add-Minification 2023-04-26 16:38:51 +08:00
wuls
96ae817982 fix pageage file 2023-04-26 16:38:03 +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
Bjorn Lu
edabf01b44
Upgrade to Vite 4.3 (#6877) 2023-04-25 22:04:45 +08:00
Bjorn Lu
0afff32741
Disable Vite optimizer for sync and config loading (#6902) 2023-04-25 20:54:41 +08:00
Bjorn Lu
b6154d2d57
Fix hoisted scripts path for linked package Astro components (#6872) 2023-04-21 10:42:23 +02:00