repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/index.ts | packages/compiler-dom/src/index.ts | import {
type CodegenResult,
type CompilerOptions,
type DirectiveTransform,
type NodeTransform,
type ParserOptions,
type RootNode,
baseCompile,
baseParse,
noopDirectiveTransform,
} from '@vue/compiler-core'
import { parserOptions } from './parserOptions'
import { transformStyle } from './transforms/tr... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts | packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts | import { ElementTypes, type NodeTransform, NodeTypes } from '@vue/compiler-core'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
export const ignoreSideEffectTags: NodeTransform = (node, context) => {
if (
node.type === NodeTypes.ELEMENT &&
node.tagType === ElementTypes.ELEMENT &&
(node... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/stringifyStatic.ts | packages/compiler-dom/src/transforms/stringifyStatic.ts | /**
* This module is Node-only.
*/
import {
CREATE_STATIC,
type CacheExpression,
ConstantTypes,
type ElementNode,
ElementTypes,
type ExpressionNode,
type HoistTransform,
Namespaces,
NodeTypes,
type PlainElementNode,
type SimpleExpressionNode,
type TemplateChildNode,
type TextCallNode,
type... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/validateHtmlNesting.ts | packages/compiler-dom/src/transforms/validateHtmlNesting.ts | import {
type CompilerError,
ElementTypes,
type NodeTransform,
NodeTypes,
} from '@vue/compiler-core'
import { isValidHTMLNesting } from '../htmlNesting'
export const validateHtmlNesting: NodeTransform = (node, context) => {
if (
node.type === NodeTypes.ELEMENT &&
node.tagType === ElementTypes.ELEMEN... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/transformStyle.ts | packages/compiler-dom/src/transforms/transformStyle.ts | import {
ConstantTypes,
type NodeTransform,
NodeTypes,
type SimpleExpressionNode,
type SourceLocation,
createSimpleExpression,
} from '@vue/compiler-core'
import { parseStringStyle } from '@vue/shared'
// Parse inline CSS strings for static style attributes into an object.
// This is a NodeTransform since ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/vModel.ts | packages/compiler-dom/src/transforms/vModel.ts | import {
type DirectiveTransform,
ElementTypes,
NodeTypes,
transformModel as baseTransform,
findDir,
findProp,
hasDynamicKeyVBind,
isStaticArgOf,
} from '@vue/compiler-core'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
import {
V_MODEL_CHECKBOX,
V_MODEL_DYNAMIC,
V_MODEL_RADIO,... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/vOn.ts | packages/compiler-dom/src/transforms/vOn.ts | import {
CompilerDeprecationTypes,
type DirectiveTransform,
type ExpressionNode,
NodeTypes,
type SimpleExpressionNode,
type SourceLocation,
type TransformContext,
transformOn as baseTransform,
checkCompatEnabled,
createCallExpression,
createCompoundExpression,
createObjectProperty,
createSimpl... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/vShow.ts | packages/compiler-dom/src/transforms/vShow.ts | import type { DirectiveTransform } from '@vue/compiler-core'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
import { V_SHOW } from '../runtimeHelpers'
export const transformShow: DirectiveTransform = (dir, node, context) => {
const { exp, loc } = dir
if (!exp) {
context.onError(
create... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/vText.ts | packages/compiler-dom/src/transforms/vText.ts | import {
type DirectiveTransform,
TO_DISPLAY_STRING,
createCallExpression,
createObjectProperty,
createSimpleExpression,
getConstantType,
} from '@vue/compiler-core'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
export const transformVText: DirectiveTransform = (dir, node, context) => {... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/Transition.ts | packages/compiler-dom/src/transforms/Transition.ts | import {
type ComponentNode,
ElementTypes,
type IfBranchNode,
type NodeTransform,
NodeTypes,
isCommentOrWhitespace,
} from '@vue/compiler-core'
import { TRANSITION } from '../runtimeHelpers'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
export const transformTransition: NodeTransform = ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/src/transforms/vHtml.ts | packages/compiler-dom/src/transforms/vHtml.ts | import {
type DirectiveTransform,
createObjectProperty,
createSimpleExpression,
} from '@vue/compiler-core'
import { DOMErrorCodes, createDOMCompilerError } from '../errors'
export const transformVHtml: DirectiveTransform = (dir, node, context) => {
const { exp, loc } = dir
if (!exp) {
context.onError(
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/parse.spec.ts | packages/compiler-dom/__tests__/parse.spec.ts | import {
type AttributeNode,
ConstantTypes,
type ElementNode,
ElementTypes,
type InterpolationNode,
Namespaces,
NodeTypes,
type TextNode,
baseParse as parse,
} from '@vue/compiler-core'
import { parserOptions } from '../src/parserOptions'
describe('DOM parser', () => {
describe('Text', () => {
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/index.spec.ts | packages/compiler-dom/__tests__/index.spec.ts | import { compile } from '../src'
describe('compile', () => {
it('should contain standard transforms', () => {
const { code } = compile(`<div v-text="text"></div>
<div v-html="html"></div>
<div v-cloak>test</div>
<div style="color:red">red</div>
<div :style="{color: 'green'}"></div... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts | packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts | /**
* @vitest-environment jsdom
*/
import { decodeHtmlBrowser } from '../src/decodeHtmlBrowser'
describe('decodeHtmlBrowser', () => {
it('should decode HTML correctly', () => {
expect(decodeHtmlBrowser(' abc 123 ')).toBe(' abc 123 ')
expect(decodeHtmlBrowser('&')).toBe('&')
expect(decodeHtmlBrowser(... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts | packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts | import {
type CompilerOptions,
type ElementNode,
NodeTypes,
type VNodeCall,
baseParse as parse,
transform,
} from '@vue/compiler-core'
import { transformBind } from '../../../compiler-core/src/transforms/vBind'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/vModel.spec.ts | packages/compiler-dom/__tests__/transforms/vModel.spec.ts | import {
type CompilerOptions,
generate,
baseParse as parse,
transform,
transformVBindShorthand,
} from '@vue/compiler-core'
import { transformModel } from '../../src/transforms/vModel'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import { DOMErrorCodes } from '../... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/vShow.spec.ts | packages/compiler-dom/__tests__/transforms/vShow.spec.ts | import {
type CompilerOptions,
generate,
baseParse as parse,
transform,
} from '@vue/compiler-core'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import { transformShow } from '../../src/transforms/vShow'
import { DOMErrorCodes } from '../../src/errors'
function tran... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts | packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts | import {
CREATE_STATIC,
ConstantTypes,
NodeTypes,
compile,
createSimpleExpression,
} from '../../src'
import {
StringifyThresholds,
stringifyStatic,
} from '../../src/transforms/stringifyStatic'
describe('stringify static html', () => {
function compileWithStringify(template: string) {
return compi... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/vText.spec.ts | packages/compiler-dom/__tests__/transforms/vText.spec.ts | import {
type CompilerOptions,
type PlainElementNode,
baseParse as parse,
transform,
} from '@vue/compiler-core'
import { transformVText } from '../../src/transforms/vText'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import { createObjectMatcher } from '../../../com... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts | packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts | import { type CompilerError, compile } from '../../src'
import { isValidHTMLNesting } from '../../src/htmlNesting'
describe('validate html nesting', () => {
it('should warn with p > div', () => {
let err: CompilerError | undefined
compile(`<p><div></div></p>`, {
onWarn: e => (err = e),
})
expec... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/vOn.spec.ts | packages/compiler-dom/__tests__/transforms/vOn.spec.ts | import {
BindingTypes,
type CompilerOptions,
type ElementNode,
NodeTypes,
type ObjectExpression,
TO_HANDLER_KEY,
type VNodeCall,
helperNameMap,
baseParse as parse,
transform,
} from '@vue/compiler-core'
import { transformOn } from '../../src/transforms/vOn'
import { V_ON_WITH_KEYS, V_ON_WITH_MODIFIE... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts | packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts | import { type CompilerError, compile } from '../../src'
describe('compiler: ignore side effect tags', () => {
it('should ignore script', () => {
let err: CompilerError | undefined
const { code } = compile(`<script>console.log(1)</script>`, {
onError(e) {
err = e
},
})
expect(code)... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/Transition.spec.ts | packages/compiler-dom/__tests__/transforms/Transition.spec.ts | import { compile } from '../../src'
describe('Transition multi children warnings', () => {
function checkWarning(
template: string,
shouldWarn: boolean,
message = `<Transition> expects exactly one child element or component.`,
) {
const spy = vi.fn()
compile(template.trim(), {
hoistStatic... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts | packages/compiler-dom/__tests__/transforms/vHtml.spec.ts | import {
type CompilerOptions,
type PlainElementNode,
baseParse as parse,
transform,
} from '@vue/compiler-core'
import { transformVHtml } from '../../src/transforms/vHtml'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import { createObjectMatcher } from '../../../com... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/apiCustomElement.ts | packages/runtime-dom/src/apiCustomElement.ts | import {
type App,
type Component,
type ComponentCustomElementInterface,
type ComponentInjectOptions,
type ComponentInternalInstance,
type ComponentObjectPropsOptions,
type ComponentOptions,
type ComponentOptionsBase,
type ComponentOptionsMixin,
type ComponentProvideOptions,
type ComponentPublicIn... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/jsx.ts | packages/runtime-dom/src/jsx.ts | // Note: this file is auto concatenated to the end of the bundled d.ts during
// build.
// This code is based on react definition in DefinitelyTyped published under the MIT license.
// Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
// Path in the repository: types/react/index.d.ts
//
// Copyr... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/nodeOps.ts | packages/runtime-dom/src/nodeOps.ts | import { warn } from '@vue/runtime-core'
import type { RendererOptions } from '@vue/runtime-core'
import type {
TrustedHTML,
TrustedTypePolicy,
TrustedTypesWindow,
} from 'trusted-types/lib'
let policy: Pick<TrustedTypePolicy, 'name' | 'createHTML'> | undefined =
undefined
const tt =
typeof window !== 'unde... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/patchProp.ts | packages/runtime-dom/src/patchProp.ts | import { patchClass } from './modules/class'
import { patchStyle } from './modules/style'
import { patchAttr } from './modules/attrs'
import { patchDOMProp } from './modules/props'
import { patchEvent } from './modules/events'
import {
camelize,
isFunction,
isModelListener,
isOn,
isString,
} from '@vue/shared... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/index.ts | packages/runtime-dom/src/index.ts | import {
type App,
type CreateAppFunction,
type DefineComponent,
DeprecationTypes,
type Directive,
type ElementNamespace,
type HydrationRenderer,
type Renderer,
type RootHydrateFunction,
type RootRenderFunction,
compatUtils,
createHydrationRenderer,
createRenderer,
isRuntimeOnly,
warn,
} f... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/helpers/useCssVars.ts | packages/runtime-dom/src/helpers/useCssVars.ts | import {
Fragment,
Static,
type VNode,
getCurrentInstance,
onBeforeUpdate,
onMounted,
onUnmounted,
queuePostFlushCb,
warn,
watch,
} from '@vue/runtime-core'
import { NOOP, ShapeFlags, normalizeCssVarValue } from '@vue/shared'
export const CSS_VAR_TEXT: unique symbol = Symbol(__DEV__ ? 'CSS_VAR_TEXT... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/helpers/useCssModule.ts | packages/runtime-dom/src/helpers/useCssModule.ts | import { getCurrentInstance, warn } from '@vue/runtime-core'
import { EMPTY_OBJ } from '@vue/shared'
export function useCssModule(name = '$style'): Record<string, string> {
if (!__GLOBAL__) {
const instance = getCurrentInstance()!
if (!instance) {
__DEV__ && warn(`useCssModule must be called inside set... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/components/TransitionGroup.ts | packages/runtime-dom/src/components/TransitionGroup.ts | import {
type ElementWithTransition,
type TransitionProps,
TransitionPropsValidators,
addTransitionClass,
forceReflow,
getTransitionInfo,
removeTransitionClass,
resolveTransitionProps,
vtcKey,
} from './Transition'
import {
type ComponentOptions,
DeprecationTypes,
Fragment,
type SetupContext,
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/components/Transition.ts | packages/runtime-dom/src/components/Transition.ts | import {
BaseTransition,
type BaseTransitionProps,
BaseTransitionPropsValidators,
DeprecationTypes,
type FunctionalComponent,
assertNumber,
compatUtils,
h,
} from '@vue/runtime-core'
import { extend, isArray, isObject, toNumber } from '@vue/shared'
const TRANSITION = 'transition'
const ANIMATION = 'ani... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/modules/class.ts | packages/runtime-dom/src/modules/class.ts | import { type ElementWithTransition, vtcKey } from '../components/Transition'
// compiler should normalize class + :class bindings on the same element
// into a single binding ['staticClass', dynamic]
export function patchClass(
el: Element,
value: string | null,
isSVG: boolean,
): void {
// directly setting c... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/modules/attrs.ts | packages/runtime-dom/src/modules/attrs.ts | import {
NOOP,
includeBooleanAttr,
isSpecialBooleanAttr,
isSymbol,
makeMap,
} from '@vue/shared'
import {
type ComponentInternalInstance,
DeprecationTypes,
compatUtils,
} from '@vue/runtime-core'
export const xlinkNS = 'http://www.w3.org/1999/xlink'
export function patchAttr(
el: Element,
key: str... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/modules/props.ts | packages/runtime-dom/src/modules/props.ts | import { DeprecationTypes, compatUtils, warn } from '@vue/runtime-core'
import { includeBooleanAttr } from '@vue/shared'
import { unsafeToTrustedHTML } from '../nodeOps'
// functions. The user is responsible for using them with only trusted content.
export function patchDOMProp(
el: any,
key: string,
value: any,... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/modules/events.ts | packages/runtime-dom/src/modules/events.ts | import { NOOP, hyphenate, isArray, isFunction } from '@vue/shared'
import {
type ComponentInternalInstance,
ErrorCodes,
callWithAsyncErrorHandling,
warn,
} from '@vue/runtime-core'
interface Invoker extends EventListener {
value: EventValue
attached: number
}
type EventValue = Function | Function[]
expor... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/modules/style.ts | packages/runtime-dom/src/modules/style.ts | import { capitalize, hyphenate, isArray, isString } from '@vue/shared'
import { camelize, warn } from '@vue/runtime-core'
import {
type VShowElement,
vShowHidden,
vShowOriginalDisplay,
} from '../directives/vShow'
import { CSS_VAR_TEXT } from '../helpers/useCssVars'
type Style = string | Record<string, string | ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/directives/vModel.ts | packages/runtime-dom/src/directives/vModel.ts | import {
type DirectiveBinding,
type DirectiveHook,
type ObjectDirective,
type VNode,
nextTick,
warn,
} from '@vue/runtime-core'
import { addEventListener } from '../modules/events'
import {
invokeArrayFns,
isArray,
isSet,
looseEqual,
looseIndexOf,
looseToNumber,
} from '@vue/shared'
type Assig... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/directives/vOn.ts | packages/runtime-dom/src/directives/vOn.ts | import {
type ComponentInternalInstance,
DeprecationTypes,
type Directive,
type LegacyConfig,
compatUtils,
getCurrentInstance,
} from '@vue/runtime-core'
import { hyphenate, isArray } from '@vue/shared'
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'] as const
type SystemModifiers = (typeof systemM... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/src/directives/vShow.ts | packages/runtime-dom/src/directives/vShow.ts | import type { ObjectDirective } from '@vue/runtime-core'
export const vShowOriginalDisplay: unique symbol = Symbol('_vod')
export const vShowHidden: unique symbol = Symbol('_vsh')
export interface VShowElement extends HTMLElement {
// _vod = vue original display
[vShowOriginalDisplay]: string
[vShowHidden]: boo... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/patchAttrs.spec.ts | packages/runtime-dom/__tests__/patchAttrs.spec.ts | import { patchProp } from '../src/patchProp'
import { xlinkNS } from '../src/modules/attrs'
describe('runtime-dom: attrs patching', () => {
test('xlink attributes', () => {
const el = document.createElementNS('http://www.w3.org/2000/svg', 'use')
patchProp(el, 'xlink:href', null, 'a', 'svg')
expect(el.get... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/patchEvents.spec.ts | packages/runtime-dom/__tests__/patchEvents.spec.ts | import { patchProp } from '../src/patchProp'
const timeout = () => new Promise(r => setTimeout(r))
describe(`runtime-dom: events patching`, () => {
it('should assign event handler', async () => {
const el = document.createElement('div')
const fn = vi.fn()
patchProp(el, 'onClick', null, fn)
el.dispat... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/patchProps.spec.ts | packages/runtime-dom/__tests__/patchProps.spec.ts | import { patchProp } from '../src/patchProp'
import {
h,
nextTick,
ref,
render,
vModelCheckbox,
withDirectives,
} from '../src'
describe('runtime-dom: props patching', () => {
test('basic', () => {
const el = document.createElement('div')
patchProp(el, 'id', null, 'foo')
expect(el.id).toBe('f... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/nodeOps.spec.ts | packages/runtime-dom/__tests__/nodeOps.spec.ts | import { defineComponent, h, nextTick, ref } from 'vue'
import { mathmlNS, nodeOps, svgNS } from '../src/nodeOps'
import { render } from '@vue/runtime-dom'
describe('runtime-dom: node-ops', () => {
test("the <select>'s multiple attr should be set in createElement", () => {
const el = nodeOps.createElement('select... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts | packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts | import type { MockInstance } from 'vitest'
import { h, render } from '@vue/runtime-dom'
describe('customized built-in elements support', () => {
let createElement: MockInstance
afterEach(() => {
createElement.mockRestore()
})
test('should created element with is option', () => {
const root = document.... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/createApp.spec.ts | packages/runtime-dom/__tests__/createApp.spec.ts | import { createApp, h } from '../src'
describe('createApp for dom', () => {
// #2926
test('mount to SVG container', () => {
const root = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
createApp({
render() {
return h('g')
},
}).mount(root)
expect(root.children.leng... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/patchStyle.spec.ts | packages/runtime-dom/__tests__/patchStyle.spec.ts | import { patchProp } from '../src/patchProp'
describe(`runtime-dom: style patching`, () => {
it('string', () => {
const el = document.createElement('div')
patchProp(el, 'style', {}, 'color:red')
expect(el.style.cssText.replace(/\s/g, '')).toBe('color:red;')
})
// #1309
it('should not patch same st... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/rendererStaticNode.spec.ts | packages/runtime-dom/__tests__/rendererStaticNode.spec.ts | import { createStaticVNode, h, render } from '../src'
describe('static vnode handling', () => {
const content = `<div>hello</div><p>world</p>`
const content2 = `<p>foo</p><div>bar</div><span>baz</span>`
const s = createStaticVNode(content, 2)
const s2 = createStaticVNode(content2, 3)
test('should mount fro... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/customElement.spec.ts | packages/runtime-dom/__tests__/customElement.spec.ts | import type { MockedFunction } from 'vitest'
import {
type HMRRuntime,
type Ref,
Teleport,
type VueElement,
createApp,
defineAsyncComponent,
defineComponent,
defineCustomElement,
h,
inject,
nextTick,
onMounted,
provide,
ref,
render,
renderSlot,
useHost,
useShadowRoot,
} from '../src'... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/patchClass.spec.ts | packages/runtime-dom/__tests__/patchClass.spec.ts | import { patchProp } from '../src/patchProp'
import {
type ElementWithTransition,
vtcKey,
} from '../src/components/Transition'
import { svgNS } from '../src/nodeOps'
describe('runtime-dom: class patching', () => {
test('basics', () => {
const el = document.createElement('div')
patchProp(el, 'class', nul... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/helpers/useCssModule.spec.ts | packages/runtime-dom/__tests__/helpers/useCssModule.spec.ts | import { h, nodeOps, render } from '@vue/runtime-test'
import { useCssModule } from '../../src/helpers/useCssModule'
describe('useCssModule', () => {
function mountWithModule(modules: any, name?: string) {
let res
render(
h({
render() {},
__cssModules: modules,
setup() {
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts | packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts | import {
type ComponentOptions,
type FunctionalComponent,
Suspense,
Teleport,
createStaticVNode,
defineCustomElement,
h,
nextTick,
onMounted,
reactive,
ref,
render,
useCssVars,
} from '@vue/runtime-dom'
describe('useCssVars', () => {
async function assertCssVars(getApp: (state: any) => Comp... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/directives/vCloak.spec.ts | packages/runtime-dom/__tests__/directives/vCloak.spec.ts | import { createApp } from '@vue/runtime-dom'
describe('vCloak', () => {
test('should be removed after compile', () => {
const root = document.createElement('div')
root.setAttribute('v-cloak', '')
createApp({
render() {},
}).mount(root)
expect(root.hasAttribute('v-cloak')).toBe(false)
})
}... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/directives/vModel.spec.ts | packages/runtime-dom/__tests__/directives/vModel.spec.ts | import {
type VNode,
defineComponent,
h,
nextTick,
ref,
render,
vModelCheckbox,
vModelDynamic,
withDirectives,
} from '@vue/runtime-dom'
const triggerEvent = (type: string, el: Element) => {
const event = new Event(type)
el.dispatchEvent(event)
}
const withVModel = (node: VNode, arg: any, mods?:... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/directives/vShow.spec.ts | packages/runtime-dom/__tests__/directives/vShow.spec.ts | import {
type VNode,
defineComponent,
h,
nextTick,
ref,
watch,
withDirectives,
} from '@vue/runtime-core'
import { Transition, render, vShow } from '@vue/runtime-dom'
const withVShow = (node: VNode, exp: any) =>
withDirectives(node, [[vShow, exp]])
let root: any
beforeEach(() => {
root = document.c... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/runtime-dom/__tests__/directives/vOn.spec.ts | packages/runtime-dom/__tests__/directives/vOn.spec.ts | import { patchEvent } from '../../src/modules/events'
import { withKeys, withModifiers } from '@vue/runtime-dom'
function triggerEvent(
target: Element,
event: string,
process?: (e: any) => any,
) {
const e = new Event(event, {
bubbles: true,
cancelable: true,
})
if (event === 'click') {
;(e as... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/parse.ts | packages/compiler-sfc/src/parse.ts | import {
type BindingMetadata,
type CodegenSourceMapGenerator,
type CompilerError,
type ElementNode,
NodeTypes,
type ParserOptions,
type RawSourceMap,
type RootNode,
type SourceLocation,
createRoot,
} from '@vue/compiler-core'
import * as CompilerDOM from '@vue/compiler-dom'
import { SourceMapGenera... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/compileTemplate.ts | packages/compiler-sfc/src/compileTemplate.ts | import {
type CodegenResult,
type CompilerError,
type CompilerOptions,
type ElementNode,
type NodeTransform,
NodeTypes,
type ParserOptions,
type RawSourceMap,
type RootNode,
createRoot,
} from '@vue/compiler-core'
import { SourceMapConsumer, SourceMapGenerator } from 'source-map-js'
import {
type ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/compileStyle.ts | packages/compiler-sfc/src/compileStyle.ts | import postcss, {
type LazyResult,
type Message,
type ProcessOptions,
type Result,
type SourceMap,
} from 'postcss'
import trimPlugin from './style/pluginTrim'
import scopedPlugin from './style/pluginScoped'
import {
type PreprocessLang,
type StylePreprocessor,
type StylePreprocessorResults,
processor... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/cache.ts | packages/compiler-sfc/src/cache.ts | import { LRUCache } from 'lru-cache'
export function createCache<T extends {}>(
max = 500,
): Map<string, T> | LRUCache<string, T> {
/* v8 ignore next 3 */
if (__GLOBAL__ || __ESM_BROWSER__) {
return new Map<string, T>()
}
return new LRUCache({ max })
}
| typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/compileScript.ts | packages/compiler-sfc/src/compileScript.ts | import {
BindingTypes,
UNREF,
isFunctionType,
unwrapTSNode,
walkIdentifiers,
} from '@vue/compiler-dom'
import {
DEFAULT_FILENAME,
type SFCDescriptor,
type SFCScriptBlock,
} from './parse'
import type { ParserPlugin } from '@babel/parser'
import { generateCodeFrame } from '@vue/shared'
import type {
A... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/index.ts | packages/compiler-sfc/src/index.ts | export const version: string = __VERSION__
// API
export { parse } from './parse'
export { compileTemplate } from './compileTemplate'
export { compileStyle, compileStyleAsync } from './compileStyle'
export { compileScript } from './compileScript'
export { rewriteDefault, rewriteDefaultAST } from './rewriteDefault'
exp... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/warn.ts | packages/compiler-sfc/src/warn.ts | const hasWarned: Record<string, boolean> = {}
export function warnOnce(msg: string): void {
const isNodeProd =
typeof process !== 'undefined' && process.env.NODE_ENV === 'production'
if (!isNodeProd && !__TEST__ && !hasWarned[msg]) {
hasWarned[msg] = true
warn(msg)
}
}
export function warn(msg: stri... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/rewriteDefault.ts | packages/compiler-sfc/src/rewriteDefault.ts | import { parse } from '@babel/parser'
import MagicString from 'magic-string'
import type { ParserPlugin } from '@babel/parser'
import type { Identifier, Statement } from '@babel/types'
import { resolveParserPlugins } from './script/context'
export function rewriteDefault(
input: string,
as: string,
parserPlugins... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/shims.d.ts | packages/compiler-sfc/src/shims.d.ts | declare module 'merge-source-map' {
export default function merge(oldMap: object, newMap: object): object
}
| typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/style/preprocessors.ts | packages/compiler-sfc/src/style/preprocessors.ts | import merge from 'merge-source-map'
import type { RawSourceMap } from '@vue/compiler-core'
import type { SFCStyleCompileOptions } from '../compileStyle'
import { isFunction } from '@vue/shared'
export type StylePreprocessor = (
source: string,
map: RawSourceMap | undefined,
options: {
[key: string]: any
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/style/pluginTrim.ts | packages/compiler-sfc/src/style/pluginTrim.ts | import type { PluginCreator } from 'postcss'
const trimPlugin: PluginCreator<{}> = () => {
return {
postcssPlugin: 'vue-sfc-trim',
Once(root) {
root.walk(({ type, raws }) => {
if (type === 'rule' || type === 'atrule') {
if (raws.before) raws.before = '\n'
if ('after' in raws... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/style/cssVars.ts | packages/compiler-sfc/src/style/cssVars.ts | import {
type BindingMetadata,
NodeTypes,
type SimpleExpressionNode,
createRoot,
createSimpleExpression,
createTransformContext,
processExpression,
} from '@vue/compiler-dom'
import type { SFCDescriptor } from '../parse'
import type { PluginCreator } from 'postcss'
import hash from 'hash-sum'
import { get... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/style/pluginScoped.ts | packages/compiler-sfc/src/style/pluginScoped.ts | import {
type AtRule,
type Container,
type Document,
type PluginCreator,
Rule,
} from 'postcss'
import selectorParser from 'postcss-selector-parser'
import { warn } from '../warn'
const animationNameRE = /^(?:-\w+-)?animation-name$/
const animationRE = /^(?:-\w+-)?animation$/
const keyframesRE = /^(?:-\w+-)?... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/analyzeScriptBindings.ts | packages/compiler-sfc/src/script/analyzeScriptBindings.ts | import type {
ArrayExpression,
Node,
ObjectExpression,
Statement,
} from '@babel/types'
import { type BindingMetadata, BindingTypes } from '@vue/compiler-dom'
import { resolveObjectKey } from './utils'
/**
* Analyze bindings in normal `<script>`
* Note that `compileScriptSetup` already analyzes bindings as p... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineSlots.ts | packages/compiler-sfc/src/script/defineSlots.ts | import type { LVal, Node } from '@babel/types'
import { isCallOf } from './utils'
import type { ScriptCompileContext } from './context'
export const DEFINE_SLOTS = 'defineSlots'
export function processDefineSlots(
ctx: ScriptCompileContext,
node: Node,
declId?: LVal,
): boolean {
if (!isCallOf(node, DEFINE_SL... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/normalScript.ts | packages/compiler-sfc/src/script/normalScript.ts | import { analyzeScriptBindings } from './analyzeScriptBindings'
import type { ScriptCompileContext } from './context'
import MagicString from 'magic-string'
import { rewriteDefaultAST } from '../rewriteDefault'
import { genNormalScriptCssVarsCode } from '../style/cssVars'
import type { SFCScriptBlock } from '../parse'
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineModel.ts | packages/compiler-sfc/src/script/defineModel.ts | import type { LVal, Node, TSType } from '@babel/types'
import type { ScriptCompileContext } from './context'
import { inferRuntimeType } from './resolveType'
import { UNKNOWN_TYPE, isCallOf, toRuntimeTypeString } from './utils'
import { BindingTypes, unwrapTSNode } from '@vue/compiler-dom'
export const DEFINE_MODEL = ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/definePropsDestructure.ts | packages/compiler-sfc/src/script/definePropsDestructure.ts | import type {
BlockStatement,
Expression,
Identifier,
Node,
ObjectPattern,
Program,
VariableDeclaration,
} from '@babel/types'
import { walk } from 'estree-walker'
import {
BindingTypes,
TS_NODE_TYPES,
extractIdentifiers,
isFunctionType,
isInDestructureAssignment,
isReferencedIdentifier,
isS... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/utils.ts | packages/compiler-sfc/src/script/utils.ts | import type {
CallExpression,
Expression,
Identifier,
ImportDefaultSpecifier,
ImportNamespaceSpecifier,
ImportSpecifier,
Node,
StringLiteral,
TSMethodSignature,
TSPropertySignature,
} from '@babel/types'
import path from 'path'
export const UNKNOWN_TYPE = 'Unknown'
export function resolveObjectKey... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineEmits.ts | packages/compiler-sfc/src/script/defineEmits.ts | import type {
ArrayPattern,
Identifier,
LVal,
Node,
ObjectPattern,
RestElement,
} from '@babel/types'
import { isCallOf } from './utils'
import type { ScriptCompileContext } from './context'
import {
type TypeResolveContext,
resolveTypeElements,
resolveUnionType,
} from './resolveType'
export const D... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/resolveType.ts | packages/compiler-sfc/src/script/resolveType.ts | import type {
Expression,
Identifier,
Node,
Statement,
TSCallSignatureDeclaration,
TSEnumDeclaration,
TSExpressionWithTypeArguments,
TSFunctionType,
TSImportType,
TSIndexedAccessType,
TSInterfaceDeclaration,
TSMappedType,
TSMethodSignature,
TSModuleBlock,
TSModuleDeclaration,
TSPropertyS... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/importUsageCheck.ts | packages/compiler-sfc/src/script/importUsageCheck.ts | import type { SFCDescriptor } from '../parse'
import {
type ExpressionNode,
NodeTypes,
type SimpleExpressionNode,
type TemplateChildNode,
isSimpleIdentifier,
parserOptions,
walkIdentifiers,
} from '@vue/compiler-dom'
import { createCache } from '../cache'
import { camelize, capitalize, isBuiltInDirective ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineOptions.ts | packages/compiler-sfc/src/script/defineOptions.ts | import type { Node } from '@babel/types'
import { unwrapTSNode } from '@vue/compiler-dom'
import type { ScriptCompileContext } from './context'
import { isCallOf } from './utils'
import { DEFINE_PROPS } from './defineProps'
import { DEFINE_EMITS } from './defineEmits'
import { DEFINE_EXPOSE } from './defineExpose'
impo... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineExpose.ts | packages/compiler-sfc/src/script/defineExpose.ts | import type { Node } from '@babel/types'
import { isCallOf } from './utils'
import type { ScriptCompileContext } from './context'
export const DEFINE_EXPOSE = 'defineExpose'
export function processDefineExpose(
ctx: ScriptCompileContext,
node: Node,
): boolean {
if (isCallOf(node, DEFINE_EXPOSE)) {
if (ctx.... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/topLevelAwait.ts | packages/compiler-sfc/src/script/topLevelAwait.ts | import type { AwaitExpression } from '@babel/types'
import type { ScriptCompileContext } from './context'
/**
* Support context-persistence between top-level await expressions:
*
* ```js
* const instance = getCurrentInstance()
* await foo()
* expect(getCurrentInstance()).toBe(instance)
* ```
*
* In the future... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/context.ts | packages/compiler-sfc/src/script/context.ts | import type { CallExpression, Node, ObjectPattern, Program } from '@babel/types'
import type { SFCDescriptor } from '../parse'
import { generateCodeFrame, isArray } from '@vue/shared'
import { type ParserPlugin, parse as babelParse } from '@babel/parser'
import type { ImportBinding, SFCScriptCompileOptions } from '../c... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/script/defineProps.ts | packages/compiler-sfc/src/script/defineProps.ts | import type {
Expression,
LVal,
Node,
ObjectExpression,
ObjectMethod,
ObjectProperty,
} from '@babel/types'
import { BindingTypes, isFunctionType, unwrapTSNode } from '@vue/compiler-dom'
import type { ScriptCompileContext } from './context'
import {
type TypeResolveContext,
inferRuntimeType,
resolveTy... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/template/transformSrcset.ts | packages/compiler-sfc/src/template/transformSrcset.ts | import path from 'path'
import {
ConstantTypes,
type ExpressionNode,
type NodeTransform,
NodeTypes,
type SimpleExpressionNode,
createCompoundExpression,
createSimpleExpression,
} from '@vue/compiler-core'
import {
isDataUrl,
isExternalUrl,
isRelativeUrl,
parseUrl,
} from './templateUtils'
import {... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/template/transformAssetUrl.ts | packages/compiler-sfc/src/template/transformAssetUrl.ts | import path from 'path'
import {
ConstantTypes,
type ExpressionNode,
type NodeTransform,
NodeTypes,
type SimpleExpressionNode,
type SourceLocation,
type TransformContext,
createSimpleExpression,
} from '@vue/compiler-core'
import {
isDataUrl,
isExternalUrl,
isRelativeUrl,
parseUrl,
} from './tem... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/src/template/templateUtils.ts | packages/compiler-sfc/src/template/templateUtils.ts | import { type UrlWithStringQuery, parse as uriParse } from 'url'
import { isString } from '@vue/shared'
export function isRelativeUrl(url: string): boolean {
const firstChar = url.charAt(0)
return firstChar === '.' || firstChar === '~' || firstChar === '@'
}
const externalRE = /^(?:https?:)?\/\//
export function ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/utils.ts | packages/compiler-sfc/__tests__/utils.ts | import {
type SFCParseOptions,
type SFCScriptBlock,
type SFCScriptCompileOptions,
compileScript,
parse,
} from '../src'
import { parse as babelParse } from '@babel/parser'
export const mockId = 'xxxxxxxx'
export function compileSFCScript(
src: string,
options?: Partial<SFCScriptCompileOptions>,
parseO... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/templateTransformSrcset.spec.ts | packages/compiler-sfc/__tests__/templateTransformSrcset.spec.ts | import {
type TransformOptions,
baseParse,
generate,
transform,
} from '@vue/compiler-core'
import {
createSrcsetTransformWithOptions,
transformSrcset,
} from '../src/template/transformSrcset'
import { transformElement } from '../../compiler-core/src/transforms/transformElement'
import { transformBind } fro... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/parse.spec.ts | packages/compiler-sfc/__tests__/parse.spec.ts | import { parse } from '../src'
import {
ElementTypes,
NodeTypes,
baseCompile,
createRoot,
} from '@vue/compiler-core'
import { SourceMapConsumer } from 'source-map-js'
describe('compiler:sfc', () => {
describe('source map', () => {
test('style block', () => {
// Padding determines how many blank li... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/cssVars.spec.ts | packages/compiler-sfc/__tests__/cssVars.spec.ts | import { compileStyle, parse } from '../src'
import { assertCode, compileSFCScript, mockId } from './utils'
describe('CSS vars injection', () => {
test('generating correct code for nested paths', () => {
const { content } = compileSFCScript(
`<script>const a = 1</script>\n` +
`<style>div{
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileTemplate.spec.ts | packages/compiler-sfc/__tests__/compileTemplate.spec.ts | import { type RawSourceMap, SourceMapConsumer } from 'source-map-js'
import { parse as babelParse } from '@babel/parser'
import {
type SFCTemplateCompileOptions,
compileTemplate,
} from '../src/compileTemplate'
import { type SFCTemplateBlock, parse } from '../src/parse'
import { compileScript } from '../src'
import... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileStyle.spec.ts | packages/compiler-sfc/__tests__/compileStyle.spec.ts | import {
type SFCStyleCompileOptions,
compileStyle,
compileStyleAsync,
} from '../src/compileStyle'
import path from 'node:path'
export function compileScoped(
source: string,
options?: Partial<SFCStyleCompileOptions>,
): string {
const res = compileStyle({
source,
filename: 'test.css',
id: 'da... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/templateUtils.spec.ts | packages/compiler-sfc/__tests__/templateUtils.spec.ts | import {
isDataUrl,
isExternalUrl,
isRelativeUrl,
} from '../src/template/templateUtils'
describe('compiler sfc:templateUtils isRelativeUrl', () => {
test('should return true when The first character of the string path is .', () => {
const url = './**.vue'
const result = isRelativeUrl(url)
expect(r... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/rewriteDefault.spec.ts | packages/compiler-sfc/__tests__/rewriteDefault.spec.ts | import { rewriteDefault } from '../src'
describe('compiler sfc: rewriteDefault', () => {
test('without export default', () => {
expect(rewriteDefault(`export const a = {}`, 'script'))
.toMatchInlineSnapshot(`
"export const a = {}
const script = {}"
`)
})
test('rewrite export default', ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/templateTransformAssetUrl.spec.ts | packages/compiler-sfc/__tests__/templateTransformAssetUrl.spec.ts | import {
type TransformOptions,
baseParse,
generate,
transform,
} from '@vue/compiler-core'
import {
type AssetURLOptions,
createAssetUrlTransformWithOptions,
normalizeOptions,
transformAssetUrl,
} from '../src/template/transformAssetUrl'
import { transformElement } from '../../compiler-core/src/transfo... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript.spec.ts | packages/compiler-sfc/__tests__/compileScript.spec.ts | import { vi } from 'vitest'
import { BindingTypes } from '@vue/compiler-core'
import {
assertCode,
compileSFCScript as compile,
getPositionInCode,
mockId,
} from './utils'
import { type RawSourceMap, SourceMapConsumer } from 'source-map-js'
vi.mock('../src/warn', () => ({
warn: vi.fn(),
warnOnce: vi.fn(),
... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | true |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts | packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts | import { BindingTypes } from '@vue/compiler-core'
import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineProps', () => {
test('basic usage', () => {
const { content, bindings } = compile(`
<script setup>
const props = defineProps({
foo: String
})
const bar = 1
</script>
`)
// ... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts | packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts | import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineSlots()', () => {
test('basic usage', () => {
const { content } = compile(`
<script setup lang="ts">
const slots = defineSlots<{
default: { msg: string }
}>()
</script>
`)
assertCode(content... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
vuejs/core | https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts | packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts | import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineOptions()', () => {
test('basic usage', () => {
const { content } = compile(`
<script setup>
defineOptions({ name: 'FooApp' })
</script>
`)
assertCode(content)
// should remove defineOptions import an... | typescript | MIT | aac7e1898907445c8f89b22047a9bfcf0a6e91b8 | 2026-01-04T15:31:41.625443Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.