Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP [Content Collections] Fix script bleed in prod builds #6047

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0577e4e
wip: store propagated scripts separately
bholmesdev Jan 30, 2023
d556df7
chore: clarify analyzer comments
bholmesdev Jan 30, 2023
6e904db
chore: stray console logs
bholmesdev Jan 30, 2023
7f4529f
chore: unskip
bholmesdev Jan 30, 2023
0f007f3
Handle invalid argument errors (#6045)
natemoo-re Jan 30, 2023
7418ce4
[ci] format
natemoo-re Jan 30, 2023
7de72f3
[ci] release (#6041)
astrobot-houston Jan 30, 2023
dc37849
Fix `GetPictureResult` interface (#5894)
ralacerda Jan 30, 2023
c54a115
fix(image): allow usage of image from any directory (#5932)
rasendubi Jan 30, 2023
31820e4
[ci] format
matthewp Jan 30, 2023
bbe50ec
error overlay: show `cause` if available (#6052)
mayank99 Jan 31, 2023
680e235
[ci] format
Princesseuh Jan 31, 2023
0c3c216
Revert MDX README changes (#6062)
delucis Jan 31, 2023
81f6ece
Wrap tag in example error message in code backticks (#6063)
delucis Jan 31, 2023
6daf548
Correct usage of `getImage` function (#6068)
MoustaphaDev Jan 31, 2023
9af39e7
[MDX] Syntax highlighting after user plugins (#6050)
bholmesdev Jan 31, 2023
6a4262f
Add links to sharp docs in @astro/image README (#6017)
buk0vec Feb 1, 2023
4f5b224
Add required `alt` to Picture example (#6074)
BryceRussell Feb 1, 2023
6386abd
Add JSDOC `@message` to fix docs error pages (#6076)
yanthomasdev Feb 1, 2023
262a24b
[Lit] Fix hydration not having the same reactive values as server (#6…
e111077 Feb 1, 2023
7747f00
[ci] format
matthewp Feb 1, 2023
1126c75
fix: Failed to execute 'encode' on 'TextEncoder': parameter 1 is not …
AirBorne04 Feb 1, 2023
a784e60
[ci] format
bholmesdev Feb 1, 2023
80dc1a5
[Content collections] Apply MDX components on render (#6064)
bholmesdev Feb 1, 2023
7944d28
[ci] update lockfile (#6060)
astrobot-houston Feb 1, 2023
b5c6a93
[Lit] Forwards compatiblity for streaming Declarative Shadow DOM (#6055)
e111077 Feb 1, 2023
095158b
[ci] format
matthewp Feb 1, 2023
e88ea2c
[ci] release (#6048)
astrobot-houston Feb 1, 2023
a84e934
Fix incorrent encoded when path has other language characters (#6088)
QingXia-Ela Feb 1, 2023
af4dc9f
Move @netlify/functions to be a dep (#6090)
matthewp Feb 1, 2023
2934c3a
[ci] release (#6089)
astrobot-houston Feb 1, 2023
39aae03
fix: solidjs integration for vercel edge build (adopting same mechani…
AirBorne04 Feb 1, 2023
a342882
[ci] format
bholmesdev Feb 1, 2023
631a773
[ci] update lockfile (#6100)
astrobot-houston Feb 2, 2023
cd425bf
chore: bump vitefu for @astrojs/solid-js (#6104)
yasserhennawi Feb 2, 2023
c8d601e
Prevent eager rendering of head content in multi-level MDX layout (#6…
matthewp Feb 2, 2023
ac487a4
[ci] format
matthewp Feb 2, 2023
a1966ff
[ci] release (#6094)
astrobot-houston Feb 2, 2023
331e394
Upgrade preact's dependencies to fix security issue (#6108)
matthewp Feb 2, 2023
3ec76dc
Node adapter: handle prerendering and serving with query params (#6110)
matthewp Feb 3, 2023
f4cb1b7
[ci] format
matthewp Feb 3, 2023
d04dbdf
[ci] release (#6109)
astrobot-houston Feb 3, 2023
91b3307
Fix scanning sourcemap handling (#6114)
bluwy Feb 3, 2023
ffd09a9
Refactor build into plugins (#6077)
matthewp Feb 3, 2023
f1b42d8
[ci] format
matthewp Feb 3, 2023
70342a8
[ci] update lockfile (#6115)
astrobot-houston Feb 3, 2023
5885a7e
updated
matthewp Feb 3, 2023
0ae1c91
chore: clarify analyzer comments
bholmesdev Jan 30, 2023
0d57caf
Implement getting hoisted scripts for propagation
matthewp Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-flies-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix sourcemap generation when scanning files
5 changes: 0 additions & 5 deletions .changeset/long-boats-perform.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-actors-switch.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": "^2.0.3"
"astro": "^2.0.6"
}
}
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"@astrojs/mdx": "^0.15.2",
"astro": "^2.0.6",
"@astrojs/mdx": "^0.16.0",
"@astrojs/rss": "^2.1.0",
"@astrojs/sitemap": "^1.0.1"
}
Expand Down
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": "^2.0.3"
"astro": "^2.0.6"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3"
"astro": "^2.0.6"
},
"devDependencies": {
"@astrojs/deno": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"@astrojs/react": "^2.0.2",
"@astrojs/preact": "^2.0.1",
"@astrojs/preact": "^2.0.2",
"@algolia/client-search": "^4.13.1",
"@docsearch/css": "^3.1.0",
"@docsearch/react": "^3.1.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 @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"alpinejs": "^3.10.2",
"@astrojs/alpinejs": "^0.1.3",
"@types/alpinejs": "^3.7.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"lit": "^2.2.5",
"@astrojs/lit": "^1.1.1",
"@astrojs/lit": "^1.1.2",
"@webcomponents/template-shadowroot": "^0.1.0"
}
}
6 changes: 3 additions & 3 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"solid-js": "^1.4.3",
"svelte": "^3.48.0",
"vue": "^3.2.37",
"@astrojs/preact": "^2.0.1",
"@astrojs/preact": "^2.0.2",
"@astrojs/react": "^2.0.2",
"@astrojs/solid-js": "^2.0.1",
"@astrojs/solid-js": "^2.0.2",
"@astrojs/svelte": "^2.0.1",
"@astrojs/vue": "^2.0.1"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"preact": "^10.7.3",
"@astrojs/preact": "^2.0.1",
"@astrojs/preact": "^2.0.2",
"@preact/signals": "^1.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"@astrojs/react": "^2.0.2",
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"solid-js": "^1.4.3",
"@astrojs/solid-js": "^2.0.1"
"@astrojs/solid-js": "^2.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"svelte": "^3.48.0",
"@astrojs/svelte": "^2.0.1",
"astro": "^2.0.3"
"astro": "^2.0.6"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"vue": "^3.2.37",
"@astrojs/vue": "^2.0.1"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^5.0.1",
"astro": "^2.0.3"
"@astrojs/node": "^5.0.3",
"astro": "^2.0.6"
}
}
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": "^2.0.3"
"astro": "^2.0.6"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
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": "^2.0.3"
"astro": "^2.0.6"
}
}
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": "^2.0.3"
"astro": "^2.0.6"
}
}
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": "^2.0.3"
"astro": "^2.0.6"
}
}
4 changes: 2 additions & 2 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"svelte": "^3.48.0",
"@astrojs/svelte": "^2.0.1",
"@astrojs/node": "^5.0.1",
"@astrojs/node": "^5.0.3",
"concurrently": "^7.2.1",
"unocss": "^0.15.6",
"vite-imagetools": "^4.0.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"@astrojs/markdown-remark": "^2.0.1",
"hast-util-select": "5.0.1",
"rehype-autolink-headings": "^6.1.1",
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": "^2.0.3"
"astro": "^2.0.6"
}
}
6 changes: 3 additions & 3 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"preact": "^10.6.5",
"@astrojs/preact": "^2.0.1",
"@astrojs/mdx": "^0.15.2"
"@astrojs/preact": "^2.0.2",
"@astrojs/mdx": "^0.16.0"
}
}
4 changes: 2 additions & 2 deletions examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"preact": "^10.7.3",
"@astrojs/preact": "^2.0.1",
"@astrojs/preact": "^2.0.2",
"nanostores": "^0.5.12",
"@nanostores/preact": "^0.1.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^0.15.2",
"@astrojs/mdx": "^0.16.0",
"@astrojs/tailwind": "^3.0.1",
"@types/canvas-confetti": "^1.4.3",
"astro": "^2.0.3",
"astro": "^2.0.6",
"autoprefixer": "^10.4.7",
"canvas-confetti": "^1.5.1",
"postcss": "^8.4.14",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vite-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"vite-plugin-pwa": "0.11.11",
"workbox-window": "^6.5.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^2.0.3",
"astro": "^2.0.6",
"vitest": "^0.20.3"
}
}
26 changes: 26 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# astro

## 2.0.6

### Patch Changes

- [#6107](https://github.com/withastro/astro/pull/6107) [`9bec6bc41`](https://github.com/withastro/astro/commit/9bec6bc410f324a41c67e5d185fa86f78d7625f2) Thanks [@matthewp](https://github.com/matthewp)! - Fixes head contents being placed in body in MDX components

## 2.0.5

### Patch Changes

- [#6052](https://github.com/withastro/astro/pull/6052) [`9793f19ec`](https://github.com/withastro/astro/commit/9793f19ecd4e64cbf3140454fe52aeee2c22c8c9) Thanks [@mayank99](https://github.com/mayank99)! - Error overlay will now show the error's `cause` if available.

- [#6070](https://github.com/withastro/astro/pull/6070) [`f91615f5c`](https://github.com/withastro/astro/commit/f91615f5c04fde36f115dad9110dd75254efd61d) Thanks [@AirBorne04](https://github.com/AirBorne04)! - \* safe guard against TextEncode.encode(HTMLString) [errors on vercel edge]

- safe guard against html.replace when html is undefined

- [#6064](https://github.com/withastro/astro/pull/6064) [`2fb72c887`](https://github.com/withastro/astro/commit/2fb72c887f71c0a69ab512870d65b8c867774766) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Apply MDX `components` export when rendering as a content collection entry

## 2.0.4

### Patch Changes

- [#6045](https://github.com/withastro/astro/pull/6045) [`41e97158b`](https://github.com/withastro/astro/commit/41e97158ba90d23d346b6e3ff6c7c14b5ecbe903) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Improve error handling when an Astro component is rendered manually

- [#6036](https://github.com/withastro/astro/pull/6036) [`e779c6242`](https://github.com/withastro/astro/commit/e779c6242418d1d4102e683ca5b851b764c89688) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Improve error handling when top-level `return` is present

## 2.0.3

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { LitElement, html } from 'lit';

export default class NonDeferredCounter extends LitElement {
static get properties() {
return {
count: {
type: Number,
// All set properties are reflected to attributes so its hydration is
// not deferred.
reflect: true,
},
};
}

constructor() {
super();
this.count = 0;
}

increment() {
this.count++;
}

render() {
return html`
<div>
<p>Count: ${this.count}</p>

<button type="button" @click=${this.increment}>Increment</button>
</div>
`;
}
}

customElements.define('non-deferred-counter', NonDeferredCounter);
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
import MyCounter from '../components/Counter.js';
import NonDeferredCounter from '../components/NonDeferredCounter.js';

const someProps = {
count: 0,
count: 10,
};
---

Expand All @@ -15,6 +16,9 @@ const someProps = {
<h1>Hello, client:idle!</h1>
</MyCounter>

<NonDeferredCounter id="non-deferred" client:idle {...someProps}>
</NonDeferredCounter>

<MyCounter id="client-load" {...someProps} client:load>
<h1>Hello, client:load!</h1>
</MyCounter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MyCounter from '../components/Counter.js';

const someProps = {
count: 0,
count: 10,
};
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MyCounter from '../components/Counter.js';

const someProps = {
count: 0,
count: 10,
};
---

Expand Down
Loading