MCPcopy Index your code
hub / github.com/remix-run/react-router / hmrWorkflow

Function hmrWorkflow

integration/vite-css-test.ts:494–585  ·  view source on GitHub ↗
({
  page,
  cwd,
  port,
  base,
  templateName,
}: {
  page: Page;
  cwd: string;
  port: number;
  base?: string;
  templateName: TemplateName;
})

Source from the content-addressed store, hash-verified

492}
493
494async function hmrWorkflow({
495 page,
496 cwd,
497 port,
498 base,
499 templateName,
500}: {
501 page: Page;
502 cwd: string;
503 port: number;
504 base?: string;
505 templateName: TemplateName;
506}) {
507 for (const routeBase of getRouteBasePaths(templateName)) {
508 let pageErrors: Error[] = [];
509 page.on("pageerror", (error) => pageErrors.push(error));
510
511 await page.goto(`http://localhost:${port}${base ?? "/"}${routeBase}`, {
512 waitUntil: "networkidle",
513 });
514
515 let input = page.locator("input");
516 await expect(input).toBeVisible();
517
518 let edit = createEditor(cwd);
519 let modifyCss = (contents: string) =>
520 contents
521 .replace(PADDING, NEW_PADDING)
522 .replace(
523 "PADDING_INJECTED_VIA_POSTCSS",
524 "NEW_PADDING_INJECTED_VIA_POSTCSS",
525 );
526
527 const testCases = [
528 {
529 file: "styles-bundled.css",
530 selector: "#css-bundled",
531 },
532 {
533 file: "styles.module.css",
534 selector: "#css-modules",
535 },
536 {
537 file: "styles-postcss-linked.css",
538 selector: "#css-postcss-linked",
539 },
540 {
541 file: "styles-vanilla-global.css.ts",
542 selector: "#css-vanilla-global",
543 },
544 // Vanilla Extract's HMR isn't working for RSC server-first routes
545 ...(routeBase === "rsc-server-first-route"
546 ? []
547 : ([
548 {
549 file: "styles-vanilla-local.css.ts",
550 selector: "#css-vanilla-local",
551 },

Callers 1

vite-css-test.tsFile · 0.85

Calls 4

getRouteBasePathsFunction · 0.85
createEditorFunction · 0.85
gotoMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…