Version Packages (#543)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
21dc28cb8e
commit
91e11aee2a
26 changed files with 112 additions and 107 deletions
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
#528 Removes unused trapWarn function
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'@astrojs/renderer-react': patch
|
||||
---
|
||||
|
||||
Add react-dom as a knownEntrypoint (speeds up astro startup)
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes livereload on static pages
|
|
@ -1,61 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
**This is a breaking change!**
|
||||
|
||||
Astro props are now accessed from the `Astro.props` global. This change is meant to make prop definitions more ergonomic, leaning into JavaScript patterns you already know (destructuring and defaults). Astro components previously used a prop syntax borrowed from [Svelte](https://svelte.dev/docs#1_export_creates_a_component_prop), but it became clear that this was pretty confusing for most users.
|
||||
|
||||
```diff
|
||||
---
|
||||
+ const { text = 'Hello world!' } = Astro.props;
|
||||
- export let text = 'Hello world!';
|
||||
---
|
||||
|
||||
<div>{text}</div>
|
||||
```
|
||||
|
||||
[Read more about the `.astro` syntax](https://github.com/snowpackjs/astro/blob/main/docs/syntax.md#data-and-props)
|
||||
|
||||
---
|
||||
|
||||
### How do I define what props my component accepts?
|
||||
|
||||
Astro frontmatter scripts are TypeScript! Because of this, we can leverage TypeScript types to define the shape of your props.
|
||||
|
||||
```ts
|
||||
---
|
||||
export interface Props {
|
||||
text?: string;
|
||||
}
|
||||
const { text = 'Hello world!' } = Astro.props as Props;
|
||||
---
|
||||
```
|
||||
|
||||
> **Note** Casting `Astro.props as Props` is a temporary workaround. We expect our Language Server to handle this automatically soon!
|
||||
|
||||
### How do I access props I haven't explicitly defined?
|
||||
|
||||
One of the great things about this change is that it's straight-forward to access _any_ props. Just use `...props`!
|
||||
|
||||
```ts
|
||||
---
|
||||
export interface Props {
|
||||
text?: string;
|
||||
[attr: string]: unknown;
|
||||
}
|
||||
const { text = 'Hello world!', ...props } = Astro.props as Props;
|
||||
---
|
||||
```
|
||||
|
||||
### What about prop validation?
|
||||
|
||||
We considered building prop validation into Astro, but decided to leave that implementation up to you! This way, you can use any set of tools you like.
|
||||
|
||||
```ts
|
||||
---
|
||||
const { text = 'Hello world!' } = Astro.props;
|
||||
|
||||
if (typeof text !== 'string') throw new Error(`Expected "text" to be of type "string" but recieved "${typeof string}"!`);
|
||||
---
|
||||
```
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
'@astrojs/parser': patch
|
||||
---
|
||||
|
||||
Fix #521, allowing `{...spread}` props to work again
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Bugfix: PostCSS errors in internal Snowpack PostCSS plugin
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": ".."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"nanostores": "^0.3.3"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"lint": "prettier --check \"src/**/*.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^0.14.1",
|
||||
"astro": "^0.15.0",
|
||||
"date-fns": "^2.19.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"docsearch.js": "^2.6.3",
|
||||
|
@ -25,7 +25,7 @@
|
|||
"@11ty/eleventy-plugin-syntaxhighlight": "^3.0.4",
|
||||
"@contentful/rich-text-html-renderer": "^14.1.2",
|
||||
"@contentful/rich-text-types": "^14.1.2",
|
||||
"astro": "^0.14.1",
|
||||
"astro": "^0.15.0",
|
||||
"eleventy-plugin-nesting-toc": "^1.2.0",
|
||||
"luxon": "^1.25.0",
|
||||
"markdown-it": "^12.0.2",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"tailwindcss": "^2.1.2",
|
||||
"astro": "^0.14.0"
|
||||
"astro": "^0.15.0"
|
||||
},
|
||||
"snowpack": {
|
||||
"workspaceRoot": "../.."
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# @astrojs/parser
|
||||
|
||||
## 0.15.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 47ac2cc: Fix #521, allowing `{...spread}` props to work again
|
||||
|
||||
## 0.13.10
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@astrojs/parser",
|
||||
"version": "0.13.10",
|
||||
"version": "0.15.0",
|
||||
"author": "Skypack",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
|
|
|
@ -1,5 +1,78 @@
|
|||
# astro
|
||||
|
||||
## 0.15.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- a136c85: **This is a breaking change!**
|
||||
|
||||
Astro props are now accessed from the `Astro.props` global. This change is meant to make prop definitions more ergonomic, leaning into JavaScript patterns you already know (destructuring and defaults). Astro components previously used a prop syntax borrowed from [Svelte](https://svelte.dev/docs#1_export_creates_a_component_prop), but it became clear that this was pretty confusing for most users.
|
||||
|
||||
```diff
|
||||
---
|
||||
+ const { text = 'Hello world!' } = Astro.props;
|
||||
- export let text = 'Hello world!';
|
||||
---
|
||||
|
||||
<div>{text}</div>
|
||||
```
|
||||
|
||||
[Read more about the `.astro` syntax](https://github.com/snowpackjs/astro/blob/main/docs/syntax.md#data-and-props)
|
||||
|
||||
***
|
||||
|
||||
### How do I define what props my component accepts?
|
||||
|
||||
Astro frontmatter scripts are TypeScript! Because of this, we can leverage TypeScript types to define the shape of your props.
|
||||
|
||||
```ts
|
||||
---
|
||||
export interface Props {
|
||||
text?: string;
|
||||
}
|
||||
const { text = 'Hello world!' } = Astro.props as Props;
|
||||
---
|
||||
```
|
||||
|
||||
> **Note** Casting `Astro.props as Props` is a temporary workaround. We expect our Language Server to handle this automatically soon!
|
||||
|
||||
### How do I access props I haven't explicitly defined?
|
||||
|
||||
One of the great things about this change is that it's straight-forward to access _any_ props. Just use `...props`!
|
||||
|
||||
```ts
|
||||
---
|
||||
export interface Props {
|
||||
text?: string;
|
||||
[attr: string]: unknown;
|
||||
}
|
||||
const { text = 'Hello world!', ...props } = Astro.props as Props;
|
||||
---
|
||||
```
|
||||
|
||||
### What about prop validation?
|
||||
|
||||
We considered building prop validation into Astro, but decided to leave that implementation up to you! This way, you can use any set of tools you like.
|
||||
|
||||
```ts
|
||||
---
|
||||
const { text = 'Hello world!' } = Astro.props;
|
||||
|
||||
if (typeof text !== 'string') throw new Error(`Expected "text" to be of type "string" but recieved "${typeof string}"!`);
|
||||
---
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4cd84c6: #528 Removes unused trapWarn function
|
||||
- feb9a31: Fixes livereload on static pages
|
||||
- 47ac2cc: Fix #521, allowing `{...spread}` props to work again
|
||||
- 5629349: Bugfix: PostCSS errors in internal Snowpack PostCSS plugin
|
||||
- Updated dependencies [21dc28c]
|
||||
- Updated dependencies [47ac2cc]
|
||||
- @astrojs/renderer-react@0.1.4
|
||||
- @astrojs/parser@0.15.0
|
||||
|
||||
## 0.14.1
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "astro",
|
||||
"version": "0.14.1",
|
||||
"version": "0.15.0",
|
||||
"author": "Skypack",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
@ -42,10 +42,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdown-support": "0.1.2",
|
||||
"@astrojs/parser": "0.13.10",
|
||||
"@astrojs/parser": "0.15.0",
|
||||
"@astrojs/prism": "0.2.2",
|
||||
"@astrojs/renderer-preact": "0.1.3",
|
||||
"@astrojs/renderer-react": "0.1.3",
|
||||
"@astrojs/renderer-react": "0.1.4",
|
||||
"@astrojs/renderer-svelte": "0.1.1",
|
||||
"@astrojs/renderer-vue": "0.1.3",
|
||||
"@babel/code-frame": "^7.12.13",
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# @astrojs/renderer-react
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 21dc28c: Add react-dom as a knownEntrypoint (speeds up astro startup)
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@astrojs/renderer-react",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"vscode-languageserver-textdocument": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.0",
|
||||
"astro": "^0.15.0",
|
||||
"astro-scripts": "0.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# prettier-plugin-astro
|
||||
|
||||
## 0.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [47ac2cc]
|
||||
- @astrojs/parser@0.15.0
|
||||
|
||||
## 0.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "prettier-plugin-astro",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"main": "index.js",
|
||||
"type": "commonjs",
|
||||
"private": true,
|
||||
|
@ -9,7 +9,7 @@
|
|||
"build": "echo 'build'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/parser": "^0.13.3",
|
||||
"@astrojs/parser": "^0.15.0",
|
||||
"prettier": "^2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
"build": "astro build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^0.14.1"
|
||||
"astro": "^0.15.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue