create-plasmic-app 0.0.142 → 0.0.144

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 (87) hide show
  1. package/cpa-out/gatsby-codegen-js/package.json +2 -2
  2. package/cpa-out/gatsby-codegen-js/plasmic.json +2 -2
  3. package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +1 -0
  4. package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +1 -0
  5. package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +7 -2
  6. package/cpa-out/gatsby-codegen-ts/package.json +2 -2
  7. package/cpa-out/gatsby-codegen-ts/plasmic.json +2 -2
  8. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  9. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +1 -0
  10. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +7 -2
  11. package/cpa-out/gatsby-loader-js/package.json +1 -1
  12. package/cpa-out/gatsby-loader-ts/package.json +1 -1
  13. package/cpa-out/nextjs-app-codegen-js/app/dynamic/[slug]/page.jsx +11 -3
  14. package/cpa-out/nextjs-app-codegen-js/app/layout.jsx +3 -4
  15. package/cpa-out/nextjs-app-codegen-js/app/page.jsx +4 -3
  16. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +1 -0
  17. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +1 -0
  18. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.jsx +1 -1
  19. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +7 -2
  20. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepageServer.jsx +1 -1
  21. package/cpa-out/nextjs-app-codegen-js/package.json +2 -2
  22. package/cpa-out/nextjs-app-codegen-js/plasmic-init-client.jsx +16 -0
  23. package/cpa-out/nextjs-app-codegen-js/plasmic.json +2 -2
  24. package/cpa-out/nextjs-app-codegen-ts/app/dynamic/[slug]/page.tsx +12 -4
  25. package/cpa-out/nextjs-app-codegen-ts/app/layout.tsx +3 -4
  26. package/cpa-out/nextjs-app-codegen-ts/app/page.tsx +4 -4
  27. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  28. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +1 -0
  29. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.tsx +1 -1
  30. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +7 -2
  31. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepageServer.tsx +1 -1
  32. package/cpa-out/nextjs-app-codegen-ts/package.json +2 -2
  33. package/cpa-out/nextjs-app-codegen-ts/plasmic-init-client.tsx +17 -0
  34. package/cpa-out/nextjs-app-codegen-ts/plasmic.json +2 -2
  35. package/cpa-out/nextjs-app-loader-js/package.json +1 -1
  36. package/cpa-out/nextjs-app-loader-js/plasmic-init-client.jsx +2 -40
  37. package/cpa-out/nextjs-app-loader-js/plasmic-init.js +5 -0
  38. package/cpa-out/nextjs-app-loader-ts/package.json +1 -1
  39. package/cpa-out/nextjs-app-loader-ts/plasmic-init-client.tsx +2 -40
  40. package/cpa-out/nextjs-app-loader-ts/plasmic-init.ts +5 -0
  41. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +1 -0
  42. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +1 -0
  43. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +7 -2
  44. package/cpa-out/nextjs-pages-codegen-js/package.json +2 -2
  45. package/cpa-out/nextjs-pages-codegen-js/plasmic.json +2 -2
  46. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  47. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +1 -0
  48. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +7 -2
  49. package/cpa-out/nextjs-pages-codegen-ts/package.json +2 -2
  50. package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +2 -2
  51. package/cpa-out/nextjs-pages-loader-js/package.json +1 -1
  52. package/cpa-out/nextjs-pages-loader-ts/package.json +1 -1
  53. package/cpa-out/react-codegen-js/package.json +2 -2
  54. package/cpa-out/react-codegen-js/plasmic.json +2 -2
  55. package/cpa-out/react-codegen-ts/package.json +2 -2
  56. package/cpa-out/react-codegen-ts/plasmic.json +2 -2
  57. package/cpa-out/tanstack-codegen-ts/package.json +7 -8
  58. package/cpa-out/tanstack-codegen-ts/plasmic.json +2 -2
  59. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -5
  60. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +1 -2
  61. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +7 -5
  62. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +2 -0
  63. package/cpa-out/tanstack-codegen-ts/src/router.tsx +0 -1
  64. package/cpa-out/tanstack-codegen-ts/tsconfig.json +0 -1
  65. package/cpa-out/tanstack-codegen-ts/vite.config.ts +1 -2
  66. package/dist/nextjs/nextjs.js +7 -2
  67. package/dist/nextjs/templates/app-codegen/layout.js +3 -4
  68. package/dist/nextjs/templates/app-codegen/plasmic-init-client.d.ts +2 -0
  69. package/dist/nextjs/templates/app-codegen/plasmic-init-client.js +24 -0
  70. package/dist/nextjs/templates/app-loader/plasmic-init-client.js +2 -40
  71. package/dist/nextjs/templates/app-loader/plasmic-init.js +0 -5
  72. package/dist/tanstack/tanstack.js +11 -1
  73. package/package.json +2 -2
  74. package/src/nextjs/nextjs.ts +10 -0
  75. package/src/nextjs/templates/app-codegen/layout.ts +3 -4
  76. package/src/nextjs/templates/app-codegen/plasmic-init-client.ts +28 -0
  77. package/src/nextjs/templates/app-loader/plasmic-init-client.ts +2 -40
  78. package/src/nextjs/templates/app-loader/plasmic-init.ts +0 -5
  79. package/src/tanstack/tanstack.ts +11 -1
  80. package/cpa-out/nextjs-app-codegen-js/app/layout.js +0 -28
  81. package/cpa-out/tanstack-codegen-ts/src/components/Footer.tsx +0 -44
  82. package/cpa-out/tanstack-codegen-ts/src/components/Header.tsx +0 -78
  83. package/cpa-out/tanstack-codegen-ts/src/components/ThemeToggle.tsx +0 -81
  84. /package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.jsx → PlasmicIcon__CheckSvg.jsx} +0 -0
  85. /package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.tsx → PlasmicIcon__CheckSvg.tsx} +0 -0
  86. /package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.jsx → PlasmicIcon__CheckSvg.jsx} +0 -0
  87. /package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.tsx → PlasmicIcon__CheckSvg.tsx} +0 -0
@@ -13,48 +13,10 @@ import { PLASMIC } from "@/plasmic-init";
13
13
  // PLASMIC.registerComponent(...);
14
14
 
15
15
  /**
16
- * ClientPlasmicRootProvider is a Client Component that passes in the loader for you.
16
+ * ClientPlasmicRootProvider is a Client Component that passes the loader to PlasmicRootProvider.
17
17
  *
18
- * Why? Props passed from Server to Client Components must be serializable.
18
+ * Props passed from a Server Component to a Client Component must be serializable.
19
19
  * https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
20
- * However, PlasmicRootProvider requires a loader, but the loader is NOT serializable.
21
- *
22
- * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
23
- *
24
- * ```tsx
25
- * import { PLASMIC } from "@/plasmic-init";
26
- * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
27
- * export default function MyPage() {
28
- * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
29
- * return (
30
- * <PlasmicRootProvider
31
- * loader={PLASMIC} // ERROR: loader is not serializable
32
- * prefetchedData={prefetchedData}
33
- * >
34
- * {yourContent()}
35
- * </PlasmicRootProvider>;
36
- * );
37
- * }
38
- * ```
39
- *
40
- * Therefore, we define ClientPlasmicRootProvider as a Client Component (this file is marked "use client").
41
- * ClientPlasmicRootProvider wraps the PlasmicRootProvider and passes in the loader for you,
42
- * while allowing your Server Component to pass in prefetched data and other serializable props:
43
- *
44
- * ```tsx
45
- * import { PLASMIC } from "@/plasmic-init";
46
- * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
47
- * export default function MyPage() {
48
- * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
49
- * return (
50
- * <ClientPlasmicRootProvider // don't pass in loader
51
- * prefetchedData={prefetchedData}
52
- * >
53
- * {yourContent()}
54
- * </ClientPlasmicRootProvider>;
55
- * );
56
- * }
57
- * ```
58
20
  */
59
21
  export function ClientPlasmicRootProvider(
60
22
  props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "loader">
@@ -19,3 +19,8 @@ export const PLASMIC = initPlasmicLoader({
19
19
  // only use this for development, as this is significantly slower.
20
20
  preview: false,
21
21
  });
22
+
23
+ // Register custom functions here so they are available during SSR.
24
+ // See https://docs.plasmic.app/learn/registering-custom-functions/
25
+ //
26
+ // PLASMIC.registerFunction(...);
@@ -146,6 +146,7 @@ function PlasmicButton__RenderFunc(props) {
146
146
  className={classNames(
147
147
  projectcss.all,
148
148
  projectcss.button,
149
+ projectcss.button__47tFX,
149
150
  projectcss.root_reset,
150
151
  projectcss.plasmic_default_styles,
151
152
  projectcss.plasmic_mixins,
@@ -123,6 +123,7 @@ function PlasmicDynamicPage__RenderFunc(props) {
123
123
  className={classNames(
124
124
  projectcss.all,
125
125
  projectcss.h1,
126
+ projectcss.h1__47tFX,
126
127
  projectcss.__wab_text,
127
128
  sty.h1
128
129
  )}
@@ -126,6 +126,7 @@ function PlasmicHomepage__RenderFunc(props) {
126
126
  className={classNames(
127
127
  projectcss.all,
128
128
  projectcss.h1,
129
+ projectcss.h1__47tFX,
129
130
  projectcss.__wab_text,
130
131
  sty.h1
131
132
  )}
@@ -149,7 +150,9 @@ function PlasmicHomepage__RenderFunc(props) {
149
150
  }
150
151
  </React.Fragment>
151
152
  <span
152
- className={"plasmic_default__all plasmic_default__span"}
153
+ className={
154
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
155
+ }
153
156
  style={{ fontWeight: 700 }}
154
157
  >
155
158
  {"Therefore, please avoid changing this project."}
@@ -163,7 +166,9 @@ function PlasmicHomepage__RenderFunc(props) {
163
166
  }
164
167
  </React.Fragment>
165
168
  <span
166
- className={"plasmic_default__all plasmic_default__span"}
169
+ className={
170
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
171
+ }
167
172
  style={{ fontWeight: 700 }}
168
173
  >
169
174
  {"Code"}
@@ -9,8 +9,8 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/cli": "^0.1.359",
13
- "@plasmicapp/react-web": "^0.2.425",
12
+ "@plasmicapp/cli": "^0.1.361",
13
+ "@plasmicapp/react-web": "^1.0.6",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -135,6 +135,6 @@
135
135
  "nextjsConfig": {
136
136
  "pagesDir": "../pages"
137
137
  },
138
- "cliVersion": "0.1.359",
139
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.359/dist/plasmic.schema.json"
138
+ "cliVersion": "0.1.361",
139
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.361/dist/plasmic.schema.json"
140
140
  }
@@ -282,6 +282,7 @@ function PlasmicButton__RenderFunc(props: {
282
282
  className={classNames(
283
283
  projectcss.all,
284
284
  projectcss.button,
285
+ projectcss.button__47tFX,
285
286
  projectcss.root_reset,
286
287
  projectcss.plasmic_default_styles,
287
288
  projectcss.plasmic_mixins,
@@ -201,6 +201,7 @@ function PlasmicDynamicPage__RenderFunc(props: {
201
201
  className={classNames(
202
202
  projectcss.all,
203
203
  projectcss.h1,
204
+ projectcss.h1__47tFX,
204
205
  projectcss.__wab_text,
205
206
  sty.h1
206
207
  )}
@@ -205,6 +205,7 @@ function PlasmicHomepage__RenderFunc(props: {
205
205
  className={classNames(
206
206
  projectcss.all,
207
207
  projectcss.h1,
208
+ projectcss.h1__47tFX,
208
209
  projectcss.__wab_text,
209
210
  sty.h1
210
211
  )}
@@ -228,7 +229,9 @@ function PlasmicHomepage__RenderFunc(props: {
228
229
  }
229
230
  </React.Fragment>
230
231
  <span
231
- className={"plasmic_default__all plasmic_default__span"}
232
+ className={
233
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
234
+ }
232
235
  style={{ fontWeight: 700 }}
233
236
  >
234
237
  {"Therefore, please avoid changing this project."}
@@ -242,7 +245,9 @@ function PlasmicHomepage__RenderFunc(props: {
242
245
  }
243
246
  </React.Fragment>
244
247
  <span
245
- className={"plasmic_default__all plasmic_default__span"}
248
+ className={
249
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
250
+ }
246
251
  style={{ fontWeight: 700 }}
247
252
  >
248
253
  {"Code"}
@@ -9,8 +9,8 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/cli": "^0.1.359",
13
- "@plasmicapp/react-web": "^0.2.425",
12
+ "@plasmicapp/cli": "^0.1.361",
13
+ "@plasmicapp/react-web": "^1.0.6",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -135,6 +135,6 @@
135
135
  "nextjsConfig": {
136
136
  "pagesDir": "../pages"
137
137
  },
138
- "cliVersion": "0.1.359",
139
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.359/dist/plasmic.schema.json"
138
+ "cliVersion": "0.1.361",
139
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.361/dist/plasmic.schema.json"
140
140
  }
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^1.0.456",
12
+ "@plasmicapp/loader-nextjs": "^2.0.3",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^1.0.456",
12
+ "@plasmicapp/loader-nextjs": "^2.0.3",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -10,8 +10,8 @@
10
10
  "preview": "vite preview"
11
11
  },
12
12
  "dependencies": {
13
- "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^1.0.0",
13
+ "@plasmicapp/cli": "^0.1.361",
14
+ "@plasmicapp/react-web": "^1.0.6",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -132,6 +132,6 @@
132
132
  },
133
133
  "wrapPagesWithGlobalContexts": true,
134
134
  "preserveJsImportExtensions": false,
135
- "cliVersion": "0.1.359",
136
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.359/dist/plasmic.schema.json"
135
+ "cliVersion": "0.1.361",
136
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.361/dist/plasmic.schema.json"
137
137
  }
@@ -10,8 +10,8 @@
10
10
  "preview": "vite preview"
11
11
  },
12
12
  "dependencies": {
13
- "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^1.0.0",
13
+ "@plasmicapp/cli": "^0.1.361",
14
+ "@plasmicapp/react-web": "^1.0.6",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -132,6 +132,6 @@
132
132
  },
133
133
  "wrapPagesWithGlobalContexts": true,
134
134
  "preserveJsImportExtensions": false,
135
- "cliVersion": "0.1.359",
136
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.359/dist/plasmic.schema.json"
135
+ "cliVersion": "0.1.361",
136
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.361/dist/plasmic.schema.json"
137
137
  }
@@ -12,11 +12,11 @@
12
12
  "test": "vitest run"
13
13
  },
14
14
  "dependencies": {
15
- "@plasmicapp/cli": "^0.1.359",
16
- "@plasmicapp/react-web": "^0.2.425",
15
+ "@plasmicapp/cli": "^0.1.361",
16
+ "@plasmicapp/react-web": "^1.0.6",
17
17
  "@tailwindcss/vite": "^4.1.18",
18
18
  "@tanstack/react-devtools": "latest",
19
- "@tanstack/react-query": "^5.90.21",
19
+ "@tanstack/react-query": "^5.100.9",
20
20
  "@tanstack/react-router": "latest",
21
21
  "@tanstack/react-router-devtools": "latest",
22
22
  "@tanstack/router-plugin": "^1.132.0",
@@ -34,12 +34,11 @@
34
34
  "@types/node": "^22.10.2",
35
35
  "@types/react": "^19.2.0",
36
36
  "@types/react-dom": "^19.2.0",
37
- "@vitejs/plugin-react": "^5.1.4",
37
+ "@vitejs/plugin-react": "^6.0.1",
38
38
  "jsdom": "^28.1.0",
39
- "typescript": "^5.7.2",
40
- "vite": "^7.3.1",
41
- "vite-tsconfig-paths": "^5.1.4",
42
- "vitest": "^3.0.5"
39
+ "typescript": "^6.0.2",
40
+ "vite": "^8.0.0",
41
+ "vitest": "^4.1.5"
43
42
  },
44
43
  "pnpm": {
45
44
  "onlyBuiltDependencies": [
@@ -135,6 +135,6 @@
135
135
  "tanstackConfig": {
136
136
  "pagesDir": "../routes"
137
137
  },
138
- "cliVersion": "0.1.359",
139
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.359/dist/plasmic.schema.json"
138
+ "cliVersion": "0.1.361",
139
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.361/dist/plasmic.schema.json"
140
140
  }
@@ -281,6 +281,7 @@ function PlasmicButton__RenderFunc(props: {
281
281
  className={classNames(
282
282
  "plasmic_default__all",
283
283
  "plasmic_default__button",
284
+ "plasmic_default__button__47tFX",
284
285
  "root_reset_47tFXWjN2C4NyHFGGpaYQ3",
285
286
  "plasmic_default_styles",
286
287
  "plasmic_mixins",
@@ -425,7 +426,6 @@ function PlasmicButton__RenderFunc(props: {
425
426
  data-plasmic-override={overrides.startIconContainer}
426
427
  className={classNames(
427
428
  "plasmic_default__all",
428
- "plasmic_default__div",
429
429
  "Button__startIconContainer__men7Z",
430
430
  {
431
431
  Button__startIconContainercolor_blue__men7Z7OS1A: hasVariant(
@@ -449,7 +449,6 @@ function PlasmicButton__RenderFunc(props: {
449
449
  <CheckSvgIcon
450
450
  className={classNames(
451
451
  "plasmic_default__all",
452
- "plasmic_default__svg",
453
452
  "Button__svg__s6Xxe"
454
453
  )}
455
454
  role={"img"}
@@ -519,7 +518,6 @@ function PlasmicButton__RenderFunc(props: {
519
518
  data-plasmic-override={overrides.contentContainer}
520
519
  className={classNames(
521
520
  "plasmic_default__all",
522
- "plasmic_default__div",
523
521
  "Button__contentContainer__sXXwU",
524
522
  {
525
523
  Button__contentContainer___focusVisibleWithin__sXXwUcjR25:
@@ -650,7 +648,6 @@ function PlasmicButton__RenderFunc(props: {
650
648
  data-plasmic-override={overrides.endIconContainer}
651
649
  className={classNames(
652
650
  "plasmic_default__all",
653
- "plasmic_default__div",
654
651
  "Button__endIconContainer___3CzAx",
655
652
  {
656
653
  Button__endIconContainercolor_white___3CzAx5R3VM: hasVariant(
@@ -676,7 +673,6 @@ function PlasmicButton__RenderFunc(props: {
676
673
  <IconIcon
677
674
  className={classNames(
678
675
  "plasmic_default__all",
679
- "plasmic_default__svg",
680
676
  "Button__svg__liJa"
681
677
  )}
682
678
  role={"img"}
@@ -175,7 +175,6 @@ function PlasmicDynamicPage__RenderFunc(props: {
175
175
  data-plasmic-for-node={forNode}
176
176
  className={classNames(
177
177
  "plasmic_default__all",
178
- "plasmic_default__div",
179
178
  "root_reset_47tFXWjN2C4NyHFGGpaYQ3",
180
179
  "plasmic_default_styles",
181
180
  "plasmic_mixins",
@@ -188,7 +187,6 @@ function PlasmicDynamicPage__RenderFunc(props: {
188
187
  data-plasmic-override={overrides.section}
189
188
  className={classNames(
190
189
  "plasmic_default__all",
191
- "plasmic_default__section",
192
190
  "DynamicPage__section__mbqxB"
193
191
  )}
194
192
  >
@@ -198,6 +196,7 @@ function PlasmicDynamicPage__RenderFunc(props: {
198
196
  className={classNames(
199
197
  "plasmic_default__all",
200
198
  "plasmic_default__h1",
199
+ "plasmic_default__h1__47tFX",
201
200
  "__wab_text",
202
201
  "DynamicPage__h1__uyAe1"
203
202
  )}
@@ -179,7 +179,6 @@ function PlasmicHomepage__RenderFunc(props: {
179
179
  data-plasmic-for-node={forNode}
180
180
  className={classNames(
181
181
  "plasmic_default__all",
182
- "plasmic_default__div",
183
182
  "root_reset_47tFXWjN2C4NyHFGGpaYQ3",
184
183
  "plasmic_default_styles",
185
184
  "plasmic_mixins",
@@ -192,7 +191,6 @@ function PlasmicHomepage__RenderFunc(props: {
192
191
  data-plasmic-override={overrides.section}
193
192
  className={classNames(
194
193
  "plasmic_default__all",
195
- "plasmic_default__section",
196
194
  "Homepage__section__pXQ"
197
195
  )}
198
196
  >
@@ -202,6 +200,7 @@ function PlasmicHomepage__RenderFunc(props: {
202
200
  className={classNames(
203
201
  "plasmic_default__all",
204
202
  "plasmic_default__h1",
203
+ "plasmic_default__h1__47tFX",
205
204
  "__wab_text",
206
205
  "Homepage__h1__equfk"
207
206
  )}
@@ -213,7 +212,6 @@ function PlasmicHomepage__RenderFunc(props: {
213
212
  data-plasmic-override={overrides.text}
214
213
  className={classNames(
215
214
  "plasmic_default__all",
216
- "plasmic_default__div",
217
215
  "__wab_text",
218
216
  "Homepage__text__aC4Gm"
219
217
  )}
@@ -226,7 +224,9 @@ function PlasmicHomepage__RenderFunc(props: {
226
224
  }
227
225
  </React.Fragment>
228
226
  <span
229
- className={"plasmic_default__all plasmic_default__span"}
227
+ className={
228
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
229
+ }
230
230
  style={{ fontWeight: 700 }}
231
231
  >
232
232
  {"Therefore, please avoid changing this project."}
@@ -240,7 +240,9 @@ function PlasmicHomepage__RenderFunc(props: {
240
240
  }
241
241
  </React.Fragment>
242
242
  <span
243
- className={"plasmic_default__all plasmic_default__span"}
243
+ className={
244
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
245
+ }
244
246
  style={{ fontWeight: 700 }}
245
247
  >
246
248
  {"Code"}
@@ -9,6 +9,8 @@ import { createUseStyleTokens } from "@plasmicapp/react-web";
9
9
 
10
10
  import { _useGlobalVariants } from "./plasmic"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectModule
11
11
 
12
+ import "./plasmic.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
13
+
12
14
  const data = {
13
15
  base: `${"plasmic_tokens_47tFXWjN2C4NyHFGGpaYQ3"}`,
14
16
  varianted: []
@@ -4,7 +4,6 @@ import { routeTree } from './routeTree.gen'
4
4
  export function getRouter() {
5
5
  const router = createTanStackRouter({
6
6
  routeTree,
7
-
8
7
  scrollRestoration: true,
9
8
  defaultPreload: 'intent',
10
9
  defaultPreloadStaleTime: 0,
@@ -4,7 +4,6 @@
4
4
  "target": "ES2022",
5
5
  "jsx": "react-jsx",
6
6
  "module": "ESNext",
7
- "baseUrl": ".",
8
7
  "paths": {
9
8
  "#/*": ["./src/*"],
10
9
  "@/*": ["./src/*"]
@@ -1,6 +1,5 @@
1
1
  import { defineConfig } from 'vite'
2
2
  import { devtools } from '@tanstack/devtools-vite'
3
- import tsconfigPaths from 'vite-tsconfig-paths'
4
3
 
5
4
  import { tanstackRouter } from '@tanstack/router-plugin/vite'
6
5
 
@@ -17,9 +16,9 @@ const config = defineConfig({
17
16
  "@plasmicapp/react-web",
18
17
  ],
19
18
  },
19
+ resolve: { tsconfigPaths: true },
20
20
  plugins: [
21
21
  devtools(),
22
- tsconfigPaths({ projects: ['./tsconfig.json'] }),
23
22
  tailwindcss(),
24
23
  tanstackRouter({ target: 'react', autoCodeSplitting: true }),
25
24
  viteReact(),
@@ -22,10 +22,11 @@ const file_utils_1 = require("../utils/file-utils");
22
22
  const lang_utils_1 = require("../utils/lang-utils");
23
23
  const npm_utils_1 = require("../utils/npm-utils");
24
24
  const layout_1 = require("./templates/app-codegen/layout");
25
+ const plasmic_init_client_1 = require("./templates/app-codegen/plasmic-init-client");
25
26
  const catchall_page_1 = require("./templates/app-loader/catchall-page");
26
27
  const plasmic_host_1 = require("./templates/app-loader/plasmic-host");
27
28
  const plasmic_init_1 = require("./templates/app-loader/plasmic-init");
28
- const plasmic_init_client_1 = require("./templates/app-loader/plasmic-init-client");
29
+ const plasmic_init_client_2 = require("./templates/app-loader/plasmic-init-client");
29
30
  const app_1 = require("./templates/pages-codegen/app");
30
31
  const plasmic_host_2 = require("./templates/pages-codegen/plasmic-host");
31
32
  const catchall_page_2 = require("./templates/pages-loader/catchall-page");
@@ -97,7 +98,7 @@ function generateFilesAppDir(args) {
97
98
  // ./plasmic-init.ts
98
99
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init.${jsOrTs}`), (0, plasmic_init_1.makePlasmicInit_app_loader)(projectId, (0, lang_utils_1.ensure)(projectApiToken, "Missing projectApiToken")));
99
100
  // ./plasmic-init-client.ts
100
- yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init-client.${jsOrTs}x`), (0, plasmic_init_client_1.makePlasmicInitClient_app_loader)(jsOrTs));
101
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init-client.${jsOrTs}x`), (0, plasmic_init_client_2.makePlasmicInitClient_app_loader)(jsOrTs));
101
102
  // ./app/plasmic-host/page.tsx
102
103
  yield fs_1.promises.mkdir(path_1.default.join(projectPath, "app", "plasmic-host"));
103
104
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_1.makePlasmicHostPage_app_loader)());
@@ -106,8 +107,12 @@ function generateFilesAppDir(args) {
106
107
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "[[...catchall]]", `page.${jsOrTs}x`), (0, catchall_page_1.makeCatchallPage_app_loader)(jsOrTs));
107
108
  }
108
109
  else {
110
+ // Replace starter layout. Removes app/layout.js in JS projects before writing layout.jsx.
111
+ (0, file_utils_1.deleteGlob)(path_1.default.join(projectPath, "app", "layout.*"));
109
112
  // ./app/layout.tsx
110
113
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", `layout.${jsOrTs}x`), (0, layout_1.makeLayout_app_codegen)(jsOrTs));
114
+ // ./plasmic-init-client.tsx
115
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init-client.${jsOrTs}x`), (0, plasmic_init_client_1.makePlasmicInitClient_app_codegen)(jsOrTs));
111
116
  // ./app/plasmic-host/page.tsx
112
117
  yield fs_1.promises.mkdir(path_1.default.join(projectPath, "app", "plasmic-host"));
113
118
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_2.makePlasmicHostPage_pages_codegen)() // plasmic-host page contents are the same as the pages router
@@ -4,8 +4,7 @@ exports.makeLayout_app_codegen = void 0;
4
4
  const file_utils_1 = require("../../../utils/file-utils");
5
5
  function makeLayout_app_codegen(jsOrTs) {
6
6
  return `import '@/app/globals.css'
7
- import { PlasmicRootProvider } from "@plasmicapp/react-web";
8
- import Link from "next/link";
7
+ import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
9
8
 
10
9
  export default function RootLayout({
11
10
  children,
@@ -15,9 +14,9 @@ export default function RootLayout({
15
14
  return (
16
15
  <html lang="en">
17
16
  <body>
18
- <PlasmicRootProvider Link={Link}>
17
+ <ClientPlasmicRootProvider>
19
18
  {children}
20
- </PlasmicRootProvider>
19
+ </ClientPlasmicRootProvider>
21
20
  </body>
22
21
  </html>
23
22
  );
@@ -0,0 +1,2 @@
1
+ import { JsOrTs } from "../../../utils/types";
2
+ export declare function makePlasmicInitClient_app_codegen(jsOrTs: JsOrTs): string;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makePlasmicInitClient_app_codegen = void 0;
4
+ const file_utils_1 = require("../../../utils/file-utils");
5
+ function makePlasmicInitClient_app_codegen(jsOrTs) {
6
+ return `"use client";
7
+
8
+ ${(0, file_utils_1.ifTs)(jsOrTs, 'import type * as React from "react";\n')}import { PlasmicRootProvider } from "@plasmicapp/react-web";
9
+ import Link from "next/link";
10
+
11
+ /**
12
+ * ClientPlasmicRootProvider is a Client Component that passes Next's Link to PlasmicRootProvider.
13
+ *
14
+ * Props passed from a Server Component to a Client Component must be serializable.
15
+ * https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
16
+ */
17
+ export function ClientPlasmicRootProvider(
18
+ props${(0, file_utils_1.ifTs)(jsOrTs, ': Omit<React.ComponentProps<typeof PlasmicRootProvider>, "Link">')}
19
+ ) {
20
+ return <PlasmicRootProvider Link={Link} {...props} />;
21
+ }
22
+ `;
23
+ }
24
+ exports.makePlasmicInitClient_app_codegen = makePlasmicInitClient_app_codegen;
@@ -18,48 +18,10 @@ import { PLASMIC } from "@/plasmic-init";
18
18
  // PLASMIC.registerComponent(...);
19
19
 
20
20
  /**
21
- * ClientPlasmicRootProvider is a Client Component that passes in the loader for you.
21
+ * ClientPlasmicRootProvider is a Client Component that passes the loader to PlasmicRootProvider.
22
22
  *
23
- * Why? Props passed from Server to Client Components must be serializable.
23
+ * Props passed from a Server Component to a Client Component must be serializable.
24
24
  * https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
25
- * However, PlasmicRootProvider requires a loader, but the loader is NOT serializable.
26
- *
27
- * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
28
- *
29
- * \`\`\`tsx
30
- * import { PLASMIC } from "@/plasmic-init";
31
- * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
32
- * export default function MyPage() {
33
- * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
34
- * return (
35
- * <PlasmicRootProvider
36
- * loader={PLASMIC} // ERROR: loader is not serializable
37
- * prefetchedData={prefetchedData}
38
- * >
39
- * {yourContent()}
40
- * </PlasmicRootProvider>;
41
- * );
42
- * }
43
- * \`\`\`
44
- *
45
- * Therefore, we define ClientPlasmicRootProvider as a Client Component (this file is marked "use client").
46
- * ClientPlasmicRootProvider wraps the PlasmicRootProvider and passes in the loader for you,
47
- * while allowing your Server Component to pass in prefetched data and other serializable props:
48
- *
49
- * \`\`\`tsx
50
- * import { PLASMIC } from "@/plasmic-init";
51
- * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
52
- * export default function MyPage() {
53
- * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
54
- * return (
55
- * <ClientPlasmicRootProvider // don't pass in loader
56
- * prefetchedData={prefetchedData}
57
- * >
58
- * {yourContent()}
59
- * </ClientPlasmicRootProvider>;
60
- * );
61
- * }
62
- * \`\`\`
63
25
  */
64
26
  export function ClientPlasmicRootProvider(
65
27
  props${(0, file_utils_1.ifTs)(jsOrTs, ': Omit<React.ComponentProps<typeof PlasmicRootProvider>, "loader">')}
@@ -27,11 +27,6 @@ export const PLASMIC = initPlasmicLoader({
27
27
  // Register custom functions here so they are available during SSR.
28
28
  // See https://docs.plasmic.app/learn/registering-custom-functions/
29
29
  //
30
- // IMPORTANT for app-router projects: any custom function used by a server
31
- // query must be registered here, which runs on the server. Registrations in
32
- // plasmic-init-client.tsx are only available in the browser and will cause
33
- // a runtime error if referenced by a server query during SSR.
34
- //
35
30
  // PLASMIC.registerFunction(...);
36
31
  `;
37
32
  }