@cedarjs/vite 7.0.0-canary.3259 → 7.0.0-rc.123

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.
Files changed (49) hide show
  1. package/dist/buildApp.d.ts.map +1 -1
  2. package/dist/buildApp.js +7 -3
  3. package/dist/buildRouteHooks.d.ts +13 -7
  4. package/dist/buildRouteHooks.d.ts.map +1 -1
  5. package/dist/buildRouteHooks.js +10 -5
  6. package/dist/bundled/react-server-dom-webpack.server.js +29125 -2264
  7. package/dist/devFeServer.js +19 -278
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -4
  11. package/dist/lib/registerFwGlobalsAndShims.js +0 -9
  12. package/dist/middleware/types.d.ts +1 -4
  13. package/dist/middleware/types.d.ts.map +1 -1
  14. package/dist/plugins/vite-plugin-cedar-cell.d.ts +1 -2
  15. package/dist/plugins/vite-plugin-cedar-cell.d.ts.map +1 -1
  16. package/dist/plugins/vite-plugin-cedar-cell.js +11 -30
  17. package/dist/plugins/vite-plugin-cedar-mock-cell-data.d.ts.map +1 -1
  18. package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts +6 -2
  19. package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts.map +1 -1
  20. package/dist/plugins/vite-plugin-handler-als-wrapping.js +7 -4
  21. package/dist/plugins/vite-plugin-rsc-ssr-router-import.d.ts.map +1 -1
  22. package/dist/plugins/vite-plugin-rsc-ssr-router-import.js +2 -2
  23. package/dist/plugins/vite-plugin-rsc-transform-server.d.ts.map +1 -1
  24. package/dist/plugins/vite-plugin-rsc-transform-server.js +0 -4
  25. package/dist/rsc/rscRenderer.d.ts.map +1 -1
  26. package/dist/rsc/rscRenderer.js +5 -19
  27. package/dist/rsc/rscRequestHandler.d.ts +2 -2
  28. package/dist/rsc/rscRequestHandler.d.ts.map +1 -1
  29. package/dist/rsc/rscRequestHandler.js +4 -4
  30. package/dist/runFeServer.js +24 -5
  31. package/dist/streaming/createReactStreamingHandler.d.ts +1 -1
  32. package/dist/streaming/createReactStreamingHandler.d.ts.map +1 -1
  33. package/dist/streaming/createReactStreamingHandler.js +10 -13
  34. package/dist/streaming/streamHelpers.d.ts +3 -8
  35. package/dist/streaming/streamHelpers.d.ts.map +1 -1
  36. package/dist/streaming/streamHelpers.js +32 -50
  37. package/dist/streaming/triggerRouteHooks.d.ts +2 -2
  38. package/dist/streaming/triggerRouteHooks.d.ts.map +1 -1
  39. package/dist/streaming/triggerRouteHooks.js +3 -3
  40. package/package.json +29 -31
  41. package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts +0 -20
  42. package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts.map +0 -1
  43. package/dist/plugins/vite-plugin-cedar-parsed-scalars.js +0 -60
  44. package/dist/rsc/rscWebSocketServer.d.ts +0 -2
  45. package/dist/rsc/rscWebSocketServer.d.ts.map +0 -1
  46. package/dist/rsc/rscWebSocketServer.js +0 -22
  47. package/dist/rsc/utils.d.ts +0 -10
  48. package/dist/rsc/utils.d.ts.map +0 -1
  49. package/dist/rsc/utils.js +0 -21
@@ -1,60 +0,0 @@
1
- import { normalizePath } from "vite";
2
- import { getParsedScalars, getPaths } from "@cedarjs/project-config";
3
- const VIRTUAL_MODULE_ID = "virtual:cedar-parsed-scalars";
4
- const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
5
- const APP_FILE_REGEXP = /web[\\/]src[\\/]App\.(ts|tsx|js|jsx)$/;
6
- const VITEST_WEB_SETUP_FILE_REGEXP = /[\\/]vitest-web\.setup\.(ts|js)$/;
7
- function cedarParsedScalarsPlugin() {
8
- if (Object.keys(getParsedScalars()).length === 0) {
9
- return void 0;
10
- }
11
- return {
12
- name: "cedar-parsed-scalars",
13
- resolveId(id) {
14
- if (id === VIRTUAL_MODULE_ID) {
15
- return RESOLVED_VIRTUAL_MODULE_ID;
16
- }
17
- return null;
18
- },
19
- async load(id) {
20
- if (id !== RESOLVED_VIRTUAL_MODULE_ID) {
21
- return null;
22
- }
23
- this.addWatchFile(getPaths().generated.schema);
24
- const { loadParsedScalarsCacheConfig } = await import("@cedarjs/internal/dist/generate/parsedScalars.js");
25
- const config = loadParsedScalarsCacheConfig();
26
- return `globalThis.__CEDAR__PARSED_SCALARS = ${JSON.stringify(config)}`;
27
- },
28
- transform(code, id) {
29
- if (!APP_FILE_REGEXP.test(id) && !VITEST_WEB_SETUP_FILE_REGEXP.test(id)) {
30
- return null;
31
- }
32
- return `import '${VIRTUAL_MODULE_ID}'
33
- ${code}`;
34
- },
35
- // `this.addWatchFile` in `load` only reruns the virtual module for a
36
- // change to a file it has already watched. The schema doesn't exist yet
37
- // on a clean `cedar dev` (the web server and `cedar-gen-watch` start
38
- // concurrently), so its first appearance is a 'create' event on a path
39
- // nothing has watched yet, and reaches here without an `addWatchFile`
40
- // call ever having registered it. Reload the virtual module for exactly
41
- // that file, on every event type, so the app picks up the first schema
42
- // once `cedar-gen-watch` writes it, the same way it already does for a
43
- // later edit.
44
- hotUpdate(options) {
45
- if (options.file !== normalizePath(getPaths().generated.schema)) {
46
- return;
47
- }
48
- const moduleGraph = this.environment.moduleGraph;
49
- const module = moduleGraph.getModuleById(RESOLVED_VIRTUAL_MODULE_ID);
50
- if (!module) {
51
- return;
52
- }
53
- moduleGraph.invalidateModule(module);
54
- return [module];
55
- }
56
- };
57
- }
58
- export {
59
- cedarParsedScalarsPlugin
60
- };
@@ -1,2 +0,0 @@
1
- export declare function createWebSocketServer(): void;
2
- //# sourceMappingURL=rscWebSocketServer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rscWebSocketServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscWebSocketServer.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,SAwBpC"}
@@ -1,22 +0,0 @@
1
- import WebSocket, { WebSocketServer } from "ws";
2
- function createWebSocketServer() {
3
- const wsServer = new WebSocketServer({ port: 18998 });
4
- wsServer.on("connection", (ws) => {
5
- console.log("A new client connected.");
6
- ws.on("message", (data) => {
7
- const message = data.toString();
8
- console.log("Received message:", message);
9
- wsServer.clients.forEach((client) => {
10
- if (client.readyState === WebSocket.OPEN) {
11
- client.send(message);
12
- }
13
- });
14
- });
15
- ws.on("close", () => {
16
- console.log("A client disconnected.");
17
- });
18
- });
19
- }
20
- export {
21
- createWebSocketServer
22
- };
@@ -1,10 +0,0 @@
1
- import type { default as RSDWServerModule } from 'react-server-dom-webpack/server.edge';
2
- type RSDWServerType = typeof RSDWServerModule;
3
- /**
4
- * This function ensures we load the version of React that's been imported with
5
- * the react-server condition.
6
- */
7
- export declare function importRscReact(): Promise<any>;
8
- export declare function importRsdwServer(): Promise<RSDWServerType>;
9
- export {};
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C;;;GAGG;AACH,wBAAsB,cAAc,iBAQnC;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAUhE"}
package/dist/rsc/utils.js DELETED
@@ -1,21 +0,0 @@
1
- async function importRscReact() {
2
- if (globalThis.__cedarjs__vite_rsc_runtime) {
3
- const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.import("react");
4
- return reactMod.default;
5
- }
6
- return import("react");
7
- }
8
- async function importRsdwServer() {
9
- if (globalThis.__cedarjs__vite_rsc_runtime) {
10
- const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
11
- "react-server-dom-webpack/server.edge"
12
- );
13
- return rsdwServerMod.default;
14
- } else {
15
- return import("react-server-dom-webpack/server.edge");
16
- }
17
- }
18
- export {
19
- importRscReact,
20
- importRsdwServer
21
- };