Skip to content

Commit

Permalink
Merge branch 'main' into feat/remote-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Aug 18, 2023
2 parents 2732ba9 + 4b33a62 commit eb91e6e
Show file tree
Hide file tree
Showing 44 changed files with 2,462 additions and 168 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ module.exports = {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {},
rules: {
'no-mixed-spaces-and-tabs': 'off',
},
settings: {
react: {
pragma: 'h',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"p-retry": "^5.1.1",
"parse-numeric-range": "^1.3.0",
"preact": "^10.16.0",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.8.0",
"prettier": "^3.0.2",
"prettier-plugin-astro": "^0.11.1",
"prompts": "^2.4.2",
"rehype": "^12.0.1",
"remark": "^14.0.2",
Expand Down
104 changes: 23 additions & 81 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ h2.heading {

.header-link {
font-size: 1em;
transition: border-inline-start-color 100ms ease-out, background-color 200ms ease-out;
transition:
border-inline-start-color 100ms ease-out,
background-color 200ms ease-out;
}

a.header-link {
Expand Down
1 change: 0 additions & 1 deletion scripts/lib/translation-status/builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-mixed-spaces-and-tabs */
import dedent from 'dedent-js';
import glob from 'fast-glob';
import fs from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/translation-status/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8" />
Expand Down
4 changes: 3 additions & 1 deletion src/components/Header/ThemeToggleButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

.theme-toggle > label:focus-within {
outline: 2px solid transparent;
box-shadow: 0 0 0 0.08em var(--theme-accent), 0 0 0 0.12em white;
box-shadow:
0 0 0 0.08em var(--theme-accent),
0 0 0 0.12em white;
}

.theme-toggle > label {
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/core-concepts/layouts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function fancyJsHelper() {

Then, your values are available to you through `Astro.props` in your layout, and your MDX content will be injected into the page where your `<slot />` component is written:

```astro "fancyJsHelper" "title"
```astro /{?title}?/ "fancyJsHelper" "{fancyJsHelper()}"
---
// src/layouts/BaseLayout.astro
const { title, fancyJsHelper } = Astro.props;
Expand All @@ -233,7 +233,7 @@ const { title, fancyJsHelper } = Astro.props;

A single Astro layout can be written to receive the `frontmatter` object from `.md` and `.mdx` files, as well as any named props passed from `.astro` files.

In the example below, the layout will display the page title either from an Astro component passing a `title` attribute or from a frontmatter YAML `title` property:
In the example below, the layout will display the page title either from a frontmatter YAML `title` property or from an Astro component passing a `title` attribute:

```astro /{?title}?/ /Astro.props[.a-z]*/
---
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/backend/google-firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ After creating server endpoints for Firestore, your project directory should now
Create the pages that will use the Firestore endpoints:

- `src/pages/add.astro` - will contain a form to add a new friend.
- `src/pages/edit/[id].ts` - will contain a form to edit a friend and a button to delete a friend.
- `src/pages/friend/[id].ts` - will contain the details of a friend.
- `src/pages/edit/[id].astro` - will contain a form to edit a friend and a button to delete a friend.
- `src/pages/friend/[id].astro` - will contain the details of a friend.
- `src/pages/dashboard.astro` - will display a list of friends.

#### Add a new record
Expand Down
5 changes: 2 additions & 3 deletions src/content/docs/en/guides/deploy/cloudflare.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ To get started, you will need:
- **Framework preset**: `Astro`
- **Build command:** `npm run build`
- **Build output directory:** `dist`
- **Environment variables (advanced)**: By default, Cloudflare Pages uses Node.js 12.18.0, but Astro [requires a higher version](/en/install/auto/#prerequisites). Add an environment variable with a **Variable name** of `NODE_VERSION` and a **Value** of `v16.13.0` or higher to tell Cloudflare to use a compatible Node version. Alternatively, add a `.nvmrc` file to your project to specify a Node version.

7. Click the **Save and Deploy** button.

Expand Down Expand Up @@ -109,9 +108,9 @@ If you prefer to install the adapter manually instead, complete the following tw

### Modes

There are currently two modes supported when using Pages Functions with the [`@astrojs/cloudflare`](https://github.com/withastro/astro/tree/main/packages/integrations/cloudflare#readme) adapter.
There are currently two modes supported when using Pages Functions with the [`@astrojs/cloudflare`](https://github.com/withastro/astro/tree/main/packages/integrations/cloudflare#readme) adapter.

1. **Advanced** mode: This mode is used when you want to run your function in `advanced` mode which picks up the `_worker.js` in `dist`, or a directory mode where pages will compile the worker out of a functions folder in the project root.
1. **Advanced** mode: This mode is used when you want to run your function in `advanced` mode which picks up the `_worker.js` in `dist`, or a directory mode where pages will compile the worker out of a functions folder in the project root.

If no mode is set, the default is `"advanced"`.

Expand Down
40 changes: 40 additions & 0 deletions src/content/docs/en/guides/integrations-guide/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,46 @@ To use your first React component in Astro, head to our [UI framework documentat
* 💧 client-side hydration options, and
* 🤝 opportunities to mix and nest frameworks together

## Options

### Children parsing

Children passed into a React component from an Astro component are parsed as plain strings, not React nodes.

For example, the `<ReactComponent />` below will only receive a single child element:

```astro
---
import ReactComponent from './ReactComponent';
---
<ReactComponent>
<div>one</div>
<div>two</div>
</ReactComponent>
```

If you are using a library that *expects* more than one child element element to be passed, for example so that it can slot certain elements in different places, you might find this to be a blocker.

You can set the experimental flag `experimentalReactChildren` to tell Astro to always pass children to React as React vnodes. There is some runtime cost to this, but it can help with compatibility.

You can enable this option in the configuration for the React integration:

```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';

export default defineConfig({
// ...
integrations: [
react({
experimentalReactChildren: true,
}),
],
});
```

## Troubleshooting

For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help!
Expand Down
Loading

0 comments on commit eb91e6e

Please sign in to comment.