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

fix (ai/rsc): "could not find InternalStreamableUIClient" bug #2068

Merged
merged 6 commits into from
Jun 24, 2024
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
5 changes: 5 additions & 0 deletions .changeset/smart-trainers-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ai': patch
---

fix (ai/rsc): "could not find InternalStreamableUIClient" bug
91 changes: 91 additions & 0 deletions packages/core/rsc/__snapshots__/streamable.ui.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`rsc - render() > should emit React Nodes with async render function 1`] = `
{
"children": {
"children": {},
"props": {
"c": undefined,
"n": {
"done": false,
"next": {
"done": true,
"value": <div>
Weather
</div>,
},
"value": <div>
Weather
</div>,
},
},
"type": "",
},
"props": {
"fallback": undefined,
},
"type": "Symbol(react.suspense)",
}
`;

exports[`rsc - render() > should emit React Nodes with generator render function 1`] = `
{
"children": {
"children": {},
"props": {
"c": undefined,
"n": {
"done": false,
"next": {
"done": false,
"next": {
"done": true,
"value": <div>
Weather
</div>,
},
"value": <div>
Weather
</div>,
},
"value": <div>
Loading...
</div>,
},
},
"type": "",
},
"props": {
"fallback": undefined,
},
"type": "Symbol(react.suspense)",
}
`;

exports[`rsc - render() > should emit React Nodes with sync render function 1`] = `
{
"children": {
"children": {},
"props": {
"c": undefined,
"n": {
"done": false,
"next": {
"done": true,
"value": <div>
Weather
</div>,
},
"value": <div>
Weather
</div>,
},
},
"type": "",
},
"props": {
"fallback": undefined,
},
"type": "Symbol(react.suspense)",
}
`;
1 change: 0 additions & 1 deletion packages/core/rsc/rsc-shared.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ export {
useActions,
useSyncUIState,
InternalAIProvider,
InternalStreamableUIClient,
} from './shared-client';
56 changes: 0 additions & 56 deletions packages/core/rsc/shared-client/client-wrapper.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/rsc/shared-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ export {
useSyncUIState,
InternalAIProvider,
} from './context';
export { InternalStreamableUIClient } from './client-wrapper';
15 changes: 1 addition & 14 deletions packages/core/rsc/shared-client/streamable.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ReactElement,
startTransition,
useLayoutEffect,
useState,
} from 'react';
import { startTransition, useLayoutEffect, useState } from 'react';
import { STREAMABLE_VALUE_TYPE } from '../constants';
import type { StreamableValue } from '../types';

Expand Down Expand Up @@ -102,14 +97,6 @@ export function readStreamableValue<T = unknown>(
(curr as string) = curr + row.diff[1];
}
break;
case 1:
(curr as ReactElement) = (
<>
{curr}
{row.diff[1]}
</>
);
break;
}
} else {
curr = row.curr;
Expand Down
Loading
Loading