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

[ci] release #3165

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 0 additions & 7 deletions .changeset/dirty-planes-dance.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@astrojs/preact": "^0.1.1",
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"astro": "^1.0.0-beta.15"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@astrojs/lit": "^0.1.2",
"@astrojs/preact": "^0.1.1",
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"@astrojs/solid-js": "^0.1.2",
"@astrojs/svelte": "^0.1.1",
"@astrojs/vue": "^0.1.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview"
},
"devDependencies": {
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"astro": "^1.0.0-beta.15"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/integrations-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@astrojs/lit": "^0.1.2",
"@astrojs/partytown": "^0.1.2",
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"@astrojs/sitemap": "^0.1.0",
"@astrojs/tailwind": "^0.2.0",
"@astrojs/turbolinks": "^0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/subpath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview"
},
"devDependencies": {
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"astro": "^1.0.0-beta.15",
"sass": "^1.50.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@astrojs/markdown-remark": "^0.9.2",
"@astrojs/preact": "^0.1.1",
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"@astrojs/svelte": "^0.1.1",
"@astrojs/vue": "^0.1.3",
"astro": "^1.0.0-beta.15"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@astrojs/preact": "^0.1.1",
"@astrojs/react": "^0.1.0",
"@astrojs/react": "^0.1.1",
"@astrojs/solid-js": "^0.1.2",
"@astrojs/svelte": "^0.1.1",
"@astrojs/vue": "^0.1.3",
Expand Down
6 changes: 6 additions & 0 deletions packages/integrations/deno/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @astrojs/node

## 0.1.2

### Patch Changes

- [#3160](https://github.com/withastro/astro/pull/3160) [`ae9ac5cb`](https://github.com/withastro/astro/commit/ae9ac5cbdceba0687d83d56d9d5f80479ab88710) Thanks [@matthewp](https://github.com/matthewp)! - Allows using React.lazy, Suspense in SSR and with hydration

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/deno",
"description": "Deploy your site to a Deno server",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
vite.resolve = vite.resolve || {};
vite.resolve.alias = vite.resolve.alias || {};
const alias = vite.resolve.alias as Record<string, string>;
alias['react-dom/server'] = 'react-dom/server.browser'
alias['react-dom/server'] = 'react-dom/server.browser';
vite.ssr = {
noExternal: true,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/test/basics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Deno.test({
const html = await resp.text();
assert(html);
const doc = new DOMParser().parseFromString(html, `text/html`);
const div = doc.querySelector("#react");
const div = doc.querySelector('#react');
assert(div, 'div exists');
});
},
Expand Down
6 changes: 6 additions & 0 deletions packages/integrations/netlify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @astrojs/netlify

## 0.3.2

### Patch Changes

- [#3160](https://github.com/withastro/astro/pull/3160) [`ae9ac5cb`](https://github.com/withastro/astro/commit/ae9ac5cbdceba0687d83d56d9d5f80479ab88710) Thanks [@matthewp](https://github.com/matthewp)! - Allows using React.lazy, Suspense in SSR and with hydration

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/netlify/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/netlify",
"description": "Deploy your site to Netlify",
"version": "0.3.1",
"version": "0.3.2",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
vite.resolve = vite.resolve || {};
vite.resolve.alias = vite.resolve.alias || {};
const alias = vite.resolve.alias as Record<string, string>;
alias['react-dom/server'] = 'react-dom/server.browser'
alias['react-dom/server'] = 'react-dom/server.browser';
vite.ssr = {
noExternal: true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ Deno.test({
name: 'Edge Basics',
async fn() {
let close = await runBuild('./fixtures/edge-basic/');
const { default: handler } = await import(
'./fixtures/edge-basic/dist/edge-functions/entry.js'
);
const { default: handler } = await import('./fixtures/edge-basic/dist/edge-functions/entry.js');
const response = await handler(new Request('http://example.com/'));
assertEquals(response.status, 200);
const html = await response.text();
Expand Down
6 changes: 6 additions & 0 deletions packages/integrations/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @astrojs/react

## 0.1.1

### Patch Changes

- [#3160](https://github.com/withastro/astro/pull/3160) [`ae9ac5cb`](https://github.com/withastro/astro/commit/ae9ac5cbdceba0687d83d56d9d5f80479ab88710) Thanks [@matthewp](https://github.com/matthewp)! - Allows using React.lazy, Suspense in SSR and with hydration

## 0.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/react",
"description": "Use React components within Astro",
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
Expand Down
49 changes: 26 additions & 23 deletions packages/integrations/react/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,17 @@ async function renderToStaticMarkup(Component, props, children, metadata) {
let html;
if (metadata && metadata.hydrate) {
html = ReactDOM.renderToString(vnode);
if('renderToReadableStream' in ReactDOM) {
if ('renderToReadableStream' in ReactDOM) {
html = await renderToReadableStreamAsync(vnode);
} else {
html = await renderToPipeableStreamAsync(vnode);
}
} else {
if('renderToReadableStream' in ReactDOM) {
if ('renderToReadableStream' in ReactDOM) {
html = await renderToReadableStreamAsync(vnode);
} else {
html = await renderToStaticNodeStreamAsync(vnode);
}

}
return { html };
}
Expand All @@ -92,16 +91,18 @@ async function renderToPipeableStreamAsync(vnode) {
reject(error);
},
onAllReady() {
stream.pipe(new Writable({
write(chunk, _encoding, callback) {
html += chunk.toString('utf-8');
callback();
},
destroy() {
resolve(html);
}
}));
}
stream.pipe(
new Writable({
write(chunk, _encoding, callback) {
html += chunk.toString('utf-8');
callback();
},
destroy() {
resolve(html);
},
})
);
},
});
});
}
Expand All @@ -111,23 +112,25 @@ async function renderToStaticNodeStreamAsync(vnode) {
let html = '';
return new Promise((resolve) => {
let stream = ReactDOM.renderToStaticNodeStream(vnode);
stream.pipe(new Writable({
write(chunk, _encoding, callback) {
html += chunk.toString('utf-8');
callback();
},
destroy() {
resolve(html);
}
}));
stream.pipe(
new Writable({
write(chunk, _encoding, callback) {
html += chunk.toString('utf-8');
callback();
},
destroy() {
resolve(html);
},
})
);
});
}

async function renderToReadableStreamAsync(vnode) {
const decoder = new TextDecoder();
const stream = await ReactDOM.renderToReadableStream(vnode);
let html = '';
for await(const chunk of stream) {
for await (const chunk of stream) {
html += decoder.decode(chunk);
}
return html;
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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