Skip to content

Commit

Permalink
Revert "chore: remove getComponentMeta(), enableMeasurement"
Browse files Browse the repository at this point in the history
This reverts commit ad14f57.
  • Loading branch information
kormanowsky committed Dec 19, 2024
1 parent 9851e36 commit 9e68a94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/core/component/init/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ export function registerComponent(name: CanUndef<string>): CanNull<ComponentMeta

return components.get(name) ?? null;
}

/**
* Returns component metaobject by its name.

Check failure on line 90 in src/core/component/init/component.ts

View workflow job for this annotation

GitHub Actions / linters (20.x)

The one-line description should be without a period at the end

Check failure on line 90 in src/core/component/init/component.ts

View workflow job for this annotation

GitHub Actions / linters (20.x)

The one-line description should be without a period at the end
* @param name
*/
export function getComponentMeta(name: CanUndef<string>): CanNull<ComponentMeta> {
if (name == null) {
return null;
}

return components.get(name) ?? null;
}
6 changes: 3 additions & 3 deletions src/core/component/render/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import type {

import type { ssrRenderSlot as ISSRRenderSlot } from '@vue/server-renderer';

import { registerComponent } from 'core/component/init';
import { getComponentMeta, registerComponent } from 'core/component/init';

import {

Expand Down Expand Up @@ -93,10 +93,10 @@ export function wrapCreateBlock<T extends typeof createBlock>(original: T): T {
let component: CanNull<ComponentMeta> = null;

if (Object.isString(name)) {
component = registerComponent(name);
component = getComponentMeta(name);

} else if (!Object.isPrimitive(name) && 'name' in name && name.name != null) {
component = registerComponent(name.name);
component = getComponentMeta(name.name);
}

if (component == null) {
Expand Down

0 comments on commit 9e68a94

Please sign in to comment.