Skip to content

Commit

Permalink
fix: do not full reload when boundary module is not found (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
wre232114 authored Jul 24, 2024
1 parent 734a00b commit 01e3100
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .changeset/twenty-hotels-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@farmfe/runtime-plugin-hmr": patch
"@farmfe/core": patch
---

Fix do not full reload when boundary module not found for multi-page-app
18 changes: 5 additions & 13 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"files": {
"ignore": [
"**/node_modules/**",
"crates/**",
"*.vue",
"tsconfig.base.json",
Expand All @@ -30,21 +31,12 @@
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"include": [
"**/*.ts"
],
"ignore": [
"node_modules",
"dist"
]
"include": ["**/*.ts"],
"ignore": ["node_modules", "dist"]
},
"organizeImports": {
"enabled": true,
"include": [
"./**/*.js",
"./**/*.ts",
"./**/*.mjs"
]
"include": ["./**/*.js", "./**/*.ts", "./**/*.mjs"]
},
"linter": {
"enabled": true,
Expand Down Expand Up @@ -140,4 +132,4 @@
"attributePosition": "auto"
}
}
}
}
6 changes: 4 additions & 2 deletions packages/runtime-plugin-hmr/src/hmr-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ export class HmrClient {
chain.length > 1 ? chain[chain.length - 2] : undefined;

if (!hotContext) {
console.error('hot context is empty for ', boundary);
location.reload();
logger.debug(
`hot context is empty for boundary ${boundary}. Hot update of ${boundary} is skipped.`
);
// location.reload();
// fix multi page application hmr
continue;
}
Expand Down

0 comments on commit 01e3100

Please sign in to comment.