Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/injected-route-p…
Browse files Browse the repository at this point in the history
…riority
  • Loading branch information
ematipico committed Jan 17, 2024
2 parents a34647e + 165cfc1 commit dd8c15f
Show file tree
Hide file tree
Showing 132 changed files with 1,675 additions and 1,248 deletions.
5 changes: 0 additions & 5 deletions .changeset/afraid-suits-beam.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/blue-pets-battle.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/calm-socks-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astrojs/markdown-remark": minor
"astro": minor
---

Allows remark plugins to pass options specifying how images in `.md` files will be optimized
32 changes: 32 additions & 0 deletions .changeset/cool-foxes-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"astro": minor
---

Adds new helper functions for adapter developers.

- `Astro.clientAddress` can now be passed directly to the `app.render()` method.
```ts
const response = await app.render(request, { clientAddress: "012.123.23.3" })
```

- Helper functions for converting Node.js HTTP request and response objects to web-compatible `Request` and `Response` objects are now provided as static methods on the `NodeApp` class.
```ts
http.createServer((nodeReq, nodeRes) => {
const request: Request = NodeApp.createRequest(nodeReq)
const response = await app.render(request)
await NodeApp.writeResponse(response, nodeRes)
})
```

- Cookies added via `Astro.cookies.set()` can now be automatically added to the `Response` object by passing the `addCookieHeader` option to `app.render()`.
```diff
-const response = await app.render(request)
-const setCookieHeaders: Array<string> = Array.from(app.setCookieHeaders(webResponse));

-if (setCookieHeaders.length) {
- for (const setCookieHeader of setCookieHeaders) {
- headers.append('set-cookie', setCookieHeader);
- }
-}
+const response = await app.render(request, { addCookieHeader: true })
```
5 changes: 5 additions & 0 deletions .changeset/curvy-seas-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/mdx": patch
---

Removes redundant HMR handling code
7 changes: 7 additions & 0 deletions .changeset/early-cups-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@astrojs/vercel": major
---

**Breaking**: Minimum required Astro version is now 4.2.0.
Reorganizes internals to be more maintainable.
---
16 changes: 16 additions & 0 deletions .changeset/itchy-clouds-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"astro": minor
---

Removes the requirement for non-content files and assets inside content collections to be prefixed with an underscore. For files with extensions like `.astro` or `.css`, you can now remove underscores without seeing a warning in the terminal.

```diff
src/content/blog/
post.mdx
- _styles.css
- _Component.astro
+ styles.css
+ Component.astro
```

Continue to use underscores in your content collections to exclude individual content files, such as drafts, from the build output.
5 changes: 0 additions & 5 deletions .changeset/long-mangos-walk.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/orange-trainers-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": minor
---

Improves the a11y-missing-content rule and error message for audit feature of dev-overlay. This also fixes an error where this check was falsely reporting accessibility errors.
5 changes: 5 additions & 0 deletions .changeset/polite-dogs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/markdoc": patch
---

Removes unnecessary `shikiji` dependency
5 changes: 0 additions & 5 deletions .changeset/poor-cherries-buy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/proud-guests-bake.md

This file was deleted.

8 changes: 8 additions & 0 deletions .changeset/six-scissors-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@astrojs/markdown-remark": minor
"astro": minor
---

Adds a new `markdown.shikiConfig.transformers` config option. You can use this option to transform the Shikiji hast (AST format of the generated HTML) to customize the final HTML. Also updates Shikiji to the latest stable version.

See [Shikiji's documentation](https://shikiji.netlify.app/guide/transformers) for more details about creating your own custom transformers, and [a list of common transformers](https://shikiji.netlify.app/packages/transformers) you can add directly to your project.
24 changes: 24 additions & 0 deletions .changeset/sixty-dogs-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"astro": minor
---

Adds an experimental flag `clientPrerender` to prerender your prefetched pages on the client with the [Speculation Rules API](https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API).

```js
// astro.config.mjs
{
prefetch: {
prefetchAll: true,
defaultStrategy: 'viewport',
},
experimental: {
clientPrerender: true,
},
}
```

Enabling this feature overrides the default `prefetch` behavior globally to prerender links on the client according to your `prefetch` configuration. Instead of appending a `<link>` tag to the head of the document or fetching the page with JavaScript, a `<script>` tag will be appended with the corresponding speculation rules.

Client side prerendering requires browser support. If the Speculation Rules API is not supported, `prefetch` will fallback to the supported strategy.

See the [Prefetch Guide](https://docs.astro.build/en/guides/prefetch/) for more `prefetch` options and usage.
7 changes: 7 additions & 0 deletions .changeset/tame-squids-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/node': major
---

If host is unset in standalone mode, the server host will now fallback to `localhost` instead of `127.0.0.1`. When `localhost` is used, the operating system can decide to use either `::1` (ipv6) or `127.0.0.1` (ipv4) itself. This aligns with how the Astro dev and preview server works by default.

If you relied on `127.0.0.1` (ipv4) before, you can set the `HOST` environment variable to `127.0.0.1` to explicitly use ipv4. For example, `HOST=127.0.0.1 node ./dist/server/entry.mjs`.
5 changes: 5 additions & 0 deletions .changeset/tidy-planets-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Simplifies HMR handling, improves circular dependency invalidation, and fixes Astro styles invalidation
5 changes: 5 additions & 0 deletions .changeset/unlucky-stingrays-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/node": patch
---

Fixes an issue where the preview server appeared to be ready to serve requests before binding to a port.
6 changes: 6 additions & 0 deletions .changeset/weak-apes-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astrojs/node": major
---

**Breaking**: Minimum required Astro version is now 4.2.0.
Reorganizes internals to be more maintainable.
4 changes: 0 additions & 4 deletions .changeset/weak-planes-help.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/mdx": "^2.0.4",
"@astrojs/rss": "^4.0.2",
"@astrojs/sitemap": "^3.0.4",
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.3.2",
"@types/alpinejs": "^3.13.5",
"alpinejs": "^3.13.3",
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^4.0.1",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.1.2",
"astro": "^4.1.3",
"lit": "^2.8.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/solid-js": "^4.0.1",
"@astrojs/svelte": "^5.0.3",
"@astrojs/vue": "^4.0.8",
"astro": "^4.1.2",
"astro": "^4.1.3",
"preact": "^10.19.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.1.0",
"@preact/signals": "^1.2.1",
"astro": "^4.1.2",
"astro": "^4.1.3",
"preact": "^10.19.2"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.0.9",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"astro": "^4.1.2",
"astro": "^4.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.0.1",
"astro": "^4.1.2",
"astro": "^4.1.3",
"solid-js": "^1.8.5"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.0.3",
"astro": "^4.1.2",
"astro": "^4.1.3",
"svelte": "^4.2.5"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.0.8",
"astro": "^4.1.2",
"astro": "^4.1.3",
"vue": "^3.3.8"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^7.0.4",
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^7.0.4",
"astro": "^4.1.2",
"astro": "^4.1.3",
"html-minifier": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^7.0.4",
"@astrojs/svelte": "^5.0.3",
"astro": "^4.1.2",
"astro": "^4.1.3",
"svelte": "^4.2.5"
}
}
7 changes: 2 additions & 5 deletions examples/ssr/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ interface Cart {
}>;
}

function getOrigin(request: Request): string {
return new URL(request.url).origin.replace('localhost', '127.0.0.1');
}

async function get<T>(
incomingReq: Request,
endpoint: string,
cb: (response: Response) => Promise<T>
): Promise<T> {
const response = await fetch(`${getOrigin(incomingReq)}${endpoint}`, {
const origin = new URL(incomingReq.url).origin;
const response = await fetch(`${origin}${endpoint}`, {
credentials: 'same-origin',
headers: incomingReq.headers,
});
Expand Down
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2",
"astro": "^4.1.3",
"sass": "^1.69.5",
"sharp": "^0.32.6"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/view-transitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"@astrojs/tailwind": "^5.1.0",
"@astrojs/node": "^7.0.4",
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.8.2",
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^4.0.1",
"astro": "^4.1.2",
"astro": "^4.1.3",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.1.2"
"astro": "^4.1.3"
}
}
Loading

0 comments on commit dd8c15f

Please sign in to comment.