Commit graph

1667 commits

Author SHA1 Message Date
Matthew Phillips
9898088c0a
Convert HTMLString to regular string, preventing hydration script fro… (#4932)
* Convert HTMLString to regular string, preventing hydration script from being missing

* Add a changeset
2022-09-30 18:25:22 -05:00
Nate Moore
cf2bba1e4a
P5: fix MDX memory leak (#4939)
* fix(astro): tag jsx vnodes with renderer so errors are properly handled

* chore: fix missing package in test

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-30 17:13:44 -05:00
Fred K. Bot
2ffdafff45
[ci] release (#4921)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-30 20:15:38 +00:00
Tony Sullivan
64a1d712ef
[@astrojs/image] fixes a bug in dev when <Image /> is used with no transformation props (#4933)
* fix: return the original file in dev if no image transforms were used

* chore: add changeset
2022-09-30 17:27:56 +00:00
Tony Sullivan
b5e25afa94
Update seven-shrimps-hope.md (#4934)
Upgrading the image caching feature as a minor release
2022-09-30 16:38:21 +00:00
Erika
7690849a87
Move module declarations for Markdown and MDX so they're available everywhere (#4928)
* Move module declarations for Markdown and MDX to the proper file so they're globally available

* Remove tsconfig.json depending on client.d.ts unnecessarily
2022-09-30 12:06:14 -03:00
Tony Sullivan
9892989619
[@astrojs/image] adding caching support for SSG builds (#4909)
* adds a caching feature for SSG builds

* chore: add changeset

* nit: eslint fix

* chore: add readme docs for caching

* adding basic test coverage for cached images
2022-09-29 21:20:48 +00:00
Fred K. Bot
d08093f7d4
[ci] release (#4903)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-29 11:20:00 -04:00
Bjorn Lu
fd9d323a68
Support Vue JSX (#4897)
Co-authored-by: Dan Jutan <danjutan@gmail.com>
2022-09-29 11:25:45 +08:00
Matthew Phillips
01c1aaa003
Fix CSS ordering between imported and Astro styles (#4907)
* Fix CSS ordering between imported and Astro styles

* Fix linting errors

* Add changeset and upgrade compiler version

* Update test to reflect shared styles placed before page styles
2022-09-28 18:12:22 -04: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
Tony Sullivan
ec55745ae5
Fix: let Squoosh default image quality internally (#4906)
* removes our quality defaults, allowing Squoosh format-specific defaults to be used

* chore: add changeset
2022-09-28 20:55:09 +00:00
Bjorn Lu
812658ad2a
Remove shamefully-hoist (#4842) 2022-09-28 23:13:33 +08:00
Matthew Phillips
87a7cf48e7
Hoist hydration script out of slot templates (#4891)
* Hoist hydration script out of slot templates

* Add changeset

* Fix HTML components

* Mark as html string
2022-09-28 10:55:14 -04:00
Matthew Phillips
ff7ba0ee0f
Ensure head content rendered once with lazy layouts (#4892)
* Ensure head content rendered once with lazy layouts

* Add changeset
2022-09-28 10:55:06 -04:00
Fred K. Bot
077134ae2c
[ci] release (#4846)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-27 12:12:44 -04:00
Rishi Raj Jain
90c2072990
fix: post API routes in SSG should warn or error during dev mode (#4878)
* Update endpoint.ts

* add warning for post routes called when output is not server

* Update famous-camels-study.md

* Update endpoint.ts

* If not get

* Resolve changes
2022-09-27 10:17:58 -04:00
Bjorn Lu
fb91d04a5c
Set SSR target webworker for Vercel edge (#4884) 2022-09-27 08:40:10 -04:00
Ben Holmes
58a2dca228
Fix: correctly transform import.meta.env.* in MDX (#4858)
* fix: serialize route pattern for Netlify edge

Co-authored-by: Jackie Macharia <jackiewmacharia>

* fix: escape import.meta.env in MDX compiler output

* test: env vars in mdx

* chore: changeset

* deps: estree-util-visit, @types/estree

* feat: inject import.meta.env w/ recma

* feat: pull importMetaEnv from vite + astro configs

* test: `import.meta.env` in JSX

* fix: lockfile

* chore: update changeset

* fix: remove stray stashed commit
2022-09-26 18:23:47 -04:00
Rishi Raj Jain
42fe8e0c7f
fix: Script with innerHTML not working on Safari (#4861)
* fix: Script with innerHTML not working on Safari

* Update cool-camels-tease.md
2022-09-26 14:03:53 -04:00
Bjorn Lu
83ed1cc1f2
Prevent /undefined catch-all routes in dev (#4873) 2022-09-26 14:03:14 -04:00
Rishi Raj Jain
03e8b750ad
fix: 🐛 BUG: class:list directive adding class attribute when undefined (#4867)
* Update hydration.ts

* Create lucky-comics-bow.md
2022-09-26 12:53:07 -04:00
Rishi Raj Jain
b99f9902b7
fix: "chunks" directory appears in build output, if custom modules are imported in Astro files (#4868) 2022-09-26 18:01:44 +08:00
Matthew Phillips
49ca9e1291
Define toStringTag another way (#4855)
* Define toStringTag another way

* Adding a changeset
2022-09-23 13:27:07 -04:00
Rishi Raj Jain
edb7bead6e
fix: Can't overwrite vite's MODE environment variable (#4850)
* Add flags to the build options

* replace mode: 'production' as fallback

* Update mode support

* Add changeset
2022-09-23 08:08:57 -04:00
Rishi Raj Jain
ee5fdeffdd
fix: getFileInfo does not add .html extension in url when build.format is file (#4849)
* Create appendExtension

* Add html to file URLs if build.format is file

* Add changeset
2022-09-23 08:07:27 -04:00
Gerard de Brieder
944d24e9ee
Update Picture.astro so it no longer passes height and width attributes (#4797)
* Update Picture.astro

the image variable of getPicture contains a width and height property, which we usually require. In this case, the image is wrapped in a picture tag and the img tag itself should not have a width and height property as this will break the responsiveness of the image provided by the picture tag.

* added changeset

* fixing SSG picture tests that were expecting img dimensions

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-09-22 21:01:38 +00:00
Rishi Raj Jain
4b092269c1
Resolves #4825 (#4841)
* Resolves #4825

* Add changeset

* Update late-cups-jam.md

* Update late-cups-jam.md
2022-09-22 16:37:49 -04:00
Matthew Phillips
3389f0ce91
Prevent the root from being deleted during the build (#4845)
* Prevent the root from being deleted during the build

* Adding a changeset
2022-09-22 16:37:16 -04:00
Tony Sullivan
fad3867adb
Adding an optional image service based on Squoosh (#4738)
* WIP: adding a service built on @squoosh/lib

* WIP: investigating memory leaks in Squoosh

* WIP: vendoring Squoosh to work with our build

* chore: a bit of cleanup and a small perf gain

* removing a few unused deps

* fix: removing temp .only() in sharp test

* hooking up the last build steps to copy over .wasm files

* removing the duplicated lib/*.wasm files

* defaulting to Sharp for the initial @next release

* make sure pnpm always runs the postbuild script

* removing a few node dependencies

* refactor: move the copy .wasm build step out of the SSR bundle

* linter fixes

* fixing lock file

* chore: add TEMP changeset

* fix built wasm location for SSG builds

* Revert "defaulting to Sharp for the initial @next release"

This reverts commit 1a8d4f7f60.

* removing sharp dependency

* Revert "fix built wasm location for SSG builds"

This reverts commit 446b80bb53.

* chore: update lockfile

* fixing up image tests for the wasm loader

* updating the README for squoosh

* parallel wasm builds

* refactor: a bit of house keeping

* perf: allow a thread for each output encoding format

* fix: dev broke with the shift to wasm workers

* adds a new `astro:build:generated` hook for SSG builds

* fix: typo + calling cleanup methods in wasm codecs

* adding @astrojs/webapi for the TransformStream polyfill

* Revert "adding @astrojs/webapi for the TransformStream polyfill"

This reverts commit 39e5b845a5.

* perf: using sharp for most of the CI tests

* chore: update lockfile

* removing hard-coded squoosh imports

* fix: adding sharp to rollup externals

* test: using dev for the squoosh tests

* fix: updating the build output dir for wasm filles in SSG builds

* updating the changeset with migration details

* Revert "adds a new `astro:build:generated` hook for SSG builds"

This reverts commit 59b5fec7be.

* nit: adding comments for the wasm file copy

* chore: fix eslint warning
2022-09-22 19:48:14 +00:00
Bjorn Lu
6a1a17dd28
Add CSS @import test (#4454)
* Add css hmr test

* Allow HMR in e2e tests

* Add changeset

* Actually fix test

* Fix lint

* Skip windows for now
2022-09-22 15:06:49 -04:00
Zicklag
5e4c5252bd
Http proxy for fetch (#4676)
* Add HTTP Proxy Support to `fetch` Polyfill

Use `global-agent` to support HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
environment variables.

* Add Changeset For HTTP Proxy Support in `fetch`
2022-09-22 14:47:06 -04:00
Michael Rienstra
7481ffda02
create-astro: always create tsconfig.json (#4810)
* `create-astro`: always create `tsconfig.json`

Currently, we only make sure `tsconfig.json` exists when `strict` or `strictest` is selected. Both `default` & `optout` are intended to correspond to `base` -- and will do so for all [23 official templates](https://github.com/withastro/astro/tree/main/examples), but not necessarily for third-party templates.

The [example command for installing a third-party template](https://github.com/withastro/astro/blob/a800bf7/packages/create-astro/README.md?plain=1#L31-L35) is (rather conveniently for the sake of this PR!) an example of a template without a `tsconfig.json` file, and installing it with the `default` ("Relaxed") Typescript option results in no `tsconfig.json` file, rather than a `tsconfig.json` file containing `{ "extends": "astro/tsconfigs/base" }` as would be expected.

This PR addresses this scenario. 

It also explicitly sets the `tsconfig.json` file to `{ "extends": "astro/tsconfigs/base" }` when `default` (which I renamed to `base`, still presented to the user as "Relaxed") or `optout` is selected (`optout` has always printed a warning about the importance of `tsconfig.json` & `src/env.d.ts` but otherwise behaved identically to `default`). This is necessary in two scenarios:

1. When the `tsconfig.json` file was created by this script.
2. When it either didn't already include `"extends"`, or it extended a different config by default. For example, some third-party templates might default to `strict`, in which case I'm guessing we'd want to respect the user's choice and change that to `base`.

* update `del` 6.1.1 --> 7.0.0

* test: prevent excess writes
(without this it triggers many times)

* test: create-astro typescript prompt

* changeset

* fix: recursive `mkdirSync`

* test: longer timeout for `windows-latest` OS
(see if this fixes failing tests)

* better glob path creation, don't hardcode `/`

* test: longer timeout for windows-latest OS
(since I'm about to trigger another CI run by pushing a commit, might as well try this too)

* create-astro test: show last CLI output on timeout

* drop variable timeout
Typescript tests are slower than directory tests, but they are all usually less than 5000 ms. Less complexity, easier to maintain.

* DRY new error output

* Update lockfile

* Sync lockfile with main

* Update lockfile

Co-authored-by: Princesseuh <princssdev@gmail.com>
2022-09-22 14:37:01 -04:00
Ben Holmes
e5f71142eb
docs: add MDXLayoutProps to README (#4700)
* docs: add MDXLayoutProps to README

* chore: changeset

* nit: remove "if you understand this diff"

* nit: AdD tYpE sAfEtY

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

* Update packages/integrations/mdx/README.md

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

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-09-22 14:35:37 -04:00
梁峰宁
17dbc67018
Fix slashes for paths containing non-ASCII characters on Windows. (#4712)
* Fix slashes for paths containing non-ASCII characters on Windows.

* Add non-ASCII path test

* Fix slashes in pnpm-lock.yaml
2022-09-22 14:33:28 -04:00
Fred K. Bot
47d4165603
[ci] release (#4833)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-22 11:04:45 -04:00
Matthew Phillips
25a5b9a89a
Revert preact signals support (#4843)
* Revert "Update preact example to match @astrojs/preact ranges (#4840)"

This reverts commit d650a1161a.

* Revert "[ci] format"

This reverts commit e3c78c5b16.

* Revert "Support shared signals in Preact islands (#4763)"

This reverts commit 5e46be5468.
2022-09-22 10:32:42 -04:00
Matthew Phillips
73f215df76
Allow passing fetch() Response to set:html (#4832)
* ALlow passing fetch() Response to set:html

* Only check for Symbol.iterator on objects

* oops

* Fix no-streaming case

* Remove old comment
2022-09-21 19:07:00 -04:00
董雨航
29b29e6a8a
Fix: Invalid hook call when user use export jsx function (#4831)
* update vite-jsx-plugin for export

* update vite-jsx-plugin for export

* update changeset level

Co-authored-by: Yuhang <dong_yu_hang@126.com>
2022-09-21 15:53:58 -04:00
Matthew Phillips
5e46be5468
Support shared signals in Preact islands (#4763)
* Support signals in Preact islands

* Add a changeset

* Only add signals if we need them

* Refactor signal logic into its own module

* Keep track of the signals used
2022-09-21 15:21:21 -04:00
Erika
baae1b3fd1
Update astro check to latest version of the language server (#4754)
* Update to latest version of the language server

* Add changeset
2022-09-21 15:15:04 -03:00
Bjorn Lu
a0619f0869
Refactor server url logs (#4509)
* Refactor server url logs

* Fix test

* Fix build
2022-09-21 13:25:16 -04:00
Tony Sullivan
b0cc939961
Adds a new "astro:build:generated" hook for SSG builds (#4775)
* Revert "Revert "Adds a new "astro:build:generated" hook for SSG builds (#4772)" (#4774)"

This reverts commit 13a4b0d488.

* fix: updating for latest merge with main
2022-09-21 17:13:36 +00:00
aggre
a961aa3c2f
Supports Uint8Array/Uint16Array/Uint32Array for serialize props (#4669)
* supports Uint8Array/Uint16Array/Uint32Array

* update astro-island to supports the added types

* run changeset

* apply format

* pass metadata through

* using Array type

* write test cases for serializing Uint8Array/Uint16Array/Uint32Array

* fix the broken test cases

* add type assertion for psychological safety

* this changes is minor change

* feat: serialize UintArrays directly

* Update index.ts

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-09-21 12:19:30 -04:00
Fred K. Bot
5684a016bb
[ci] release (#4823)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-20 16:55:48 -04:00
Oussama Bennaci
ea37de86e4
[@astrojs/image] flatten background only if alpha channel isn't supported (#4800)
* Use sharp flatten only when format doesnt support alpha

* Allow rgba for background prop

* Add changeset

* Adjust doc

* Fix tests
2022-09-20 20:25:45 +00:00
Fred K. Bot
a76b0aa27c
[ci] release (#4822)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-20 16:05:13 -04:00
Matthew Phillips
9bfbd63f05
Fixes processing of images in Netlify functions (#4820) 2022-09-20 15:33:01 -04:00
Fred K. Bot
a08b178cdb
[ci] release (#4811)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-20 15:15:54 -04:00
Matthew Phillips
518e8f7e25
Allow passing promises to set:html (#4819)
* Allow passing promises to set:html

* Adding a changeset
2022-09-20 13:13:21 -04:00
Daniel
ce0b92ba73
update cloudflare esbuild config (fixing solid ssr) (#4815)
* fixing esbuild platform setting, to enable solid build

* added changeset

* changed change to major

Co-authored-by: AirBorne04 <daniel@floatingpixels.com>
2022-09-20 12:36:58 -04:00
Mohammed Elhaouari
a49bc2f02e
Fix extra slash when adding integrations that ends with /astro (#4817)
* fix toIdent util

* add changesets
2022-09-20 12:36:40 -04:00
Matthew Phillips
8d059faaed
Prevent errors in React components from crashing the dev server (#4816)
* Prevent errors in React components from crashing the dev server

* Add a changeset

* Fix test when running in the build
2022-09-20 09:38:17 -04:00
Enteleform
f53d97d56b
[chore] replaces hard-coded minify values with vite.build.minify (#4803)
* [chore] replaces hard-coded `minify` values with `vite.build.minify`

* [style] changes ternary to not-equals

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* [chore] removes `minify` in favor of user config & Vite defaults

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2022-09-20 08:32:58 -04:00
HiDeoo
c84d85ba4d
Add support for running create-astro in cloned empty git repository (#4805) 2022-09-20 08:30:13 -04:00
Bjorn Lu
be9eaa0692
Allow override vite.build.target (#4813) 2022-09-20 08:12:13 -04:00
Luca Casonato
44fa378186
Remove explicit Transfer-Encoding: chunked header (#4807)
* Remove explicit `Transfer-Encoding: chunked`

This header is not necessary and is ignored by essentially all HTTP
servers when provided explicitly by the user. This is because the HTTP
transport layer handles adding this header automatically as needed.

Some variations of HTTP transport (like HTTP/2, which is enabled by
default in Deno, Netlify, and CFW) have no notion of
`Transfer-Encoding: chunked`, because all responses are streamed.

* add changeset
2022-09-20 07:59:10 -04:00
Kristoffer K
df54595a88
fix(markdown-remark): declare hast-util-to-html as a dependency (#4787) 2022-09-20 17:21:54 +08:00
Fred K. Bot
8a1dd4b7e8
[ci] release (#4790)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-19 14:44:49 -04:00
Bjorn Lu
cf5ed5f3a8
Update Vite 3.1.3 (#4802) 2022-09-19 11:46:05 -04:00
Matthew Phillips
8f9463e07f
Fixes client:only CSS in Svelte components (#4782)
* Fixes client:only CSS in Svelte components

* Add changeset
2022-09-17 12:32:35 -04:00
Fred K. Bot
1c36b0ec18
[ci] release (#4781)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-16 14:13:02 -04:00
Matthew Phillips
f3a81d82f6
Refactor to remove AstroConfig['_ctx'] (#4771)
* Refactor to remove AstroConfig['_ctx']

* Fix type error

* Export validateConfig

* Move to an options bag for createSettings

* Move config tests into test/untils/config

* Add a changeste

* fix build
2022-09-16 11:29:17 -04:00
Tony Sullivan
13a4b0d488
Revert "Adds a new "astro:build:generated" hook for SSG builds (#4772)" (#4774)
This reverts commit 03b18e8d1b.
2022-09-15 21:24:23 +00:00
Tony Sullivan
03b18e8d1b
Adds a new "astro:build:generated" hook for SSG builds (#4772)
* adds a new "astro:build:generated" hook for SSG builds

* chore: add changeset
2022-09-15 21:02:07 +00:00
Fred K. Bot
b2da8a124a
[ci] release (#4761)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-15 14:05:25 -04:00
Matthew Phillips
9a59e24e02
Ensure before-hydration is only loaded when used (#4768)
* Ensure before-hydration is only loaded when used

* client fix + changeset
2022-09-15 12:33:52 -04:00
Matthew Phillips
fc885eaea1
Read jsxImportSource from tsconfig (#4759)
* Read jsxImportSource from tsconfig

* Only read from tsconfig if not found earlier
2022-09-15 09:50:48 -04:00
Chris Swithinbank
0398efa39f
Tailwind v2 docs (#4758)
* Add migration notes to Tailwind changelog

* Include `tailwindcss` in manual install steps

* add changeset
2022-09-14 22:43:10 +02:00
Fred K. Bot
27aa9851d8
[ci] release (#4750)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-14 16:06:23 -04:00
Matthew Phillips
005d5bacd9
Allow custom 404 route to handle API route missing methods (#4594)
* Properly allow file uploads in the dev server

* Allow custom 404 route to handle API route missing methods

* Add a changeset

* what was i thinking

* Pass through the pathname

* Move the try/catch out and into handleRequest

* await the result of handleRoute
2022-09-14 15:47:16 -04:00
Matthew Phillips
c271ed35ee
Only pass through children prop if there are children (#4756) 2022-09-14 15:42:38 -04:00
Peter Singh
664ebf449e
Update peer dep with Tailwindcss (#4543)
* Update peer dep

* Create leaders-of-the-free-world.md

Update: `@astrojs/tailwindcss` project with `tailwindcss` as a `peer-dependency`

* Removed tailwindcss as 'dependency'

* Update `pnpm-lock` with changes to deps

* Update .changeset/leaders-of-the-free-world.md

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2022-09-14 20:17:04 +01:00
Matthew Phillips
f1efd88dde
Compatiblity between hoisted scripts and tailwind integration (#4755)
* Compatiblity between hoisted scripts and tailwind integration

* Adds a changeset
2022-09-14 13:51:38 -04:00
Bjorn Lu
1bedb9427e
Support Vite 3.1 (#4752)
* Support Vite 3.1

* Update ~3.1.0

* Revert Vite bump
2022-09-14 12:01:50 -04:00
Bjorn Lu
c5e134d035
Fix console.error filtering (#4748) 2022-09-14 22:08:34 +08:00
Bjorn Lu
13ca686ea1
Handle builds with outDir outside of cwd (#4736) 2022-09-14 21:24:35 +08:00
Matthew Phillips
cf8a7e933d
Properly handle multipart file uploads in the dev server (#4742)
* Properly allow file uploads in the dev server

* Smaller image

* movethe test over
2022-09-14 07:58:00 -04:00
Fred K. Bot
150cd8a582
[ci] release (#4729)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-13 15:15:05 -04:00
Nate Moore
8cfb3fb535
Migrate examples to type: module (#4662)
* chore: move examples to type module

* chore: prefer astro.config.mjs to astro.config.js

* chore: reference CJS config file

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-13 14:02:57 -05:00
Ben Holmes
4bc70f3545
Fix route validation for Netlify Edge (#4722)
* fix: serialize route pattern for Netlify edge

Co-authored-by: Jackie Macharia <jackiewmacharia>

* chore: changeset
2022-09-12 19:33:44 -04:00
Matthew Phillips
6efafa4b0e
Use import order to sort CSS in prod (#4724)
* Use import order to sort CSS in prod

* Adding a changeset

* Pass through the parent id

* Update remaining test
2022-09-12 16:35:39 -04:00
Fred K. Bot
56e225b41a
[ci] release (#4707)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-12 15:08:39 -04:00
Ben Holmes
6e1d62fe22
[RSS] Fix failure when globbing index route (#4701)
* fix: [rss] throw on undefined urls only

* test: "" url, passing glob outside pages/

* chore: changeset
2022-09-12 15:05:57 -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
Matthew Phillips
0dba3b6f3f
Make error handling more resilient in the dev server (#4723)
* Make error handling more resilient in the dev server

* Better approach

* Add a changeset
2022-09-12 14:40:31 -04:00
Erika
5b6173fd03
Add an error message for improperly configured renderers (#4705)
* Add error messages for wrongly configured renderers

* Add changeset
2022-09-12 11:55:06 -03:00
Ben Holmes
b0ee81d0a7
Fix: Vue script setup with other renderers applied (#4706)
* fix: add __ssrInlineRender to Vue check

* chore: remove console log

* test: vue builds with other renderer present

* chore: changeset
2022-09-09 19:09:59 -04:00
Fred K. Bot
100b8d0583
[ci] release (#4702)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-09 17:18:03 -04:00
Ben Holmes
d28f7013c2
Fix [astro add] fetch failure (#4703)
* fix: apply fetch polyfill earlier

* chore: changeset
2022-09-09 16:56:07 -04:00
Oussama Bennaci
1e5d8ba9af
[@astrojs/image] support additional resize options (#4438)
* working draft

* more sharp params

* add changeset

* fix typing

* wip

* add missing docblocks

* update lock file

* remove enlargement and reduction resize options

* add tests

* Add docs

* support crop options in pictures

* cleanup

* define crop types in docs

* cleanup

* remove kernel option

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-09-09 20:13:59 +00:00
Fred K. Bot
2737cabd10
[ci] release (#4698)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-09 14:58:03 -04:00
Matthew Phillips
b85d05a841
Fix client:only CSS missing from child packages (#4699) 2022-09-09 14:51:58 -04:00
Ben Holmes
d1e6959147
[astro add] Move config update to final step (#4682)
* feat: move astro.config update to end

* chore: changeset
2022-09-09 14:06:39 -04:00
Alan
255636cc7b
Add support for custom non-html route encoding (#4549)
* Add custom encoding support for non-html routes

* Add changeset

* Add tests for png and json routes
2022-09-09 11:58:24 -04:00
Ben Holmes
c706d845eb
No 👏 more 👏 server 👏 restarts 👏 on 👏 config 👏 changes (#4578)
* feat: restart config on add, remove, update

* fix: reload for root project configs only

* fix: throw when userConfigPath can't resolve

* chore: changeset

* wip: remove normalizePath before writeFile

* refactor: invalidateWithCache -> isConfigReload

* wip: mustExist?

* debug: config loaded successfully

* debug: more logs

* debug: MORE logging

* fix: normalize resolved config path

* debug: yet MORE logging

* chore: bump proload

* fix: use file path, not URL.pathname

* Revert "wip: mustExist?"

This reverts commit 8ca8662132532dcdc9fd120868e615ddc60f498e.

* chore: remove console log

* feat: cleanup restart message, better invalid config handling

* chore: update lockfile

* chore: fix types

* fix: throw helpful error when config does not exist

* docs: remove "restart dev server" from integrations

* docs: make sure to restart -> try restarting

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-09 11:58:16 -04:00
Fred K. Bot
b6dd8b595c
[ci] release (#4680)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-09 10:56:48 -04:00
Ben Holmes
f27ca6ab3e
Fix: Windows client-side script reloads on dev server (#4645)
* fix: append forward slash to script paths for "C:/" prob

* chore: remove dead regex

* chore: changeset

* test: add client script test back to windows!

* test: add inline script test for sanity

* The actual fix

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-09-09 10:53:34 -04:00
Matthew Phillips
63e49c3b64
Prevent locking up when encountering invalid CSS (#4675)
* Prevent locking up when encountering invalid CSS

* Add a changeset

* Move the unit test to the test folder

* ponyfill aggregateerror

* Use the exported type

* keep original errors

* fix
2022-09-09 09:02:06 -04:00
Nate Moore
919df13b91
Improve cyclic reference detection, now ignores non-cyclic shared references (#4684)
* fix: improve cyclic reference detection, now ignores references that are not parent/child

* fix: only track cyclic parents

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-08 17:02:29 -05:00
Erika
cc242d3af2
Fix TypeScript compilation errors (#4683)
* Fix TypeScript compilation errors

* Update lockfile

* Add changeset
2022-09-08 16:31:54 -03:00
Tony Sullivan
4c05c65a3d
[@astrojs/image] Build all optimized images to dist/assets (#4678)
* fix: build all optimized images to dist/assets

* chore: add changeset
2022-09-08 18:41:17 +00:00
Matthew Phillips
5986517b4f
Make React integration work with Deno (#4679)
* Remove removed packages folder

* fix

* Add a changeset
2022-09-08 12:30:49 -04:00
Benjamin Holmes
9290b24143
Fix component frameworks on Vercel Edge (#4667)
* fix: use while instead of "for await" in react integration

* fix: cast HTML to string to fix other integrations

* docs: add comment on encode(String(html))

* chore: changeset

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-09-07 19:41:37 -04:00
Fred K. Bot
f165353e7a
[ci] release (#4657)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-07 21:29:44 +00:00
John Daly
d31e72c3ba
fix: exportName metadata for JSXMemberExpressions that use named imports (#4403)
* fix: exportName metadata for JSXMemberExpressions that use named imports

* Adding changeset

* Adding E2E test

* Adding tests for MDX
2022-09-07 13:51:09 -05:00
Marvin Hagemeister
999250d651
Automatically set up Preact DevTools in dev mode (#4515) 2022-09-07 13:49:07 -05:00
Nate Moore
98f242cdcd
Throw helpful errors when attempting to serialize cyclic references (#4646)
* fix(#4332): add helpful error on cyclic references

* chore: add changeset

* test(e2e): add cyclic reference test

* test(e2e): add preact integration

* chore: update lockfile

* fix: ensure vite client is loaded for 500 responses

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-07 13:25:26 -05:00
Valentin Bersier
e4348a4eb4
@astrojs/image: add a background option/prop to replace the alpha layer (#4642)
* Added `background` option and prop.
This optional color specifies which background to use when removing the
alpha channel if the output format doesn't support transparency.

* Modified existing tests

* Fixed wrong dimensions in tests

* Fixing a few instances of jpeg vs jpg

* Added color checking

* working on the tests

* tests are now passing

* Adding tests

* Added tests for background color

* no need to test with subpath

* Added fixture

* Renamed test fixture for background-color

* skipping test until fixed

* Typo

* Working on tests

* tests are passing

* Updated readme and added changeset

* Updated lockfile

* Updated lockfile

* Updated lockfile

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-09-07 17:22:11 +00:00
Tony Sullivan
db70afdcd5
[@astrojs/image] Fixes a regression in remote image filenames (#4649)
* fixes a bug in filename creation for remote images without a file extension

* chore: add changeset
2022-09-07 13:56:07 +00:00
Matthew Phillips
6d845c353d
Upgrade minimum compiler version (#4656)
* Upgrade minimum compiler version

* Add changeset

* Update lockfile
2022-09-07 08:29:54 -04:00
Fred K. Bot
481e0d1d8a
[ci] release (#4620)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-06 15:40:15 -04:00
Matthew Phillips
307b7b97ce
When removing duplicate CSS, also remove from metadata (#4643)
* When removing duplicate CSS, also remove from metadata

* Adding a changeset
2022-09-06 15:03:02 -04:00
Chris Swithinbank
eb1862b4e6
Improve third-party Astro package support (#4623) 2022-09-06 19:04:56 +02:00
Matthew Phillips
f08ca005e2
Add vueperslides to noExternal in vue integration (#4639) 2022-09-06 11:11:01 -04:00
Alan
494c2b8353
Parallelize @astrojs/image transforms (#4626) 2022-09-06 14:29:20 +00:00
Allan Chain
0068afb876
fix: ensure SSR module is loaded before testing is CSS (#4621) 2022-09-06 08:25:26 -04:00
Mohammed Elhaouari
63cd9d89e8
Fix AlpineJS homepage link (#4622)
* Update AlpineJS homepage

* Add changeset
2022-09-04 15:53:54 +02:00
Bjorn Lu
29a5fdc153
Correctly escape paths in file names (#4584) 2022-09-04 16:43:47 +08:00
Fred K. Bot
7114aee208
[ci] release (#4604)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 16:50:59 -04:00
Matthew Phillips
36dee7169b
Provide a better error message when no jsx renderer configured (#4603)
* Provide a better error message when no jsx renderer configured

* Add a changeset
2022-09-02 16:45:17 -04:00
Fred K. Bot
592de3d703
[ci] release (#4589)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 16:13:04 -04:00
Fred K. Schott
f018e365cf
Small polish to the "missing adapter" error message (#4585)
* improve output server error message

* chore: changeset

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-09-01 21:34:20 +00:00
Jan Müller
72c760e9b8
feat(image): throw if alt text is missing (#4511)
* feat(image): throw if no `alt` is provided

* chore: add changeset

* docs(image): update README

* updated alt text stuff throughout

* fixing with-mdx test suite

* warn for missing alt text, will throw an error in a future release

* final README tweaks

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-09-01 21:24:07 +00:00
Tony Sullivan
56f83be92a
Fix: [@astrojs/image] handle filenames with spaces (#4593)
* fix: decode file URLs to handle filenames with spaces

* chore: add changeset
2022-09-01 20:31:53 +00:00
Bjorn Lu
16814dc718
Move ast-types as dev dependency (#4586) 2022-09-01 12:33:29 -04:00
Ben Holmes
db38f61b2b
[MDX] Fix: GFM and Smartypants missing by default (#4588)
* fix: apply Astro defaults on empty md config

* chore: changeset
2022-09-01 12:11:13 -04:00
Fred K. Bot
005d53145f
[ci] release (#4555)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-31 18:03:27 -04:00
Chris Swithinbank
b92c24f409
Update astro add integrations list (#4574) 2022-08-31 23:49:08 +02:00
Zicklag
294122b4e4
Deno custom 404 pages (#4562)
* Add Failing Test For Deno Custom 404 Pages

* Make Deno SSR Serve Custom 404 Pages
2022-08-31 16:11:46 -04:00
Bjorn Lu
9ad307a9fc
Remove unused CSS for client:load components (#4566) 2022-08-31 22:36:41 +08:00
Tony Sullivan
00c605ce35
Image integration refactor and cleanup (#4482)
* WIP: simplifying the use of `fs` vs. the vite plugin

* removing a few node deps (etag and node:path)

* adding ts defs for sharp

* using the same mime package as astro's core App

* fixing file URL support in windows

* using file URLs when loading local image metadata

* fixing a bug in the etag helper

* Windows compat

* splitting out dev & build tests

* why do these suites fail in parallel?

* one last windows compat case

* Adding tests for treating /public images the same as remote URLs

* a couple fixes for Astro's `base` config

* adding base path tests for SSR

* fixing a bad merge, lost the kleur dependency

* adding a test suite for images + MDX

* chore: add changeset

* simplifying the with-mdx tests

* bugfix: don't duplicate the period when using existing file extensions

* let Vite cache the image loader service

* adding some docs for using /public images

* fixing changeset

* Update packages/integrations/image/README.md

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

* Update packages/integrations/image/README.md

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

* nit: minor README syntax tweaks

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 21:09:44 +00:00
Tony Sullivan
7429664566
Adds the "withastro" keyword to adapter packages (#4558)
* adds the "withastro" keyword to adapter packages

* chore: add changeset
2022-08-30 20:19:19 +00:00
Ben Holmes
8f8dff4d33
[MDX] Extend Markdown plugin config, with customization options (#4504)
* test: new combined remark / rehype suite

* fix: use with-plugins fixture

* chore: remove old mdx plugin tests

* docs: add JS docs

* docs: update README with thorough example

* chore: changeset

* fix: add "extends" error message

* fix: ignore string-based plugins in md

* feat: add warning log for string plugins

* docs: highlight `extendPlugins`

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

* nit: highlight "extendPlugins"

* fix: md plugins type check

* chore: "defaults" -> "astroDefaults"

* nit: info log when inheriting markdown plugins

* refactor: one big log on new behavior

* dan: dan nit

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 13:38:35 -04:00
Fred K. Bot
e905784bf1
[ci] release (#4520)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-30 12:45:04 -04:00
Kyle F Butts
8504cd79b7
Add custom components to mdx integration guide (#4530)
* Add custom components to mdx integration guide

* Update packages/integrations/mdx/README.md

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Update packages/integrations/mdx/README.md

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Update packages/integrations/mdx/README.md

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Update packages/integrations/mdx/README.md

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Incorporate Sarah and Ben's Feedback

* Fix what would be an ugly background lol

* Sarah taking liberty of removing double text

* Add changeset

Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 11:55:52 -04:00
Matthew Phillips
2f05f5d307
Include trailingSlash in astro:build:done hook (#4553) 2022-08-30 11:45:16 -04:00
Ben Holmes
69b640b87c
Fix "failed to load for SSR" error when removing Astro <style> blocks (#4548)
* wip: try removing ssrLoadModule on styles

* chore: changeset

* fix: invalidate mod before crawling graph

* Revert "fix: invalidate mod before crawling graph"

This reverts commit 883710d21c.

* Revert "wip: try removing ssrLoadModule on styles"

This reverts commit 880e73d94a.

* SAD fix: try/catch on ssrLoadModule

* refactor: isFile -> isRootFile

* docs: update comments for new findings
2022-08-30 11:27:19 -04:00
Bjorn Lu
9adb7cca33
Vite ignore unknown import (#4527) 2022-08-30 15:25:34 +08:00
Ben Holmes
bb71be78db
[astro add] Add an Adapter -> Add an SSR Adapter (#4546)
* nit: Add an Adapter -> Add an SSR Adapter

* chore: changeset
2022-08-29 17:05:12 -04:00
Matthew Phillips
1222ab9540
Configures Lit to work with its decorators (#4503)
* Configures Lit to work with its decorators

* Remove comment
2022-08-29 14:06:36 -04:00
Bjorn Lu
046bfd908d
Skip clean SSR output if page generation fails (#4526) 2022-08-29 23:59:25 +08:00
Bjorn Lu
2d2e38e473
Remove hardcoded Vite middleware handling (#4531) 2022-08-29 23:11:18 +08:00
Erika
ca28d7578b
Add missing slot attribute to possible attributes on SVG elements (#4535) 2022-08-29 12:06:50 -03:00
Erika
b8a80bc42d
Fix image integration's types not referring to the base types for Vite client types (#4534) 2022-08-29 12:06:41 -03:00
applemonkey496
d431fbe4e1
fix: config type import (#4524) 2022-08-29 00:12:58 -03:00
Juan Martín Seery
a2e8e76c30
chore: updated shiki (#4519)
* Upgraded shiki

* Use setColorReplacements

* no-shadow

* Changeset
2022-08-28 08:23:37 -03:00
Fred K. Bot
270852370a
[ci] release (#4508)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 21:30:37 -03:00
Erika
4e1af3f0e8
Fix import-meta.d.ts not being included in the package (#4507) 2022-08-26 19:28:34 -03:00
Fred K. Bot
d85133393a
[ci] release (#4502)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 13:03:04 -07:00
Mohammed Elhaouari
17e2178568
Add renderer keyword to alpinejs integration (#4501)
* Add renderer keyword to alpinejs

* Add changeset
2022-08-26 11:50:11 -07:00
Fred K. Bot
ff03313848
[ci] release (#4495)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 13:01:30 -04:00
Erika
9874c7bf42
Update astro check to use latest version of the language server (#4500)
* Update @astrojs/language-server to latest version

* Add changeset

* Update lockfile
2022-08-26 12:54:38 -03:00
Erika
1f42c0791c
Vendor Vite's importMeta.d.ts inside our repo to workaround issue with tsc on Linux (#4499)
* Update @astrojs/language-server to latest version

* Vendor importMeta.d.ts from Vite inside our repo to workaround TypeScript issue on Linux

* Remove unnecessary change

* Add changeset
2022-08-26 12:47:39 -03:00
Ben Holmes
78e06c8ec0
Only print file output only for 404 and 500 routes (#4497)
* fix: print file output only for 404 and 500 routes

* chore: changeset
2022-08-26 11:35:30 -04:00
Abdullah Mzaien
824a2adddd
chore: update to solid 1.5 (#4496) 2022-08-26 11:11:57 -04:00
Matthew Phillips
62fd846ea8
Exit prerelease mode for 1.1 release (#4493) 2022-08-26 10:16:29 -04:00
Fred K. Bot
7960fb80a1
[ci] release (next) (#4480)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-25 17:27:35 -04:00
Ben Holmes
ac03218247
[MD] extendDefaultPlugins to preserve default remark plugins (#4474)
* feat: add { extends } to markdown config

* test: remark plugins with extends

* deps: pnpm lock

* chore: changeset

* fix: remarkPlugins -> rehypePlugins

* docs: update markdown config reference

* Revert "feat: add { extends } to markdown config"

This reverts commit 5d050bbcf9a2c0d470cae79c4d0a954d489f4e8c.

* feat: new "extendDefaultPlugins" flag

* docs: update config

* nit: We -> Astro applies

* fix: backticks on `false`

* nit: Note -> REAL note

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

* docs: note -> caution

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-25 17:21:56 -04:00
Ben Holmes
d4cd7a59fd
Update Markdown type signature to match behavior (#4423)
* feat: "file" and "url" top-level layout props

* test: markdown file and url

* test: mdx file and url

* feat: update MarkdownInstance + JSDoc improvements

* chore: changeset
2022-08-25 17:08:43 -04:00
gtnbssn
839097c84e
make Remark rehype options available in astro config (#4138)
* make remark-rehype config available in astro.config.mjs

* add test for remark-rehype config, checks that footnotes can be translated

* update lockfile to take the added test into account

* omit handlers and unkownHandler from the RemarkRehype type

* define RemarkRehype with proper references to the handler and handlers types

* formatting

* changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-25 16:30:16 -04:00
Matthew Phillips
cd154e447b
Make Astro.url conform to build.format during the build (#4352)
* Make Astro.url conform to build.format during the build

* Adding a changeset

* Better implementation

* fix some stuff that tests failed on

* Add docs

* Change to minor

* account for empty path
2022-08-25 15:20:59 -04:00
Erika
77ce6be30c
Add template tsconfigs for users to extend from (#4439)
* Add tsconfig templates to extend from

* Add changeset

* Right order for assign parameters

* Add tsconfigs to export map
2022-08-25 15:15:27 -04:00
Aleksander Heintz
fcc36ac908
Make astro package play nice with node16 module resolution (#4182)
* Make astro package play nice with node16 module resolution

Projects using node16 module resolution in typescript uses the new
exports and imports configuration from typescript to find definition
files. This mirrors how nodejs resolves the files. If a package contains
an exports map in the package.json, typescript will ignore the "types"
field (not sure how it plays with typesVersions). This moves the typings
hirearchy of definition files into the same hierarchy that astro
produces output files in, so that typescript can discover them.

Fixes: #4172

* Add changeset

* Reorder export keys

* Update paths inside .d.ts files

Co-authored-by: Princesseuh <princssdev@gmail.com>
2022-08-25 14:57:11 -04:00
Matthew Phillips
243525b156
Add changeset for @astrojs/react minor (#4478) 2022-08-25 14:56:10 -04:00
Matthew Phillips
1aa5208cbe
Enter prerelease mode for 1.1 (#4477) 2022-08-25 14:50:26 -04:00
Fred K. Bot
0b66ff39b8
[ci] release (#4453)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-25 12:00:17 -04:00
Erika
47e71ae8f8
Added more clarification around using Astro.slots.render (#4456)
* Add an error message for when something that's not an array is passed to Astro.slots.render

* Add changeset

* Add more details
2022-08-25 11:42:27 -04:00
Matthew Phillips
78334b9765
Revert "Fix invalid hook usage for exports (#4385)" (#4475)
* Revert "Fix invalid hook usage for exports (#4385)"

This reverts commit 8164fa6f1a.

* Adding a changeset
2022-08-25 11:42:02 -04:00
Matthew Phillips
9490f0e223
Include styles imported by hoisted scripts (#4457)
* Include styles imported by hoisted scripts

* Add changeset

* remove unused imports
2022-08-25 11:14:22 -04:00
Bjorn Lu
467108730e
Remove optional chaining in astro-island (#4473) 2022-08-25 22:01:22 +08:00
kagankan
8a2d6958f1
Fix load base option in build (#4469) 2022-08-25 09:35:28 -04:00
Bjorn Lu
aa555932be
Support vite.build.cssCodeSplit: false option (#4458) 2022-08-25 16:34:13 +08:00
Bjorn Lu
a38a568299
Fix incorrect css test (#4451) 2022-08-24 22:11:42 +08:00
Bjorn Lu
85646918ac
Refactor CSS preprocess and HMR (#4422) 2022-08-24 21:06:48 +08:00
Fred K. Bot
5427e89491
[ci] release (#4431)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-23 15:27:10 -04:00
Ben Holmes
df4e999284
Add logs for long-running integration hooks (#4445)
* feat: basic logging for long astro:build:done hooks

* feat: add long time msg to all build hooks

* feat: use logger for long time msg

* chore: changeset
2022-08-23 14:07:09 -04:00
Matthew Phillips
27ac6a03a1
Use CSS depth to sort CSS in production (#4446)
* Use CSS depth to sort CSS in production

* Adds a changeset
2022-08-23 13:26:49 -04:00
Ben Holmes
adb2079796
Fix MDX style imports when layout is not applied (#4443)
* fix: add "astro.needsHeadRendering" to MDX

* test: style imports in pages without layout

* chore: changeset
2022-08-23 13:25:35 -04:00
Erika
ca0c7e8b83
Allow string as a valid value for the target attribute (#4441) 2022-08-23 11:39:02 -03:00
Bjorn Lu
baa2ddd010
Warn hydration directive for Astro components in JSX (#4330)
* Warn hydration directive for Astro components in JSX

* Add changeset

* Better comment
2022-08-23 10:38:31 -04:00
Ben Holmes
dc42f2c00f
Fix astro add @example-org/integration (#4430)
* fix: parse third-party org names

* chore: changeset
2022-08-23 10:09:39 -04:00
Matthew Phillips
f40065f510
Ensure index pages are generated on paginated results (#4426)
* Ensure index pages are generated on paginated results

* Changeset
2022-08-23 08:47:20 -04:00
Kiril Shevchuk
8164fa6f1a
Fix invalid hook usage for exports (#4385)
* Add proper support functional components exports

* Add changeset

* Add support for `export default X`
2022-08-23 08:46:51 -04:00
Cameron McEfee
b2e976f39c
fix (core): allow falsy values in astro config integrations arrays (#4427)
* allow falsy values in astro config integrations arrays

* add changeset
2022-08-23 08:23:08 -04:00
Ben Holmes
a2414bf59e
Improve MDX glob perf - move Layout to async import (#4428)
* fix: move layout to async import

* chore: changeset

* docs: clarify async import
2022-08-22 18:18:30 -04:00
Fred K. Bot
c8d0fa4c4e
[ci] release (#4425)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-22 16:53:44 -04:00
Fred K. Bot
457e559cd5
[ci] release (#4363)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-22 15:46:46 -04:00
Tony Sullivan
579e2daf8d
[@astrojs/image] Handle query params in remote image URLs during SSG builds (#4338)
* fix: SSG builds should remove query params when building local image files

* chore: add changeset

* handling an edge case related to stripping extensions from a filename
2022-08-22 19:45:34 +00:00
Tony Sullivan
c4af8723bd
[@astrojs/image] adds a logger to the the image integration (#4342)
* WIP: adding a console logger that respect vite.logLevel

* adds an optional prefix for messages

* remove temporary debug log

* typo fix

* cleaning up log syntax

* fixing logger whitespace

* adding README docs

* test: disable integration logging in tests

* chore: add changeset
2022-08-22 19:13:19 +00:00
Fred K. Schott
7310e8a178
add an alpine integration and update example (#4406) 2022-08-22 14:25:57 -04:00
Fred K. Schott
a70f69a06c
refactor the JSX plugin to improve performance (#4405) 2022-08-22 14:25:09 -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
Bjorn Lu
39088e11db
Bump Vite to 3.0.9 (#4415) 2022-08-22 10:58:50 -04:00
Matthew Phillips
5e82f6c245
Fix race condition with directive definitions (#4375) 2022-08-22 10:39:16 -04:00
Bjorn Lu
77b068086d
Preserve all error stack lines (#4364) 2022-08-18 14:36:31 +08:00
Chris Swithinbank
beed20be4a
Provide correct MIME type for dynamic endpoint routes in dev (#4356) 2022-08-17 20:07:14 +02:00
Bjorn Lu
500332a426
Refactor static build config merge (#4344) 2022-08-17 23:24:14 +08:00
Joseph Lozano
aa5118e854
Fallback to undefined rather than false when resolving CLI flags (#4362) 2022-08-17 15:47:38 +08:00
Fred K. Bot
1de82f0f78
[ci] release (#4333)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-16 10:14:44 -04:00
Patrick Smith
45fdbc4650
Don’t use Buffer.byteLength() as Deno can’t use it (#4324)
* Don’t use Buffer.byteLength() as Deno can’t use it

* Add changeset

* Add tests for Markdown & MDX with Deno

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-16 10:08:40 -04:00
Ben Holmes
166b3b8a54
Fix: TS lint on MDXLayoutProps (#4347)
* fix: extends interface -> type

* chore: changeset
2022-08-16 09:45:10 -04:00
Tony Sullivan
0274b8d47b
SSR doesn't need to block multiple routes that match the same URL (#4329)
* fix: SSR doesn't need to block multiple routes that match the same URL

* chore: add changeset
2022-08-15 13:57:10 -04:00
Matthew Phillips
b55f76c1ca
Fix double injecting of head content in md pages (#4334)
* Fix double injecting of head content

* Refactor

* Changeset

* Break into a separate util fn

* fix oops

* remove unused code
2022-08-15 13:10:28 -04:00
Ben Holmes
f1a52c18af
[MDX] Switch from Shiki Twoslash -> Astro Markdown highlighter (#4292)
* freat: twoslash -> Astro shiki parser

* test: update shiki style check

* feat: always apply rehypeRaw

* deps: move remark-shiki-twoslash to dev

* test: add shiki-twoslash test

* docs: update readme with twoslash example

* chore: changeset

* nit: remove "describe('disabled')"
2022-08-15 10:43:12 -04:00
Fred K. Bot
16edf0c773
[ci] release (#4296)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-13 10:09:17 -07:00
Fred K. Schott
1d3a0a16f3
Revert "Ensure hydration scripts inside of slots render ASAP (#4288)" (#4302)
* Revert "Ensure hydration scripts inside of slots render ASAP (#4288)"

This reverts commit c218100684.

* Create khaki-dots-press.md
2022-08-13 10:00:12 -07:00
Fred K. Schott
73f367c77b
add protection if astro preview is run with server output (#4284)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-13 00:09:58 -07:00
Fred K. Bot
b1bd52e9ea
[ci] release (#4290)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-12 17:40:47 -05:00
Ben Holmes
f7afdb889f
[MDX] Fix remaining inconsistencies with Markdown (#4268)
* feat: add "file" and "url" to layout props

* feat: add rawContent and compiledContent errs

* fix: add "file" and "url" to frontmatter

* fix: add separate MDX instance type

* types: add MarkdownLayoutProps and MDXLayoutProps

* refactor: simplify MDXLayoutProps

* test: pass file and url to layout

* test: glob components with .default and Content

* feat: add <Content /> to MDX

* feat: declare MDX type module

* fix: [MD] move file and url to layout props only

* chore: changeset

* chore: bump MDX to "minor" with more details

* refactor: remove "file" + "url" top-level props (save for minor)

* revert: MDInstance type def updates (save for minor)

* fix: MDXInstance "default" + "content" types

* fix: bad test layout

* chore: remove getHeaders fro *.mdx
2022-08-12 18:17:26 -04:00
Nate Moore
24d2f7a6e6
Fix namespaced component usage in MDX (#4272)
* fix(#4209): handle namespaced JSX and MDX

* chore: add changeset

* chore: update lockfile

* fix: throw error when componentExport is unresolved

* chore: bump compiler

* chore: bump compiler

* chore: revert example changes

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-12 17:01:05 -05:00
Ben Holmes
3ca9051749
[astro add] Set output: 'server' when adding adapter (#4289)
* fix: add `output: 'server'` when setting adapter

* chore: changeset
2022-08-12 13:16:19 -04:00
Matthew Phillips
8f845ca950
Prevents automatic trailingSlash behavior with getStaticPaths (#4265)
* Prevents automatic trailingSlash behavior with getStaticPaths

* Testing

* weird change
2022-08-12 12:19:32 -04:00
Matthew Phillips
c218100684
Ensure hydration scripts inside of slots render ASAP (#4288)
* Ensure hydration scripts inside of slots render ASAP

* Changeset

* fix type errors

* Update packages/astro/src/runtime/server/render/page.ts

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

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-12 12:18:41 -04:00
Nate Moore
c0992e1fef
fix(#4194): remove Astro runtime from browser (#4282)
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-12 10:48:53 -05:00
Fred K. Bot
bb3d7d4f39
[ci] release (#4249)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-11 16:50:59 -07:00
Bjorn Lu
5b1facfe29
Clarify preact/compat integration docs (#4267)
* Clarify preact/compat integration

* Create long-lobsters-ring.md

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-08-11 16:34:07 -07:00
Nate Moore
7127b1bb35
Fix astro add with third-party integrations (#4270)
* fix: nicer third-party integration names

* chore: add changeset

* fix: better handling for package names

* update changelog

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-11 16:31:28 -07:00
Erika
0022f46b57
Fix build output for endpoints route (#4273)
* Fix build output for endpoints route

* Add changeset
2022-08-11 16:28:06 -07:00
Matthew Phillips
d3d09a2c9f
Add 404 routing logic to Netlify redirects file (#4274)
* Add 404 routing logic to Netlify redirects file

* changeset
2022-08-11 16:26:32 -07:00
Fred K. Schott
42fd6936cd
fix astro image bad imports (#4279) 2022-08-11 16:24:17 -07:00
Ben Holmes
4116128082
[MDX] Pass injected frontmatter to layouts (#4255)
* fix: move layout generation to remark plugin

* test: frontmatter injection in layout

* chore: changeset

* fix: remove content fallback
2022-08-11 12:36:34 -05:00
Maik Jablonski
ceb0eef944
Use passive listeners in prefetch (#4207)
* Use passive listeners in prefetch

Without passive=true, Lighthouse complains about not using passive listeners to improve scrolling performance.

* Create cold-shoes-drum.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-11 11:04:10 -05:00
Nate Moore
1f0dd31d92
fix(#4246): fix Prism indentation and class (#4251)
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-11 10:59:48 -05:00
Jakob Helgesson
869d009359
Mdx/plugin unshift (#4248)
* Add builtin rehype plugin to beginning

* Add Changeset

* Do the same to rehypeRaw for consistency
2022-08-10 17:10:06 -04:00
Fred K. Bot
1ee08baf91
[ci] release (#4228)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-10 16:54:12 -04:00
Bjorn Lu
a9baa45af3
Simulate Vite resolve id to url (#4239)
* Simulate Vite resolve id to url

* Add changeset
2022-08-10 16:53:52 -04:00
Matthew Phillips
714a8399e2
Return 404 status code for 404.astro in SSR (#4247)
* Return 404 status code for 404.astro in SSR

* Adding a changeset
2022-08-10 16:22:31 -04:00
Ben Holmes
9d5ab55086
[MDX] Astro.props.content -> frontmatter (#4237)
* docs: MDX Astro.props.content -> frontmatter

* chore: changeset
2022-08-10 15:43:35 -04:00
Matthew Phillips
561a34d912
Include astro components for HMR invalidation (#4240)
* Include astro components for HMR invalidation

* Changeset

* remove extra vite server passing
2022-08-10 15:26:58 -04:00
Obinna Ekwuno
bfbd32588f
[Docs]: Update Cloudflare README (#4232)
* update cloudflare readme

* Create modern-papayas-rhyme.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-10 14:11:19 -05:00
Bjorn Lu
f8e3853394
Fix preact compat support for libraries (#4213)
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-10 22:22:10 +08:00
Bjorn Lu
c38e7f1890
Remove dev server during build (#4234) 2022-08-10 22:06:02 +08:00
Mayank
e918b3883e
feat: Support -y in astro add (#4225) 2022-08-09 21:29:51 -07:00
Fred K. Bot
74528a1973
[ci] release (#4224)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-09 17:31:06 -07:00
Fred K. Schott
3a7f2385ea Revert "[ci] release (#4223)"
This reverts commit d4ad409875.
2022-08-09 17:28:02 -07:00
Alexandre Desroches
92aa6a75ea
Updated @astrojs/image README.md missing formats prop as subtitle (#4221)
* Update README.md

Added missing subtitle for `formats` prop of the <Picture> component

* Create fast-drinks-visit.md

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-08-09 16:29:07 -07:00
Masataka Yakura
fe3b423982
Markdown component: fix package name in readme.md (#4208)
* Markdown component: fix package name in readme.md

readme says it's `@astrojs/markdown`, but package name is actually `@astrojs/markdown-component`.

* Create dry-deers-vanish.md

* Update dry-deers-vanish.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-08-09 16:28:48 -07:00
Fred K. Bot
d4ad409875
[ci] release (#4223)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-09 19:25:15 -04:00
Ben Holmes
b5ef1c2113
[MD] Add rawContent and compiledContent to MD layout props (#4222)
* fix: add subs for astro.source and astro.html

* fix: define "source" property

* test: raw and compiled content from layout

* chore: changeset

Co-authored-by: bholmesdev <bholmesdev@gmail.com>
2022-08-09 19:18:34 -04:00
Fred K. Bot
4d29163d11
[ci] release (#4197)
* [ci] release

* Update CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-08 18:10:55 -05:00
Ben Holmes
4c2ca5352d
[MDX] Remove frontmatterOptions (#4204)
* feat: remove frontmatterOptions config

* test: remove custom frontmatter suite

* deps: remove remark-mdx-frontmatter

* docs: remove `frontmatterOptions` config

* chore: changeset
2022-08-08 17:33:35 -05:00
Nate Moore
ec376369a8
fix: ensure jsx does not reference server entrypoint (#4203)
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-08 16:26:36 -05:00
Ben Holmes
6c9736cbc9
[MDX] Add frontmatter injection to README (#4205)
* docs: remove `remark-mdx-frontmatter` from README

* docs: remove remark-mdx-frontmatter link

* docs: MDX frontmatter injection

* chore: changeset
2022-08-08 17:16:06 -04:00
Matthew Phillips
25d36d9558
Refactor runtime (#4201)
* Refactor runtime

* Add back in generator change

* Adding a changeset

* Fix build
2022-08-08 15:35:01 -04:00
Nate Moore
f207c417e0
Add Astro.generator (#4012)
* feat: add generator property and component

* chore: remove `Generator` component

* chore: update generator description

* chore: include generator in examples

* chore: update lockfile

* chore: format

* fix: do not reference core from server runtime

* chore: remove component test

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-08 12:34:05 -05:00
Richard Cooke
f4c571bdb0
feat: add support to @astrojs/cloudflare directory deploy mode (#3806)
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-08 12:10:48 -05:00
Maik Jablonski
5e71a8720e
fix: astro preview does not serve custom 404 (4113) (#4189)
* fix: astro preview does not serve custom 404 (4113)

* fix: use exists instead of stat

* Create thick-ducks-sparkle.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-08 09:40:07 -05:00
Bjorn Lu
28ab273a3d
Fix client build sourcemap generation (#4195) 2022-08-08 21:55:18 +08:00
Fred K. Bot
3a7e0221b3
[ci] release (#4186)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-06 09:06:57 -07:00