Skip to content

Commit

Permalink
feat(types): re-expose resolve asset utitlies and registerRuntimeComp…
Browse files Browse the repository at this point in the history
…iler in type definitions

close #1109
  • Loading branch information
yyx990803 committed May 4, 2020
1 parent bc1f097 commit 64ef7c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ let compile: CompileFunction | undefined
/**
* For runtime-dom to register the compiler.
* Note the exported method uses any to avoid d.ts relying on the compiler types.
* @internal
*/
export function registerRuntimeCompiler(_compile: any) {
compile = _compile
Expand Down
9 changes: 0 additions & 9 deletions packages/runtime-core/src/helpers/resolveAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ import { warn } from '../warning'
const COMPONENTS = 'components'
const DIRECTIVES = 'directives'

/**
* @internal
*/
export function resolveComponent(name: string): Component | string | undefined {
return resolveAsset(COMPONENTS, name) || name
}

export const NULL_DYNAMIC_COMPONENT = Symbol()

/**
* @internal
*/
export function resolveDynamicComponent(
component: unknown
): Component | string | typeof NULL_DYNAMIC_COMPONENT {
Expand All @@ -35,9 +29,6 @@ export function resolveDynamicComponent(
}
}

/**
* @internal
*/
export function resolveDirective(name: string): Directive | undefined {
return resolveAsset(DIRECTIVES, name)
}
Expand Down
14 changes: 7 additions & 7 deletions packages/runtime-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export {
callWithAsyncErrorHandling,
ErrorCodes
} from './errorHandling'
export {
resolveComponent,
resolveDirective,
resolveDynamicComponent
} from './helpers/resolveAssets'
// For integration with runtime compiler
export { registerRuntimeCompiler } from './component'
export {
useTransitionState,
resolveTransitionHooks,
Expand Down Expand Up @@ -204,11 +211,6 @@ export { HMRRuntime } from './hmr'
// For compiler generated code
// should sync with '@vue/compiler-core/src/runtimeConstants.ts'
export { withCtx } from './helpers/withRenderContext'
export {
resolveComponent,
resolveDirective,
resolveDynamicComponent
} from './helpers/resolveAssets'
export { renderList } from './helpers/renderList'
export { toHandlers } from './helpers/toHandlers'
export { renderSlot } from './helpers/renderSlot'
Expand Down Expand Up @@ -236,8 +238,6 @@ const _toDisplayString = toDisplayString
const _camelize = camelize
export { _toDisplayString as toDisplayString, _camelize as camelize }

// For integration with runtime compiler
export { registerRuntimeCompiler } from './component'
// For test-utils
export { transformVNodeArgs } from './vnode'

Expand Down

0 comments on commit 64ef7c7

Please sign in to comment.