Make React integration work with Deno (#4679)
* Remove removed packages folder * fix * Add a changeset
This commit is contained in:
parent
9290b24143
commit
5986517b4f
3 changed files with 16 additions and 5 deletions
5
.changeset/orange-llamas-play.md
Normal file
5
.changeset/orange-llamas-play.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Prevent decoder from leaking
|
|
@ -32,7 +32,6 @@
|
||||||
"packages/*",
|
"packages/*",
|
||||||
"examples/*",
|
"examples/*",
|
||||||
"examples/component/demo",
|
"examples/component/demo",
|
||||||
"examples/component/packages/*",
|
|
||||||
"scripts",
|
"scripts",
|
||||||
"packages/astro/test/fixtures/component-library-shared",
|
"packages/astro/test/fixtures/component-library-shared",
|
||||||
"packages/astro/test/fixtures/custom-elements/my-component-lib",
|
"packages/astro/test/fixtures/custom-elements/my-component-lib",
|
||||||
|
|
|
@ -144,10 +144,17 @@ async function readResult(stream) {
|
||||||
let result = '';
|
let result = '';
|
||||||
const decoder = new TextDecoder('utf-8')
|
const decoder = new TextDecoder('utf-8')
|
||||||
while (true) {
|
while (true) {
|
||||||
const { done, value } = await reader.read();
|
const { done, value } = await reader.read();
|
||||||
if (done) {
|
if (done) {
|
||||||
return result;
|
if(value) {
|
||||||
}
|
result += decoder.decode(value);
|
||||||
|
} else {
|
||||||
|
// This closes the decoder
|
||||||
|
decoder.decode(new Uint8Array());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
result += decoder.decode(value, { stream: true });
|
result += decoder.decode(value, { stream: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue