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-sfc/__tests__/compileScript/hoistStatic.spec.ts
packages/compiler-sfc/__tests__/compileScript/hoistStatic.spec.ts
import { BindingTypes } from '@vue/compiler-core' import type { SFCScriptCompileOptions } from '../../src' import { assertCode, compileSFCScript } from '../utils' describe('sfc hoist static', () => { function compile(src: string, options?: Partial<SFCScriptCompileOptions>) { return compileSFCScript(src, { ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts
packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts
import { BindingTypes } from '@vue/compiler-core' import type { SFCScriptCompileOptions } from '../../src' import { assertCode, compileSFCScript } from '../utils' describe('sfc reactive props destructure', () => { function compile(src: string, options?: Partial<SFCScriptCompileOptions>) { return compileSFCScript...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
import { normalize } from 'node:path' import type { Identifier } from '@babel/types' import { type SFCScriptCompileOptions, parse } from '../../src' import { ScriptCompileContext } from '../../src/script/context' import { inferRuntimeType, invalidateTypeCache, recordImports, registerTS, resolveTypeElements, }...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/defineEmits.spec.ts
packages/compiler-sfc/__tests__/compileScript/defineEmits.spec.ts
import { BindingTypes } from '@vue/compiler-core' import { assertCode, compileSFCScript as compile } from '../utils' describe('defineEmits', () => { test('basic usage', () => { const { content, bindings } = compile(` <script setup> const myEmit = defineEmits(['foo', 'bar']) </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/defineModel.spec.ts
packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts
import { BindingTypes } from '@vue/compiler-core' import { assertCode, compileSFCScript as compile } from '../utils' describe('defineModel()', () => { test('basic usage', () => { const { content, bindings } = compile( ` <script setup> const modelValue = defineModel({ required: true }) con...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts
packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts
import { assertCode, compileSFCScript as compile } from '../utils' // in dev mode, declared bindings are returned as an object from setup() // when using TS, users may import types which should not be returned as // values, so we need to check import usage in the template to determine // what to be returned. test('co...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts
packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts
import { assertCode, compileSFCScript as compile } from '../utils' test('defineExpose()', () => { const { content } = compile(` <script setup> defineExpose({ foo: 123 }) </script> `) assertCode(content) // should remove defineOptions import and call expect(content).not.toMatch('defineExpose') // should gener...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transform.ts
packages/compiler-core/src/transform.ts
import type { TransformOptions } from './options' import { type ArrayExpression, type CacheExpression, ConstantTypes, type DirectiveNode, type ElementNode, ElementTypes, type ExpressionNode, type JSChildNode, NodeTypes, type ParentNode, type Property, type RootNode, type SimpleExpressionNode, ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/runtimeHelpers.ts
packages/compiler-core/src/runtimeHelpers.ts
export const FRAGMENT: unique symbol = Symbol(__DEV__ ? `Fragment` : ``) export const TELEPORT: unique symbol = Symbol(__DEV__ ? `Teleport` : ``) export const SUSPENSE: unique symbol = Symbol(__DEV__ ? `Suspense` : ``) export const KEEP_ALIVE: unique symbol = Symbol(__DEV__ ? `KeepAlive` : ``) export const BASE_TRANSIT...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/babelUtils.ts
packages/compiler-core/src/babelUtils.ts
// should only use types from @babel/types // do not import runtime methods import type { BlockStatement, ForInStatement, ForOfStatement, ForStatement, Function, Identifier, Node, ObjectProperty, Program, SwitchCase, SwitchStatement, } from '@babel/types' import { walk } from 'estree-walker' /** ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/errors.ts
packages/compiler-core/src/errors.ts
import type { SourceLocation } from './ast' export interface CompilerError extends SyntaxError { code: number | string loc?: SourceLocation } export interface CoreCompilerError extends CompilerError { code: ErrorCodes } export function defaultOnError(error: CompilerError): never { throw error } export funct...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/validateExpression.ts
packages/compiler-core/src/validateExpression.ts
import type { SimpleExpressionNode } from './ast' import type { TransformContext } from './transform' import { ErrorCodes, createCompilerError } from './errors' // these keywords should not appear inside expressions, but operators like // 'typeof', 'instanceof', and 'in' are allowed const prohibitedKeywordRE = new Reg...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/utils.ts
packages/compiler-core/src/utils.ts
import { type BlockCodegenNode, type CacheExpression, type CallExpression, type DirectiveNode, type ElementNode, ElementTypes, type ExpressionNode, type IfBranchNode, type InterpolationNode, type JSChildNode, type MemoExpression, NodeTypes, type ObjectExpression, type Position, type Proper...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/ast.ts
packages/compiler-core/src/ast.ts
import { type PatchFlags, isString } from '@vue/shared' import { CREATE_BLOCK, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, type CREATE_SLOTS, CREATE_VNODE, type FRAGMENT, OPEN_BLOCK, type RENDER_LIST, type RENDER_SLOT, WITH_DIRECTIVES, type WITH_MEMO, } from './runtimeHelpers' import type { PropsE...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/options.ts
packages/compiler-core/src/options.ts
import type { ElementNode, Namespace, Namespaces, ParentNode, TemplateChildNode, } from './ast' import type { CompilerError } from './errors' import type { DirectiveTransform, NodeTransform, TransformContext, } from './transform' import type { CompilerCompatOptions } from './compat/compatConfig' import ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/codegen.ts
packages/compiler-core/src/codegen.ts
import type { CodegenOptions } from './options' import { type ArrayExpression, type AssignmentExpression, type CacheExpression, type CallExpression, type CommentNode, type CompoundExpressionNode, type ConditionalExpression, type ExpressionNode, type FunctionExpression, type IfStatement, type Inter...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/compile.ts
packages/compiler-core/src/compile.ts
import type { CompilerOptions } from './options' import { baseParse } from './parser' import { type DirectiveTransform, type NodeTransform, transform, } from './transform' import { type CodegenResult, generate } from './codegen' import type { RootNode } from './ast' import { extend, isString } from '@vue/shared' ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/tokenizer.ts
packages/compiler-core/src/tokenizer.ts
/** * This Tokenizer is adapted from htmlparser2 under the MIT License listed at * https://github.com/fb55/htmlparser2/blob/master/LICENSE Copyright 2010, 2011, Chris Winberry <chris@winberry.net>. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/index.ts
packages/compiler-core/src/index.ts
export { baseCompile } from './compile' // Also expose lower level APIs & types export { type CompilerOptions, type ParserOptions, type TransformOptions, type CodegenOptions, type HoistTransform, type BindingMetadata, BindingTypes, } from './options' export { baseParse } from './parser' export { transf...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/parser.ts
packages/compiler-core/src/parser.ts
import { type AttributeNode, ConstantTypes, type DirectiveNode, type ElementNode, ElementTypes, type ForParseResult, Namespaces, NodeTypes, type RootNode, type SimpleExpressionNode, type SourceLocation, type TemplateChildNode, createRoot, createSimpleExpression, } from './ast' import type { ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/compat/compatConfig.ts
packages/compiler-core/src/compat/compatConfig.ts
import type { SourceLocation } from '../ast' import type { CompilerError } from '../errors' import type { MergedParserOptions } from '../parser' import type { TransformContext } from '../transform' export type CompilerCompatConfig = Partial< Record<CompilerDeprecationTypes, boolean | 'suppress-warning'> > & { MODE...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/compat/transformFilter.ts
packages/compiler-core/src/compat/transformFilter.ts
import { RESOLVE_FILTER } from '../runtimeHelpers' import { type AttributeNode, type DirectiveNode, type ExpressionNode, NodeTypes, type SimpleExpressionNode, } from '../ast' import { CompilerDeprecationTypes, isCompatEnabled, warnDeprecation, } from './compatConfig' import type { NodeTransform, Transfo...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vOnce.ts
packages/compiler-core/src/transforms/vOnce.ts
import type { NodeTransform } from '../transform' import { findDir } from '../utils' import { type ElementNode, type ForNode, type IfNode, NodeTypes } from '../ast' import { SET_BLOCK_TRACKING } from '../runtimeHelpers' const seen = new WeakSet() export const transformOnce: NodeTransform = (node, context) => { if (...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vModel.ts
packages/compiler-core/src/transforms/vModel.ts
import type { DirectiveTransform } from '../transform' import { ConstantTypes, ElementTypes, type ExpressionNode, NodeTypes, type Property, createCompoundExpression, createObjectProperty, createSimpleExpression, } from '../ast' import { ErrorCodes, createCompilerError } from '../errors' import { hasSc...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/noopDirectiveTransform.ts
packages/compiler-core/src/transforms/noopDirectiveTransform.ts
import type { DirectiveTransform } from '../transform' export const noopDirectiveTransform: DirectiveTransform = () => ({ props: [] })
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/transformExpression.ts
packages/compiler-core/src/transforms/transformExpression.ts
// - Parse expressions in templates into compound expressions so that each // identifier gets more accurate source-map locations. // // - Prefix identifiers with `_ctx.` or `$xxx` (for known binding types) so that // they are accessed from the right source // // - This transform is only applied in non-browser build...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/transformText.ts
packages/compiler-core/src/transforms/transformText.ts
import type { NodeTransform } from '../transform' import { type CallExpression, type CompoundExpressionNode, ConstantTypes, ElementTypes, NodeTypes, createCallExpression, createCompoundExpression, } from '../ast' import { isText } from '../utils' import { CREATE_TEXT } from '../runtimeHelpers' import { Pa...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vOn.ts
packages/compiler-core/src/transforms/vOn.ts
import type { DirectiveTransform, DirectiveTransformResult } from '../transform' import { type DirectiveNode, ElementTypes, type ExpressionNode, NodeTypes, type SimpleExpressionNode, createCompoundExpression, createObjectProperty, createSimpleExpression, } from '../ast' import { camelize, toHandlerKey }...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vMemo.ts
packages/compiler-core/src/transforms/vMemo.ts
import type { NodeTransform } from '../transform' import { findDir } from '../utils' import { ElementTypes, type MemoExpression, NodeTypes, type PlainElementNode, convertToBlock, createCallExpression, createFunctionExpression, } from '../ast' import { WITH_MEMO } from '../runtimeHelpers' const seen = new...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vBind.ts
packages/compiler-core/src/transforms/vBind.ts
import type { DirectiveTransform } from '../transform' import { type ExpressionNode, NodeTypes, createObjectProperty, createSimpleExpression, } from '../ast' import { ErrorCodes, createCompilerError } from '../errors' import { camelize } from '@vue/shared' import { CAMELIZE } from '../runtimeHelpers' // v-bind...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/transformElement.ts
packages/compiler-core/src/transforms/transformElement.ts
import type { NodeTransform, TransformContext } from '../transform' import { type ArrayExpression, type CallExpression, type ComponentNode, ConstantTypes, type DirectiveArguments, type DirectiveNode, type ElementNode, ElementTypes, type ExpressionNode, type JSChildNode, NodeTypes, type ObjectExp...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/cacheStatic.ts
packages/compiler-core/src/transforms/cacheStatic.ts
import { type CacheExpression, type CallExpression, type ComponentNode, ConstantTypes, ElementTypes, type ExpressionNode, type JSChildNode, NodeTypes, type ParentNode, type PlainElementNode, type RootNode, type SimpleExpressionNode, type SlotFunctionExpression, type TemplateChildNode, type...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vIf.ts
packages/compiler-core/src/transforms/vIf.ts
import { type NodeTransform, type TransformContext, createStructuralDirectiveTransform, traverseNode, } from '../transform' import { type AttributeNode, type BlockCodegenNode, type CacheExpression, ConstantTypes, type DirectiveNode, type ElementNode, ElementTypes, type IfBranchNode, type IfCon...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vSlot.ts
packages/compiler-core/src/transforms/vSlot.ts
import { type CallExpression, type ConditionalExpression, type DirectiveNode, type ElementNode, ElementTypes, type ExpressionNode, type FunctionExpression, NodeTypes, type ObjectExpression, type Property, type SlotsExpression, type SourceLocation, type TemplateChildNode, createArrayExpressio...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/transformVBindShorthand.ts
packages/compiler-core/src/transforms/transformVBindShorthand.ts
import { camelize } from '@vue/shared' import { NodeTypes, type SimpleExpressionNode, createSimpleExpression, } from '../ast' import type { NodeTransform } from '../transform' import { ErrorCodes, createCompilerError } from '../errors' import { validFirstIdentCharRE } from '../utils' export const transformVBindS...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/transformSlotOutlet.ts
packages/compiler-core/src/transforms/transformSlotOutlet.ts
import type { NodeTransform, TransformContext } from '../transform' import { type CallExpression, type ExpressionNode, NodeTypes, type SlotOutletNode, createCallExpression, createFunctionExpression, createSimpleExpression, } from '../ast' import { isSlotOutlet, isStaticArgOf, isStaticExp } from '../utils'...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/src/transforms/vFor.ts
packages/compiler-core/src/transforms/vFor.ts
import { type NodeTransform, type TransformContext, createStructuralDirectiveTransform, } from '../transform' import { type BlockCodegenNode, ConstantTypes, type DirectiveNode, type ElementNode, type ExpressionNode, type ForCodegenNode, type ForIteratorExpression, type ForNode, type ForParseResu...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/testUtils.ts
packages/compiler-core/__tests__/testUtils.ts
import { type ElementNode, ElementTypes, Namespaces, NodeTypes, type Property, type SimpleExpressionNode, type VNodeCall, locStub, } from '../src' import { PatchFlagNames, type PatchFlags, type ShapeFlags, isArray, isString, } from '@vue/shared' const leadingBracketRE = /^\[/ const bracketsRE...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/scopeId.spec.ts
packages/compiler-core/__tests__/scopeId.spec.ts
import { baseCompile } from '../src/compile' /** * Ensure all slot functions are wrapped with _withCtx * which sets the currentRenderingInstance and currentScopeId when rendering * the slot. */ describe('scopeId compiler support', () => { test('should only work in module mode', () => { expect(() => { b...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/parse.spec.ts
packages/compiler-core/__tests__/parse.spec.ts
import type { ParserOptions } from '../src/options' import { ErrorCodes } from '../src/errors' import { type CommentNode, ConstantTypes, type DirectiveNode, type ElementNode, ElementTypes, type InterpolationNode, Namespaces, NodeTypes, type Position, type TextNode, } from '../src/ast' import { base...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/compile.spec.ts
packages/compiler-core/__tests__/compile.spec.ts
import { baseCompile as compile } from '../src' import { type RawSourceMap, SourceMapConsumer } from 'source-map-js' describe('compiler: integration tests', () => { const source = ` <div id="foo" :class="bar.baz"> {{ world.burn() }} <div v-if="ok">yes</div> <template v-else>no</template> <div v-for="(value, ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/codegen.spec.ts
packages/compiler-core/__tests__/codegen.spec.ts
import { ConstantTypes, type DirectiveArguments, type ForCodegenNode, type IfConditionalExpression, NodeTypes, type RootNode, type VNodeCall, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompoundExpression, create...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transform.spec.ts
packages/compiler-core/__tests__/transform.spec.ts
import { baseParse } from '../src/parser' import { type NodeTransform, transform } from '../src/transform' import { type DirectiveNode, type ElementNode, type ExpressionNode, NodeTypes, type VNodeCall, } from '../src/ast' import { ErrorCodes, createCompilerError } from '../src/errors' import { CREATE_COMMEN...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/utils.spec.ts
packages/compiler-core/__tests__/utils.spec.ts
import { babelParse, walkIdentifiers } from '@vue/compiler-sfc' import { type ExpressionNode, type TransformContext, isReferencedIdentifier, } from '../src' import { type Position, createSimpleExpression } from '../src/ast' import { advancePositionWithClone, isMemberExpressionBrowser, isMemberExpressionNode...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts
packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts
import { type ElementNode, type VNodeCall, noopDirectiveTransform, baseParse as parse, transform, } from '../../src' import { transformElement } from '../../src/transforms/transformElement' describe('compiler: noop directive transform', () => { test('should add no props to DOM', () => { const ast = par...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vSlot.spec.ts
packages/compiler-core/__tests__/transforms/vSlot.spec.ts
import { type CompilerOptions, type ComponentNode, type ElementNode, ErrorCodes, type ForNode, NodeTypes, type ObjectExpression, type RenderSlotCall, type SimpleExpressionNode, type SlotsExpression, type VNodeCall, generate, baseParse as parse, transform, } from '../../src' import { transfor...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vBind.spec.ts
packages/compiler-core/__tests__/transforms/vBind.spec.ts
import { type CallExpression, type CompilerOptions, type ElementNode, ErrorCodes, NodeTypes, type ObjectExpression, type VNodeCall, baseParse as parse, transform, } from '../../src' import { transformBind } from '../../src/transforms/vBind' import { transformElement } from '../../src/transforms/transf...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vIf.spec.ts
packages/compiler-core/__tests__/transforms/vIf.spec.ts
import { baseParse as parse } from '../../src/parser' import { transform } from '../../src/transform' import { transformIf } from '../../src/transforms/vIf' import { transformElement } from '../../src/transforms/transformElement' import { transformSlotOutlet } from '../../src/transforms/transformSlotOutlet' import { ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vMemo.spec.ts
packages/compiler-core/__tests__/transforms/vMemo.spec.ts
import { baseCompile } from '../../src' describe('compiler: v-memo transform', () => { function compile(content: string) { return baseCompile(`<div>${content}</div>`, { mode: 'module', prefixIdentifiers: true, }).code } test('on root element', () => { expect( baseCompile(`<div v-me...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vFor.spec.ts
packages/compiler-core/__tests__/transforms/vFor.spec.ts
import { baseParse as parse } from '../../src/parser' import { transform } from '../../src/transform' import { transformIf } from '../../src/transforms/vIf' import { transformFor } from '../../src/transforms/vFor' import { transformBind } from '../../src/transforms/vBind' import { transformElement } from '../../src/tra...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
import { BindingTypes, type CompilerOptions, ConstantTypes, type DirectiveNode, type ElementNode, type InterpolationNode, NodeTypes, baseCompile, baseParse as parse, transform, } from '../../src' import { transformIf } from '../../src/transforms/vIf' import { transformExpression } from '../../src/tr...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vModel.spec.ts
packages/compiler-core/__tests__/transforms/vModel.spec.ts
import { BindingTypes, type CompilerOptions, type ComponentNode, type ElementNode, type ForNode, NORMALIZE_PROPS, NodeTypes, type ObjectExpression, type PlainElementNode, type VNodeCall, generate, baseParse as parse, transform, } from '../../src' import { ErrorCodes } from '../../src/errors' i...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/transformText.spec.ts
packages/compiler-core/__tests__/transforms/transformText.spec.ts
import { type CompilerOptions, type ElementNode, type ForNode, NodeTypes, generate, isWhitespaceText, baseParse as parse, transform, } from '../../src' import { transformFor } from '../../src/transforms/vFor' import { transformText } from '../../src/transforms/transformText' import { transformExpression...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
import { type CompilerOptions, type ElementNode, ErrorCodes, NodeTypes, baseParse as parse, transform, } from '../../src' import { transformElement } from '../../src/transforms/transformElement' import { transformOn } from '../../src/transforms/vOn' import { transformBind } from '../../src/transforms/vBind'...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vOnce.spec.ts
packages/compiler-core/__tests__/transforms/vOnce.spec.ts
import { type CompilerOptions, NodeTypes, generate, getBaseTransformPreset, baseParse as parse, transform, } from '../../src' import { RENDER_SLOT, SET_BLOCK_TRACKING } from '../../src/runtimeHelpers' function transformWithOnce(template: string, options: CompilerOptions = {}) { const ast = parse(template...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/vOn.spec.ts
packages/compiler-core/__tests__/transforms/vOn.spec.ts
import { type CompilerOptions, type ElementNode, ErrorCodes, NodeTypes, type ObjectExpression, TO_HANDLER_KEY, type VNodeCall, helperNameMap, baseParse as parse, transform, } from '../../src' import { transformFor } from '../../src/transforms/vFor' import { transformOn } from '../../src/transforms/v...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/transformElement.spec.ts
packages/compiler-core/__tests__/transforms/transformElement.spec.ts
import { BindingTypes, type CompilerOptions, ErrorCodes, type NodeTransform, baseCompile, baseParse as parse, transform, transformExpression, } from '../../src' import { BASE_TRANSITION, CREATE_VNODE, GUARD_REACTIVE_PROPS, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMAL...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/compiler-core/__tests__/transforms/cacheStatic.spec.ts
packages/compiler-core/__tests__/transforms/cacheStatic.spec.ts
import { type CompilerOptions, ConstantTypes, type ElementNode, type ForNode, type IfNode, NodeTypes, type VNodeCall, generate, baseParse as parse, transform, } from '../../src' import { FRAGMENT, NORMALIZE_CLASS, RENDER_LIST, } from '../../src/runtimeHelpers' import { transformElement } from ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/toDisplayString.ts
packages/shared/src/toDisplayString.ts
// enums are compiled away via custom transform so no real dependency here import { ReactiveFlags } from '@vue/reactivity' import { isArray, isFunction, isMap, isObject, isPlainObject, isSet, isString, isSymbol, objectToString, } from './general' // can't use isRef here since @vue/shared has no deps ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/typeUtils.ts
packages/shared/src/typeUtils.ts
export type Prettify<T> = { [K in keyof T]: T[K] } & {} export type UnionToIntersection<U> = ( U extends any ? (k: U) => void : never ) extends (k: infer I) => void ? I : never // make keys required but keep undefined values export type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] } // If the type...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/cssVars.ts
packages/shared/src/cssVars.ts
/** * Normalize CSS var value created by `v-bind` in `<style>` block * See https://github.com/vuejs/core/pull/12461#issuecomment-2495804664 */ export function normalizeCssVarValue(value: unknown): string { if (value == null) { return 'initial' } if (typeof value === 'string') { return value === '' ? '...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/slotFlags.ts
packages/shared/src/slotFlags.ts
export enum SlotFlags { /** * Stable slots that only reference slot props or context state. The slot * can fully capture its own dependencies so when passed down the parent won't * need to force the child to update. */ STABLE = 1, /** * Slots that reference scope variables (v-for or an outer slot p...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/domAttrConfig.ts
packages/shared/src/domAttrConfig.ts
import { makeMap } from './makeMap' /** * On the client we only need to offer special cases for boolean attributes that * have different names from their corresponding dom properties: * - itemscope -> N/A * - allowfullscreen -> allowFullscreen * - formnovalidate -> formNoValidate * - ismap -> isMap * - nomodule...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/general.ts
packages/shared/src/general.ts
import { makeMap } from './makeMap' export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__ ? Object.freeze({}) : {} export const EMPTY_ARR: readonly never[] = __DEV__ ? Object.freeze([]) : [] export const NOOP = (): void => {} /** * Always return false. */ export const NO = () => false export const...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/escapeHtml.ts
packages/shared/src/escapeHtml.ts
const escapeRE = /["'&<>]/ export function escapeHtml(string: unknown): string { const str = '' + string const match = escapeRE.exec(str) if (!match) { return str } let html = '' let escaped: string let index: number let lastIndex = 0 for (index = match.index; index < str.length; index++) { ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/domTagConfig.ts
packages/shared/src/domTagConfig.ts
// These tag configs are shared between compiler-dom and runtime-dom, so they // must be extracted in shared to avoid creating a dependency between the two. import { makeMap } from './makeMap' // https://developer.mozilla.org/en-US/docs/Web/HTML/Element const HTML_TAGS = 'html,body,base,head,link,meta,style,title,ad...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/globalsAllowList.ts
packages/shared/src/globalsAllowList.ts
import { makeMap } from './makeMap' const GLOBALS_ALLOWED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' + 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' + 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol' export const isGloballyAll...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/codeframe.ts
packages/shared/src/codeframe.ts
const range: number = 2 export function generateCodeFrame( source: string, start = 0, end: number = source.length, ): string { // Ensure start and end are within the source length start = Math.max(0, Math.min(start, source.length)) end = Math.max(0, Math.min(end, source.length)) if (start > end) return ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/patchFlags.ts
packages/shared/src/patchFlags.ts
/** * Patch flags are optimization hints generated by the compiler. * when a block with dynamicChildren is encountered during diff, the algorithm * enters "optimized mode". In this mode, we know that the vdom is produced by * a render function generated by the compiler, so the algorithm only needs to * handle upda...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/looseEqual.ts
packages/shared/src/looseEqual.ts
import { isArray, isDate, isObject, isSymbol } from './general' function looseCompareArrays(a: any[], b: any[]) { if (a.length !== b.length) return false let equal = true for (let i = 0; equal && i < a.length; i++) { equal = looseEqual(a[i], b[i]) } return equal } export function looseEqual(a: any, b: a...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/index.ts
packages/shared/src/index.ts
export { makeMap } from './makeMap' export * from './general' export * from './patchFlags' export * from './shapeFlags' export * from './slotFlags' export * from './globalsAllowList' export * from './codeframe' export * from './normalizeProp' export * from './domTagConfig' export * from './domAttrConfig' export * from ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/normalizeProp.ts
packages/shared/src/normalizeProp.ts
import { hyphenate, isArray, isObject, isString } from './general' export type NormalizedStyle = Record<string, string | number> export function normalizeStyle( value: unknown, ): NormalizedStyle | string | undefined { if (isArray(value)) { const res: NormalizedStyle = {} for (let i = 0; i < value.length;...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/shapeFlags.ts
packages/shared/src/shapeFlags.ts
export enum ShapeFlags { ELEMENT = 1, FUNCTIONAL_COMPONENT = 1 << 1, STATEFUL_COMPONENT = 1 << 2, TEXT_CHILDREN = 1 << 3, ARRAY_CHILDREN = 1 << 4, SLOTS_CHILDREN = 1 << 5, TELEPORT = 1 << 6, SUSPENSE = 1 << 7, COMPONENT_SHOULD_KEEP_ALIVE = 1 << 8, COMPONENT_KEPT_ALIVE = 1 << 9, COMPONENT = ShapeFl...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/src/makeMap.ts
packages/shared/src/makeMap.ts
/** * Make a map and return a function for checking if a key * is in that map. * IMPORTANT: all calls of this function must be prefixed with * \/\*#\_\_PURE\_\_\*\/ * So that rollup can tree-shake them if necessary. */ /*@__NO_SIDE_EFFECTS__*/ export function makeMap(str: string): (key: string) => boolean { co...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/escapeHtml.spec.ts
packages/shared/__tests__/escapeHtml.spec.ts
import { escapeHtml, escapeHtmlComment } from '../src' describe('escapeHtml', () => { test('ssr: escapeHTML', () => { expect(escapeHtml(`foo`)).toBe(`foo`) expect(escapeHtml(true)).toBe(`true`) expect(escapeHtml(false)).toBe(`false`) expect(escapeHtml(`a && b`)).toBe(`a &amp;&amp; b`) expect(esca...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/normalizeProp.spec.ts
packages/shared/__tests__/normalizeProp.spec.ts
import { normalizeClass, normalizeProps, normalizeStyle, parseStringStyle, stringifyStyle, } from '../src' describe('normalizeClass', () => { test('handles undefined correctly', () => { expect(normalizeClass(undefined)).toEqual('') }) test('handles string correctly', () => { expect(normalizeCl...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/cssVars.spec.ts
packages/shared/__tests__/cssVars.spec.ts
import { normalizeCssVarValue } from '../src' describe('utils/cssVars', () => { test('should normalize css binding values correctly', () => { expect(normalizeCssVarValue(null)).toBe('initial') expect(normalizeCssVarValue(undefined)).toBe('initial') expect(normalizeCssVarValue('')).toBe(' ') expect(no...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/looseEqual.spec.ts
packages/shared/__tests__/looseEqual.spec.ts
/** * @vitest-environment jsdom */ import { looseEqual } from '../src' describe('utils/looseEqual', () => { test('compares booleans correctly', () => { expect(looseEqual(true, true)).toBe(true) expect(looseEqual(false, false)).toBe(true) expect(looseEqual(true, false)).toBe(false) expect(looseEqual...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/codeframe.spec.ts
packages/shared/__tests__/codeframe.spec.ts
import { generateCodeFrame } from '../src/codeframe' describe('compiler: codeframe', () => { const source = ` <div> <template key="one"></template> <ul> <li v-for="foobar">hi</li> </ul> <template key="two"></template> </div> `.trim() test('line near top', () => { const keyStart = source.indexO...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/shared/__tests__/toDisplayString.spec.ts
packages/shared/__tests__/toDisplayString.spec.ts
/** * @vitest-environment jsdom */ import { computed, ref } from '@vue/reactivity' import { toDisplayString } from '../src' describe('toDisplayString', () => { test('nullish values', () => { expect(toDisplayString(null)).toBe('') expect(toDisplayString(undefined)).toBe('') }) test('primitive values', ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/effect.bench.ts
packages/reactivity/__benchmarks__/effect.bench.ts
import { bench, describe } from 'vitest' import type { Ref } from '../src' import { effect, ref } from '../dist/reactivity.esm-browser.prod' describe('effect', () => { { let i = 0 const n = ref(0) effect(() => n.value) bench('single ref invoke', () => { n.value = i++ }) } function benc...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/ref.bench.ts
packages/reactivity/__benchmarks__/ref.bench.ts
import { bench, describe } from 'vitest' import { ref } from '../dist/reactivity.esm-browser.prod' describe('ref', () => { bench('create ref', () => { ref(100) }) { let i = 0 const v = ref(100) bench('write ref', () => { v.value = i++ }) } { const v = ref(100) bench('read ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/reactiveArray.bench.ts
packages/reactivity/__benchmarks__/reactiveArray.bench.ts
import { bench } from 'vitest' import { effect, reactive, shallowReadArray, } from '../dist/reactivity.esm-browser.prod' for (let amount = 1e1; amount < 1e4; amount *= 10) { { const rawArray: number[] = [] for (let i = 0, n = amount; i < n; i++) { rawArray.push(i) } const arr = reactive(r...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/computed.bench.ts
packages/reactivity/__benchmarks__/computed.bench.ts
import { bench, describe } from 'vitest' import type { ComputedRef, Ref } from '../src' import { computed, effect, ref } from '../dist/reactivity.esm-browser.prod' declare module '../dist/reactivity.esm-browser.prod' { function computed(...args: any[]): any } describe('computed', () => { bench('create computed', ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/reactiveMap.bench.ts
packages/reactivity/__benchmarks__/reactiveMap.bench.ts
import { bench } from 'vitest' import type { ComputedRef } from '../src' import { computed, reactive } from '../dist/reactivity.esm-browser.prod' function createMap(obj: Record<string, any>) { const map = new Map() for (const key in obj) { if (obj.hasOwnProperty(key)) { map.set(key, obj[key]) } } ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__benchmarks__/reactiveObject.bench.ts
packages/reactivity/__benchmarks__/reactiveObject.bench.ts
import { bench } from 'vitest' import { reactive } from '../dist/reactivity.esm-browser.prod' bench('create reactive obj', () => { reactive({ a: 1 }) }) { const r = reactive({ a: 1 }) bench('read reactive obj property', () => { r.a }) } { let i = 0 const r = reactive({ a: 1 }) bench('write reactive...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/reactive.ts
packages/reactivity/src/reactive.ts
import { def, hasOwn, isObject, toRawType } from '@vue/shared' import { mutableHandlers, readonlyHandlers, shallowReactiveHandlers, shallowReadonlyHandlers, } from './baseHandlers' import { mutableCollectionHandlers, readonlyCollectionHandlers, shallowCollectionHandlers, shallowReadonlyCollectionHandler...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/collectionHandlers.ts
packages/reactivity/src/collectionHandlers.ts
import { type Target, isReadonly, isShallow, toRaw, toReactive, toReadonly, } from './reactive' import { ITERATE_KEY, MAP_KEY_ITERATE_KEY, track, trigger } from './dep' import { ReactiveFlags, TrackOpTypes, TriggerOpTypes } from './constants' import { capitalize, extend, hasChanged, hasOwn, isMap,...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/effect.ts
packages/reactivity/src/effect.ts
import { extend, hasChanged } from '@vue/shared' import type { ComputedRefImpl } from './computed' import type { TrackOpTypes, TriggerOpTypes } from './constants' import { type Link, globalVersion } from './dep' import { activeEffectScope } from './effectScope' import { warn } from './warning' export type EffectSchedu...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/watch.ts
packages/reactivity/src/watch.ts
import { EMPTY_OBJ, NOOP, hasChanged, isArray, isFunction, isMap, isObject, isPlainObject, isSet, remove, } from '@vue/shared' import { warn } from './warning' import type { ComputedRef } from './computed' import { ReactiveFlags } from './constants' import { type DebuggerOptions, EffectFlags, ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/ref.ts
packages/reactivity/src/ref.ts
import { type IfAny, hasChanged, isArray, isFunction, isIntegerKey, isObject, } from '@vue/shared' import { Dep, getDepFromReactive } from './dep' import { type Builtin, type ShallowReactiveMarker, type Target, isProxy, isReactive, isReadonly, isShallow, toRaw, toReactive, } from './reacti...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/constants.ts
packages/reactivity/src/constants.ts
// using literal strings instead of numbers so that it's easier to inspect // debugger events export enum TrackOpTypes { GET = 'get', HAS = 'has', ITERATE = 'iterate', } export enum TriggerOpTypes { SET = 'set', ADD = 'add', DELETE = 'delete', CLEAR = 'clear', } export enum ReactiveFlags { SKIP = '__...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/effectScope.ts
packages/reactivity/src/effectScope.ts
import type { ReactiveEffect } from './effect' import { warn } from './warning' export let activeEffectScope: EffectScope | undefined export class EffectScope { /** * @internal */ private _active = true /** * @internal track `on` calls, allow `on` call multiple times */ private _on = 0 /** * ...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/baseHandlers.ts
packages/reactivity/src/baseHandlers.ts
import { type Target, isReadonly, isShallow, reactive, reactiveMap, readonly, readonlyMap, shallowReactiveMap, shallowReadonlyMap, toRaw, } from './reactive' import { arrayInstrumentations } from './arrayInstrumentations' import { ReactiveFlags, TrackOpTypes, TriggerOpTypes } from './constants' impo...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/dep.ts
packages/reactivity/src/dep.ts
import { extend, isArray, isIntegerKey, isMap, isSymbol } from '@vue/shared' import type { ComputedRefImpl } from './computed' import { type TrackOpTypes, TriggerOpTypes } from './constants' import { type DebuggerEventExtraInfo, EffectFlags, type Subscriber, activeSub, endBatch, shouldTrack, startBatch, }...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/arrayInstrumentations.ts
packages/reactivity/src/arrayInstrumentations.ts
import { TrackOpTypes } from './constants' import { endBatch, pauseTracking, resetTracking, startBatch } from './effect' import { isProxy, isReactive, isReadonly, isShallow, toRaw, toReactive, toReadonly, } from './reactive' import { ARRAY_ITERATE_KEY, track } from './dep' import { isArray } from '@vue/sh...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/index.ts
packages/reactivity/src/index.ts
export { ref, shallowRef, isRef, toRef, toValue, toRefs, unref, proxyRefs, customRef, triggerRef, type Ref, type MaybeRef, type MaybeRefOrGetter, type ToRef, type ToRefs, type UnwrapRef, type ShallowRef, type ShallowUnwrapRef, type RefUnwrapBailTypes, type CustomRefFactory, } fro...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/computed.ts
packages/reactivity/src/computed.ts
import { isFunction } from '@vue/shared' import { type DebuggerEvent, type DebuggerOptions, EffectFlags, type Subscriber, activeSub, batch, refreshComputed, } from './effect' import type { Ref } from './ref' import { warn } from './warning' import { Dep, type Link, globalVersion } from './dep' import { Re...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/src/warning.ts
packages/reactivity/src/warning.ts
export function warn(msg: string, ...args: any[]): void { console.warn(`[Vue warn] ${msg}`, ...args) }
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
false
vuejs/core
https://github.com/vuejs/core/blob/aac7e1898907445c8f89b22047a9bfcf0a6e91b8/packages/reactivity/__tests__/effect.spec.ts
packages/reactivity/__tests__/effect.spec.ts
import { type DebuggerEvent, type ReactiveEffectRunner, TrackOpTypes, TriggerOpTypes, effect, markRaw, reactive, readonly, shallowReactive, stop, toRaw, } from '../src/index' import { type Dep, ITERATE_KEY, getDepFromReactive } from '../src/dep' import { computed, h, nextTick, nodeOps, r...
typescript
MIT
aac7e1898907445c8f89b22047a9bfcf0a6e91b8
2026-01-04T15:31:41.625443Z
true