forked from cybrespace/pinafore
remove unnecessary sveltejs/svelte#1354 workarounds (#269)
This commit is contained in:
parent
833afc59c0
commit
a88fb70542
|
@ -60,14 +60,14 @@
|
||||||
// perf improves for input responsiveness
|
// perf improves for input responsiveness
|
||||||
this.observe('composeSelectionStart', () => {
|
this.observe('composeSelectionStart', () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
let { composeSelectionStart } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { composeSelectionStart } = this.get()
|
||||||
this.set({composeSelectionStartDeferred: composeSelectionStart})
|
this.set({composeSelectionStartDeferred: composeSelectionStart})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.observe('composeFocused', (composeFocused) => {
|
this.observe('composeFocused', (composeFocused) => {
|
||||||
let updateFocusedState = () => {
|
let updateFocusedState = () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
let { composeFocused } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { composeFocused } = this.get()
|
||||||
this.set({composeFocusedDeferred: composeFocused})
|
this.set({composeFocusedDeferred: composeFocused})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
this.observe('lengthAsFraction', () => {
|
this.observe('lengthAsFraction', () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
mark('set lengthAsFractionDeferred')
|
mark('set lengthAsFractionDeferred')
|
||||||
let { lengthAsFraction } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { lengthAsFraction } = this.get()
|
||||||
this.set({lengthAsFractionDeferred: lengthAsFraction})
|
this.set({lengthAsFractionDeferred: lengthAsFraction})
|
||||||
stop('set lengthAsFractionDeferred')
|
stop('set lengthAsFractionDeferred')
|
||||||
requestAnimationFrame(() => this.set({shouldAnimate: true}))
|
requestAnimationFrame(() => this.set({shouldAnimate: true}))
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
this.observe('lengthToDisplay', () => {
|
this.observe('lengthToDisplay', () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
mark('set lengthToDisplayDeferred')
|
mark('set lengthToDisplayDeferred')
|
||||||
let { lengthToDisplay } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { lengthToDisplay } = this.get()
|
||||||
this.set({lengthToDisplayDeferred: lengthToDisplay})
|
this.set({lengthToDisplayDeferred: lengthToDisplay})
|
||||||
stop('set lengthToDisplayDeferred')
|
stop('set lengthToDisplayDeferred')
|
||||||
})
|
})
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// unrender lazily; it's not a critical UI task
|
// unrender lazily; it's not a critical UI task
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
mark('unrender')
|
mark('unrender')
|
||||||
let { isIntersecting } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { isIntersecting } = this.get()
|
||||||
if (!isIntersecting) {
|
if (!isIntersecting) {
|
||||||
this.set({hide: true})
|
this.set({hide: true})
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async oncreate () {
|
async oncreate () {
|
||||||
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { makeProps, key } = this.get()
|
||||||
if (makeProps) {
|
if (makeProps) {
|
||||||
let props = await makeProps(key)
|
let props = await makeProps(key)
|
||||||
mark('PseudoVirtualListLazyItem set props')
|
mark('PseudoVirtualListLazyItem set props')
|
||||||
|
|
|
@ -169,11 +169,7 @@
|
||||||
this.set({scrollTop: scrollTop})
|
this.set({scrollTop: scrollTop})
|
||||||
},
|
},
|
||||||
onScrollToBottom () {
|
onScrollToBottom () {
|
||||||
let state = this.store.get()
|
let { timelineType } = this.store.get()
|
||||||
if (!state) {
|
|
||||||
return // https://github.com/sveltejs/svelte/issues/1354
|
|
||||||
}
|
|
||||||
let { timelineType } = state
|
|
||||||
let { timelineInitialized, runningUpdate } = this.store.get()
|
let { timelineInitialized, runningUpdate } = this.store.get()
|
||||||
if (!timelineInitialized ||
|
if (!timelineInitialized ||
|
||||||
runningUpdate ||
|
runningUpdate ||
|
||||||
|
@ -200,7 +196,7 @@
|
||||||
let { currentInstance } = this.store.get()
|
let { currentInstance } = this.store.get()
|
||||||
let { timeline } = this.get()
|
let { timeline } = this.get()
|
||||||
let handleItemIdsToAdd = () => {
|
let handleItemIdsToAdd = () => {
|
||||||
let { itemIdsToAdd } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { itemIdsToAdd } = this.get()
|
||||||
if (!itemIdsToAdd || !itemIdsToAdd.length) {
|
if (!itemIdsToAdd || !itemIdsToAdd.length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async oncreate () {
|
async oncreate () {
|
||||||
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
let { makeProps, key } = this.get()
|
||||||
if (makeProps) {
|
if (makeProps) {
|
||||||
let props = await makeProps(key)
|
let props = await makeProps(key)
|
||||||
mark('VirtualListLazyItem set props')
|
mark('VirtualListLazyItem set props')
|
||||||
|
|
Loading…
Reference in New Issue