Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remix/migration-src' into migration-dest
- Loading branch information
Showing
411 changed files
with
68,888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# integration-tests | ||
|
||
## 0.0.0 | ||
|
||
### Minor Changes | ||
|
||
- Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590)) | ||
|
||
- `remix build` 👉 `vite build && vite build --ssr` | ||
- `remix dev` 👉 `vite dev` | ||
|
||
Other runtimes (e.g. Deno, Cloudflare) not yet supported. | ||
Custom server (e.g. Express) not yet supported. | ||
|
||
See "Future > Vite" in the Remix Docs for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { test } from "@playwright/test"; | ||
|
||
import { PlaywrightFixture } from "./helpers/playwright-fixture.js"; | ||
import type { Fixture, AppFixture } from "./helpers/create-fixture.js"; | ||
import { | ||
createAppFixture, | ||
createFixture, | ||
js, | ||
} from "./helpers/create-fixture.js"; | ||
|
||
let fixture: Fixture; | ||
let appFixture: AppFixture; | ||
|
||
test.beforeAll(async () => { | ||
fixture = await createFixture({ | ||
files: { | ||
"app/routes/_index.tsx": js` | ||
import { json } from "@remix-run/node"; | ||
import { useActionData, useLoaderData, Form } from "@remix-run/react"; | ||
export async function action ({ request }) { | ||
// New event loop causes express request to close | ||
await new Promise(r => setTimeout(r, 0)); | ||
return json({ aborted: request.signal.aborted }); | ||
} | ||
export function loader({ request }) { | ||
return json({ aborted: request.signal.aborted }); | ||
} | ||
export default function Index() { | ||
let actionData = useActionData(); | ||
let data = useLoaderData(); | ||
return ( | ||
<div> | ||
<p className="action">{actionData ? String(actionData.aborted) : "empty"}</p> | ||
<p className="loader">{String(data.aborted)}</p> | ||
<Form method="post"> | ||
<button type="submit">Submit</button> | ||
</Form> | ||
</div> | ||
) | ||
} | ||
`, | ||
}, | ||
}); | ||
|
||
// This creates an interactive app using playwright. | ||
appFixture = await createAppFixture(fixture); | ||
}); | ||
|
||
test.afterAll(() => { | ||
appFixture.close(); | ||
}); | ||
|
||
test("should not abort the request in a new event loop", async ({ page }) => { | ||
let app = new PlaywrightFixture(appFixture, page); | ||
await app.goto("/"); | ||
await page.waitForSelector(`.action:has-text("empty")`); | ||
await page.waitForSelector(`.loader:has-text("false")`); | ||
|
||
await app.clickElement('button[type="submit"]'); | ||
|
||
await page.waitForSelector(`.action:has-text("false")`); | ||
await page.waitForSelector(`.loader:has-text("false")`); | ||
}); |
Oops, something went wrong.