Skip to content

Commit f1b76f7

Browse files
authored
Turn on experimental C3 tests for React & Vue (#11485)
* Turn on C3 tests for React & Vue * Create old-bulldogs-wonder.md
1 parent 9514c9a commit f1b76f7

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

‎.changeset/old-bulldogs-wonder.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-cloudflare": minor
3+
---
4+
5+
Add React & Vue to C3's experimental mode

‎packages/create-cloudflare/e2e/tests/cli/cli.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ describe("Create Cloudflare CLI", () => {
555555
npm create cloudflare -- --framework next -- --ts
556556
pnpm create cloudflare --framework next -- --ts
557557
Allowed Values:
558-
gatsby, svelte, docusaurus, astro, tanstack-start, angular, solid, qwik
558+
gatsby, svelte, docusaurus, astro, tanstack-start, angular, solid, qwik, vue, react
559559
--platform=<value>
560560
Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.
561561
Allowed Values:

‎packages/create-cloudflare/e2e/tests/frameworks/test-config.ts‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,54 @@ function getExperimentalFrameworkTestConfig(
818818
nodeCompat: true,
819819
verifyTypes: false,
820820
},
821+
{
822+
name: "vue:workers",
823+
argv: ["--platform", "workers", "--ts"],
824+
testCommitMessage: true,
825+
unsupportedOSs: ["win32"],
826+
verifyDeploy: {
827+
route: "/",
828+
expectedText: "Vite App",
829+
},
830+
verifyPreview: {
831+
previewArgs: ["--host=127.0.0.1"],
832+
route: "/",
833+
expectedText: "Vite App",
834+
},
835+
nodeCompat: false,
836+
verifyTypes: false,
837+
},
838+
{
839+
name: "react:workers",
840+
argv: ["--platform", "workers"],
841+
promptHandlers: [
842+
{
843+
matcher: /Select a variant:/,
844+
input: [keys.enter],
845+
},
846+
],
847+
unsupportedOSs: ["win32"],
848+
testCommitMessage: true,
849+
verifyDeploy: {
850+
route: "/",
851+
// Note that this is the text in the static HTML that is returned
852+
// This React SPA will change this at runtime but we are only making a fetch request
853+
// not actually running the client side JS.
854+
expectedText: "Vite + React + TS",
855+
},
856+
verifyPreview: {
857+
route: "/",
858+
// We need to run the preview on the specific IP address on which we make the request.
859+
// By default `vite preview` runs on `localhost` that doesn't always include 127.0.0.1.
860+
previewArgs: ["--host=127.0.0.1"],
861+
// Note that this is the text in the static HTML that is returned
862+
// This React SPA will change this at runtime but we are only making a fetch request
863+
// not actually running the client side JS.
864+
expectedText: "Vite + React + TS",
865+
},
866+
nodeCompat: false,
867+
verifyTypes: false,
868+
},
821869
];
822870
}
823871

‎packages/create-cloudflare/src/templates.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ export function getFrameworkMap({ experimental = false }): TemplateMap {
244244
angular: angularTemplate,
245245
solid: solidTemplate,
246246
qwik: qwikTemplate,
247+
vue: vueTemplate,
248+
react: reactTemplate,
247249
};
248250
} else {
249251
return {

0 commit comments

Comments
 (0)