@kiwa-test/nextjs 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +179 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -3
- package/dist/index.d.ts +49 -3
- package/dist/index.js +170 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -28,18 +28,25 @@ __export(index_exports, {
|
|
|
28
28
|
REDIRECT_SYMBOL: () => REDIRECT_SYMBOL,
|
|
29
29
|
RSC_ERROR_BOUNDARY_SYMBOL: () => RSC_ERROR_BOUNDARY_SYMBOL,
|
|
30
30
|
RSC_REDIRECT_SYMBOL: () => RSC_REDIRECT_SYMBOL,
|
|
31
|
+
applyHmrPatch: () => applyHmrPatch,
|
|
31
32
|
assertMode: () => assertMode,
|
|
32
33
|
captureParallelError: () => captureParallelError,
|
|
33
34
|
collectFidelityCoverage: () => collectFidelityCoverage,
|
|
35
|
+
commitTransition: () => commitTransition,
|
|
36
|
+
completeFastRefresh: () => completeFastRefresh,
|
|
34
37
|
completePartialPrerendering: () => completePartialPrerendering,
|
|
35
38
|
findAll: () => findAll,
|
|
39
|
+
findHmrBoundary: () => findHmrBoundary,
|
|
36
40
|
flushStreamingBoundary: () => flushStreamingBoundary,
|
|
37
41
|
interceptCurrentSegment: () => interceptCurrentSegment,
|
|
38
42
|
interceptParentSegment: () => interceptParentSegment,
|
|
39
43
|
interceptRootCatchall: () => interceptRootCatchall,
|
|
44
|
+
interruptTransition: () => interruptTransition,
|
|
40
45
|
invokeMiddleware: () => invokeMiddleware,
|
|
41
46
|
invokeParallelRoutes: () => invokeParallelRoutes,
|
|
42
47
|
invokeServerAction: () => invokeServerAction,
|
|
48
|
+
markModuleUpdated: () => markModuleUpdated,
|
|
49
|
+
markTransitionPending: () => markTransitionPending,
|
|
43
50
|
middlewareActions: () => middlewareActions,
|
|
44
51
|
navigateSlot: () => navigateSlot,
|
|
45
52
|
openDynamicHole: () => openDynamicHole,
|
|
@@ -55,10 +62,12 @@ __export(index_exports, {
|
|
|
55
62
|
revalidateActionPath: () => revalidateActionPath,
|
|
56
63
|
revalidateActionTag: () => revalidateActionTag,
|
|
57
64
|
setupNextRscEnv: () => setupNextRscEnv,
|
|
65
|
+
startConcurrentTransition: () => startConcurrentTransition,
|
|
58
66
|
startInterceptionRoutes: () => startInterceptionRoutes,
|
|
59
67
|
startParallelRoutesAdvanced: () => startParallelRoutesAdvanced,
|
|
60
68
|
startPartialPrerendering: () => startPartialPrerendering,
|
|
61
69
|
startServerActionAdvanced: () => startServerActionAdvanced,
|
|
70
|
+
startTurbopackHmr: () => startTurbopackHmr,
|
|
62
71
|
submitFormAction: () => submitFormAction,
|
|
63
72
|
textContent: () => textContent
|
|
64
73
|
});
|
|
@@ -427,7 +436,15 @@ var dialect = {
|
|
|
427
436
|
"parallel.default_rendered": "app.parallel.default",
|
|
428
437
|
"parallel.loading_rendered": "app.parallel.loading",
|
|
429
438
|
"parallel.error_boundary_captured": "app.parallel.error",
|
|
430
|
-
"parallel.slot_navigated": "app.parallel.navigate"
|
|
439
|
+
"parallel.slot_navigated": "app.parallel.navigate",
|
|
440
|
+
"turbopack.module_updated": "app.turbopack.module.update",
|
|
441
|
+
"turbopack.hmr_boundary_found": "app.turbopack.hmr.boundary",
|
|
442
|
+
"turbopack.hmr_applied": "app.turbopack.hmr.apply",
|
|
443
|
+
"turbopack.fast_refresh_completed": "app.turbopack.fast-refresh",
|
|
444
|
+
"transition.started": "app.transition.start",
|
|
445
|
+
"transition.pending": "app.transition.pending",
|
|
446
|
+
"transition.interrupted": "app.transition.interrupt",
|
|
447
|
+
"transition.committed": "app.transition.commit"
|
|
431
448
|
},
|
|
432
449
|
"pages-router": {
|
|
433
450
|
"action.form_submitted": "pages.api.form.submit",
|
|
@@ -445,7 +462,15 @@ var dialect = {
|
|
|
445
462
|
"parallel.default_rendered": "pages.slot.default",
|
|
446
463
|
"parallel.loading_rendered": "pages.slot.loading",
|
|
447
464
|
"parallel.error_boundary_captured": "pages.slot.error",
|
|
448
|
-
"parallel.slot_navigated": "pages.slot.navigate"
|
|
465
|
+
"parallel.slot_navigated": "pages.slot.navigate",
|
|
466
|
+
"turbopack.module_updated": "pages.webpack.module.update",
|
|
467
|
+
"turbopack.hmr_boundary_found": "pages.webpack.hmr.boundary",
|
|
468
|
+
"turbopack.hmr_applied": "pages.webpack.hmr.apply",
|
|
469
|
+
"turbopack.fast_refresh_completed": "pages.webpack.fast-refresh",
|
|
470
|
+
"transition.started": "pages.transition.start",
|
|
471
|
+
"transition.pending": "pages.transition.pending",
|
|
472
|
+
"transition.interrupted": "pages.transition.interrupt",
|
|
473
|
+
"transition.committed": "pages.transition.commit"
|
|
449
474
|
},
|
|
450
475
|
"edge-runtime": {
|
|
451
476
|
"action.form_submitted": "edge.action.form.submit",
|
|
@@ -463,7 +488,15 @@ var dialect = {
|
|
|
463
488
|
"parallel.default_rendered": "edge.parallel.default",
|
|
464
489
|
"parallel.loading_rendered": "edge.parallel.loading",
|
|
465
490
|
"parallel.error_boundary_captured": "edge.parallel.error",
|
|
466
|
-
"parallel.slot_navigated": "edge.parallel.navigate"
|
|
491
|
+
"parallel.slot_navigated": "edge.parallel.navigate",
|
|
492
|
+
"turbopack.module_updated": "edge.esbuild.module.update",
|
|
493
|
+
"turbopack.hmr_boundary_found": "edge.esbuild.hmr.boundary",
|
|
494
|
+
"turbopack.hmr_applied": "edge.esbuild.hmr.apply",
|
|
495
|
+
"turbopack.fast_refresh_completed": "edge.esbuild.fast-refresh",
|
|
496
|
+
"transition.started": "edge.transition.start",
|
|
497
|
+
"transition.pending": "edge.transition.pending",
|
|
498
|
+
"transition.interrupted": "edge.transition.interrupt",
|
|
499
|
+
"transition.committed": "edge.transition.commit"
|
|
467
500
|
}
|
|
468
501
|
};
|
|
469
502
|
function providerEventName(target, neutral) {
|
|
@@ -769,6 +802,19 @@ var NEXT_AXIS_TO_EVENTS = {
|
|
|
769
802
|
"parallel.loading_rendered",
|
|
770
803
|
"parallel.error_boundary_captured",
|
|
771
804
|
"parallel.slot_navigated"
|
|
805
|
+
],
|
|
806
|
+
// v1.49 advanced III
|
|
807
|
+
"turbopack-hmr": [
|
|
808
|
+
"turbopack.module_updated",
|
|
809
|
+
"turbopack.hmr_boundary_found",
|
|
810
|
+
"turbopack.hmr_applied",
|
|
811
|
+
"turbopack.fast_refresh_completed"
|
|
812
|
+
],
|
|
813
|
+
"concurrent-transitions": [
|
|
814
|
+
"transition.started",
|
|
815
|
+
"transition.pending",
|
|
816
|
+
"transition.interrupted",
|
|
817
|
+
"transition.committed"
|
|
772
818
|
]
|
|
773
819
|
};
|
|
774
820
|
function collectFidelityCoverage(providers = ["app-router", "pages-router", "edge-runtime"]) {
|
|
@@ -788,6 +834,127 @@ function collectFidelityCoverage(providers = ["app-router", "pages-router", "edg
|
|
|
788
834
|
return { providers, axes, rows };
|
|
789
835
|
}
|
|
790
836
|
|
|
837
|
+
// src/semantics/turbopack-hmr.ts
|
|
838
|
+
function emit5(session, neutralEvent, metadata) {
|
|
839
|
+
const step = {
|
|
840
|
+
neutralEvent,
|
|
841
|
+
providerEvent: providerEventName(session.target, neutralEvent),
|
|
842
|
+
state: session.state,
|
|
843
|
+
amountCents: 0,
|
|
844
|
+
metadata: { sessionId: session.sessionId, ...metadata }
|
|
845
|
+
};
|
|
846
|
+
session.history.push(step);
|
|
847
|
+
return step;
|
|
848
|
+
}
|
|
849
|
+
function startTurbopackHmr(input) {
|
|
850
|
+
if (input.sessionId.length === 0) {
|
|
851
|
+
throw new Error("startTurbopackHmr: sessionId must not be empty");
|
|
852
|
+
}
|
|
853
|
+
return {
|
|
854
|
+
target: input.target,
|
|
855
|
+
sessionId: input.sessionId,
|
|
856
|
+
updatedModuleIds: [],
|
|
857
|
+
boundaryModuleId: null,
|
|
858
|
+
state: "idle",
|
|
859
|
+
history: []
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
function markModuleUpdated(session, moduleId) {
|
|
863
|
+
session.updatedModuleIds.push(moduleId);
|
|
864
|
+
session.state = "updating";
|
|
865
|
+
return emit5(session, "turbopack.module_updated", {
|
|
866
|
+
moduleId,
|
|
867
|
+
updateCount: session.updatedModuleIds.length
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
function findHmrBoundary(session, boundaryModuleId) {
|
|
871
|
+
if (session.state !== "updating") {
|
|
872
|
+
throw new Error(`findHmrBoundary: session is ${session.state}`);
|
|
873
|
+
}
|
|
874
|
+
session.boundaryModuleId = boundaryModuleId;
|
|
875
|
+
session.state = "boundary-found";
|
|
876
|
+
return emit5(session, "turbopack.hmr_boundary_found", { boundaryModuleId });
|
|
877
|
+
}
|
|
878
|
+
function applyHmrPatch(session) {
|
|
879
|
+
if (session.state !== "boundary-found") {
|
|
880
|
+
throw new Error(`applyHmrPatch: session is ${session.state}`);
|
|
881
|
+
}
|
|
882
|
+
session.state = "applied";
|
|
883
|
+
return emit5(session, "turbopack.hmr_applied", {
|
|
884
|
+
updatedModuleCount: session.updatedModuleIds.length
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
function completeFastRefresh(session) {
|
|
888
|
+
if (session.state !== "applied") {
|
|
889
|
+
throw new Error(`completeFastRefresh: session is ${session.state}`);
|
|
890
|
+
}
|
|
891
|
+
session.state = "refresh-completed";
|
|
892
|
+
return emit5(session, "turbopack.fast_refresh_completed", {
|
|
893
|
+
updatedModuleCount: session.updatedModuleIds.length
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
// src/semantics/concurrent-transitions.ts
|
|
898
|
+
function emit6(session, neutralEvent, metadata) {
|
|
899
|
+
const step = {
|
|
900
|
+
neutralEvent,
|
|
901
|
+
providerEvent: providerEventName(session.target, neutralEvent),
|
|
902
|
+
state: session.state,
|
|
903
|
+
amountCents: 0,
|
|
904
|
+
metadata: { transitionId: session.transitionId, ...metadata }
|
|
905
|
+
};
|
|
906
|
+
session.history.push(step);
|
|
907
|
+
return step;
|
|
908
|
+
}
|
|
909
|
+
function startConcurrentTransition(input) {
|
|
910
|
+
if (input.transitionId.length === 0) {
|
|
911
|
+
throw new Error("startConcurrentTransition: transitionId must not be empty");
|
|
912
|
+
}
|
|
913
|
+
const session = {
|
|
914
|
+
target: input.target,
|
|
915
|
+
transitionId: input.transitionId,
|
|
916
|
+
interruptions: 0,
|
|
917
|
+
pendingCount: 0,
|
|
918
|
+
state: "started",
|
|
919
|
+
committedValue: null,
|
|
920
|
+
history: []
|
|
921
|
+
};
|
|
922
|
+
emit6(session, "transition.started", { interruptions: 0 });
|
|
923
|
+
return session;
|
|
924
|
+
}
|
|
925
|
+
function markTransitionPending(session) {
|
|
926
|
+
if (session.state !== "started" && session.state !== "interrupted") {
|
|
927
|
+
throw new Error(`markTransitionPending: session is ${session.state}`);
|
|
928
|
+
}
|
|
929
|
+
session.state = "pending";
|
|
930
|
+
session.pendingCount += 1;
|
|
931
|
+
return emit6(session, "transition.pending", {
|
|
932
|
+
pendingCount: session.pendingCount
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
function interruptTransition(session) {
|
|
936
|
+
if (session.state !== "pending") {
|
|
937
|
+
throw new Error(`interruptTransition: session is ${session.state}`);
|
|
938
|
+
}
|
|
939
|
+
session.state = "interrupted";
|
|
940
|
+
session.interruptions += 1;
|
|
941
|
+
return emit6(session, "transition.interrupted", {
|
|
942
|
+
interruptions: session.interruptions
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
function commitTransition(session, committedValue) {
|
|
946
|
+
if (session.state !== "pending" && session.state !== "started") {
|
|
947
|
+
throw new Error(`commitTransition: session is ${session.state}`);
|
|
948
|
+
}
|
|
949
|
+
session.state = "committed";
|
|
950
|
+
session.committedValue = committedValue;
|
|
951
|
+
return emit6(session, "transition.committed", {
|
|
952
|
+
committedValue,
|
|
953
|
+
totalInterruptions: session.interruptions,
|
|
954
|
+
totalPending: session.pendingCount
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
|
|
791
958
|
// src/real-driver.ts
|
|
792
959
|
var TARGET_KEY_ENV = {
|
|
793
960
|
"app-router": "NEXT_APP_URL",
|
|
@@ -830,18 +997,25 @@ function assertMode(provider, expected, env = process.env) {
|
|
|
830
997
|
REDIRECT_SYMBOL,
|
|
831
998
|
RSC_ERROR_BOUNDARY_SYMBOL,
|
|
832
999
|
RSC_REDIRECT_SYMBOL,
|
|
1000
|
+
applyHmrPatch,
|
|
833
1001
|
assertMode,
|
|
834
1002
|
captureParallelError,
|
|
835
1003
|
collectFidelityCoverage,
|
|
1004
|
+
commitTransition,
|
|
1005
|
+
completeFastRefresh,
|
|
836
1006
|
completePartialPrerendering,
|
|
837
1007
|
findAll,
|
|
1008
|
+
findHmrBoundary,
|
|
838
1009
|
flushStreamingBoundary,
|
|
839
1010
|
interceptCurrentSegment,
|
|
840
1011
|
interceptParentSegment,
|
|
841
1012
|
interceptRootCatchall,
|
|
1013
|
+
interruptTransition,
|
|
842
1014
|
invokeMiddleware,
|
|
843
1015
|
invokeParallelRoutes,
|
|
844
1016
|
invokeServerAction,
|
|
1017
|
+
markModuleUpdated,
|
|
1018
|
+
markTransitionPending,
|
|
845
1019
|
middlewareActions,
|
|
846
1020
|
navigateSlot,
|
|
847
1021
|
openDynamicHole,
|
|
@@ -857,10 +1031,12 @@ function assertMode(provider, expected, env = process.env) {
|
|
|
857
1031
|
revalidateActionPath,
|
|
858
1032
|
revalidateActionTag,
|
|
859
1033
|
setupNextRscEnv,
|
|
1034
|
+
startConcurrentTransition,
|
|
860
1035
|
startInterceptionRoutes,
|
|
861
1036
|
startParallelRoutesAdvanced,
|
|
862
1037
|
startPartialPrerendering,
|
|
863
1038
|
startServerActionAdvanced,
|
|
1039
|
+
startTurbopackHmr,
|
|
864
1040
|
submitFormAction,
|
|
865
1041
|
textContent
|
|
866
1042
|
});
|