refactor: expose scheduler for vapor

This commit is contained in:
Evan You 2024-12-03 16:58:07 +08:00
parent 783d8b4d0d
commit 9d89d7ab27
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
4 changed files with 8 additions and 8 deletions

View File

@ -488,3 +488,4 @@ export const DeprecationTypes = (
// change without notice between versions. User code should never rely on them.
export { baseNormalizePropsOptions, resolvePropValue } from './componentProps'
export { type SchedulerJob, queueJob } from './scheduler'

View File

@ -24,6 +24,9 @@ export enum SchedulerJobFlags {
DISPOSED = 1 << 3,
}
/**
* @internal
*/
export interface SchedulerJob extends Function {
id?: number
/**
@ -91,6 +94,9 @@ function findInsertionIndex(id: number) {
return start
}
/**
* @internal for runtime-vapor only
*/
export function queueJob(job: SchedulerJob): void {
if (!(job.flags! & SchedulerJobFlags.QUEUED)) {
const jobId = getId(job)

View File

@ -61,10 +61,6 @@ interface ComponentInternalOptions {
* @internal
*/
__hmrId?: string
/**
* Compat build only, for bailing out of certain compatibility behavior
*/
__isBuiltIn?: boolean
/**
* This one should be exposed so that devtools can make use of it
*/

View File

@ -1,8 +1,5 @@
import { ReactiveEffect } from '@vue/reactivity'
import {
type SchedulerJob,
queueJob,
} from '../../../runtime-core/src/scheduler'
import { type SchedulerJob, queueJob } from '@vue/runtime-core'
import { currentInstance } from './component'
export function renderEffect(fn: () => void): void {