Skip to content

Commit 11d6e46

Browse files
committed
test(rsc-mf): cover inline export type-only and mixed bindings
1 parent 6d2e37d commit 11d6e46

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { type incrementRemoteCount, remoteActionEcho } from './actions';
2+
3+
export const EXPORT_INLINE_MIXED_ACTION_BRIDGE =
4+
'export-inline-mixed-action-bridge';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// biome-ignore lint/style/useExportType: keep inline type-only syntax for parser coverage
2+
export { type incrementRemoteCount } from './actions';
3+
4+
export const EXPORT_INLINE_TYPE_ONLY_ACTION_BRIDGE =
5+
'export-inline-type-only-action-bridge';

tests/integration/rsc-mf/tests/createRscExposeDefinitions.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,21 @@ describe('createRscExposeDefinitions', () => {
456456
});
457457
});
458458

459+
it('does not infer callback bootstrap from inline type-only named re-export clauses', () => {
460+
const { createRscExposeDefinitions } = loadCreateRscExposeDefinitions();
461+
expect(
462+
createRscExposeDefinitions({
463+
'./customExportInlineTypeOnlyActionBridge':
464+
'./src/components/exportInlineTypeOnlyActionBridge.ts',
465+
}),
466+
).toEqual({
467+
'./customExportInlineTypeOnlyActionBridge': {
468+
import: ['./src/components/exportInlineTypeOnlyActionBridge.ts'],
469+
layer: 'react-server-components',
470+
},
471+
});
472+
});
473+
459474
it('infers callback bootstrap when import clause includes runtime bindings', () => {
460475
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
461476
loadCreateRscExposeDefinitions();
@@ -494,6 +509,25 @@ describe('createRscExposeDefinitions', () => {
494509
});
495510
});
496511

512+
it('infers callback bootstrap from mixed inline export clauses with runtime bindings', () => {
513+
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
514+
loadCreateRscExposeDefinitions();
515+
expect(
516+
createRscExposeDefinitions({
517+
'./customExportInlineMixedActionBridge':
518+
'./src/components/exportInlineMixedActionBridge.ts',
519+
}),
520+
).toEqual({
521+
'./customExportInlineMixedActionBridge': {
522+
import: [
523+
CALLBACK_BOOTSTRAP_MODULE,
524+
'./src/components/exportInlineMixedActionBridge.ts',
525+
],
526+
layer: 'react-server-components',
527+
},
528+
});
529+
});
530+
497531
it('infers callback bootstrap from local side-effect imports of action modules', () => {
498532
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
499533
loadCreateRscExposeDefinitions();

0 commit comments

Comments
 (0)