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/*",
|
||||
"examples/*",
|
||||
"examples/component/demo",
|
||||
"examples/component/packages/*",
|
||||
"scripts",
|
||||
"packages/astro/test/fixtures/component-library-shared",
|
||||
"packages/astro/test/fixtures/custom-elements/my-component-lib",
|
||||
|
|
|
@ -144,10 +144,17 @@ async function readResult(stream) {
|
|||
let result = '';
|
||||
const decoder = new TextDecoder('utf-8')
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
return result;
|
||||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
if(value) {
|
||||
result += decoder.decode(value);
|
||||
} else {
|
||||
// This closes the decoder
|
||||
decoder.decode(new Uint8Array());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
result += decoder.decode(value, { stream: true });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue