Skip to content

Commit

Permalink
Merge pull request #28 from johannschopplich/fix/hmr-reload
Browse files Browse the repository at this point in the history
fix: set section flag independent from usedDef check
  • Loading branch information
johannschopplich authored Oct 6, 2022
2 parents 2d65fd2 + 06884d3 commit 631970b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/node/plugins/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const isHmrRuntimeId = (id: string) => id === HMR_RUNTIME_ID || id === JS
*/

export const __INJECTED_HMR_CODE__ = `
/** - injected by kirbyup - */
for (const methodName of ['rerender', 'reload']) {
const original = __VUE_HMR_RUNTIME__[methodName]
Expand All @@ -64,10 +65,11 @@ for (const methodName of ['rerender', 'reload']) {
if (updatedDef[key] === pluginComponents[componentName][key]) {
const usedDefinition = usedComponentDefs[componentName].options
if (map[id].options !== usedDefinition) {
if (map[id].options !== usedDefinition)
map[id].options = usedDefinition
if (typeof map[id].options.$_isSection !== 'boolean')
map[id].options.$_isSection = /^k-.*-section$/.test(componentName)
}
break
}
Expand Down Expand Up @@ -102,5 +104,5 @@ function $_applyKirbyModifications(activeDef, newDef) {
else { newDef.extends = null }
}
}
/** */
/** -- */
`

0 comments on commit 631970b

Please sign in to comment.