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. // change without notice between versions. User code should never rely on them.
export { baseNormalizePropsOptions, resolvePropValue } from './componentProps' export { baseNormalizePropsOptions, resolvePropValue } from './componentProps'
export { type SchedulerJob, queueJob } from './scheduler'

View File

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

View File

@ -61,10 +61,6 @@ interface ComponentInternalOptions {
* @internal * @internal
*/ */
__hmrId?: string __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 * 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 { ReactiveEffect } from '@vue/reactivity'
import { import { type SchedulerJob, queueJob } from '@vue/runtime-core'
type SchedulerJob,
queueJob,
} from '../../../runtime-core/src/scheduler'
import { currentInstance } from './component' import { currentInstance } from './component'
export function renderEffect(fn: () => void): void { export function renderEffect(fn: () => void): void {