"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/vdom/helpers/resolve-async-component.js" between
vue-2.6.9.tar.gz and vue-2.6.10.tar.gz

About: Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

resolve-async-component.js  (vue-2.6.9):resolve-async-component.js  (vue-2.6.10)
skipping to change at line 68 skipping to change at line 68
factory.owners.push(owner) factory.owners.push(owner)
} }
if (isTrue(factory.loading) && isDef(factory.loadingComp)) { if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
return factory.loadingComp return factory.loadingComp
} }
if (owner && !isDef(factory.owners)) { if (owner && !isDef(factory.owners)) {
const owners = factory.owners = [owner] const owners = factory.owners = [owner]
let sync = true let sync = true
let timerLoading = null
let timerTimeout = null
;(owner: any).$on('hook:destroyed', () => remove(owners, owner)) ;(owner: any).$on('hook:destroyed', () => remove(owners, owner))
const forceRender = (renderCompleted: boolean) => { const forceRender = (renderCompleted: boolean) => {
for (let i = 0, l = owners.length; i < l; i++) { for (let i = 0, l = owners.length; i < l; i++) {
(owners[i]: any).$forceUpdate() (owners[i]: any).$forceUpdate()
} }
if (renderCompleted) { if (renderCompleted) {
owners.length = 0 owners.length = 0
if (timerLoading !== null) {
clearTimeout(timerLoading)
timerLoading = null
}
if (timerTimeout !== null) {
clearTimeout(timerTimeout)
timerTimeout = null
}
} }
} }
const resolve = once((res: Object | Class<Component>) => { const resolve = once((res: Object | Class<Component>) => {
// cache resolved // cache resolved
factory.resolved = ensureCtor(res, baseCtor) factory.resolved = ensureCtor(res, baseCtor)
// invoke callbacks only if this is not a synchronous resolve // invoke callbacks only if this is not a synchronous resolve
// (async resolves are shimmed as synchronous during SSR) // (async resolves are shimmed as synchronous during SSR)
if (!sync) { if (!sync) {
forceRender(true) forceRender(true)
skipping to change at line 124 skipping to change at line 134
if (isDef(res.error)) { if (isDef(res.error)) {
factory.errorComp = ensureCtor(res.error, baseCtor) factory.errorComp = ensureCtor(res.error, baseCtor)
} }
if (isDef(res.loading)) { if (isDef(res.loading)) {
factory.loadingComp = ensureCtor(res.loading, baseCtor) factory.loadingComp = ensureCtor(res.loading, baseCtor)
if (res.delay === 0) { if (res.delay === 0) {
factory.loading = true factory.loading = true
} else { } else {
setTimeout(() => { timerLoading = setTimeout(() => {
timerLoading = null
if (isUndef(factory.resolved) && isUndef(factory.error)) { if (isUndef(factory.resolved) && isUndef(factory.error)) {
factory.loading = true factory.loading = true
forceRender(false) forceRender(false)
} }
}, res.delay || 200) }, res.delay || 200)
} }
} }
if (isDef(res.timeout)) { if (isDef(res.timeout)) {
setTimeout(() => { timerTimeout = setTimeout(() => {
timerTimeout = null
if (isUndef(factory.resolved)) { if (isUndef(factory.resolved)) {
reject( reject(
process.env.NODE_ENV !== 'production' process.env.NODE_ENV !== 'production'
? `timeout (${res.timeout}ms)` ? `timeout (${res.timeout}ms)`
: null : null
) )
} }
}, res.timeout) }, res.timeout)
} }
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)