diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000000..4d4f41e301f
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,4 @@
+node_modules
+dist
+temp
+coverage
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index ec05a113113..65653f40da2 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,89 +1,130 @@
+const { builtinModules } = require('node:module')
const DOMGlobals = ['window', 'document']
const NodeGlobals = ['module', 'require']
+const banConstEnum = {
+ selector: 'TSEnumDeclaration[const=true]',
+ message:
+ 'Please use non-const enums. This project automatically inlines enums.',
+}
+
+/**
+ * @type {import('eslint-define-config').ESLintConfig}
+ */
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
- sourceType: 'module'
+ sourceType: 'module',
},
- plugins: ['jest'],
+ plugins: ['jest', 'import', '@typescript-eslint'],
rules: {
'no-debugger': 'error',
- 'no-unused-vars': [
- 'error',
- // we are only using this rule to check for unused arguments since TS
- // catches unused variables but not args.
- { varsIgnorePattern: '.*', args: 'none' }
- ],
+ 'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
// most of the codebase are expected to be env agnostic
'no-restricted-globals': ['error', ...DOMGlobals, ...NodeGlobals],
'no-restricted-syntax': [
'error',
+ banConstEnum,
// since we target ES2015 for baseline support, we need to forbid object
// rest spread usage in destructure as it compiles into a verbose helper.
'ObjectPattern > RestElement',
// tsc compiles assignment spread into Object.assign() calls, but esbuild
// still generates verbose helpers, so spread assignment is also prohiboted
'ObjectExpression > SpreadElement',
- 'AwaitExpression'
- ]
+ 'AwaitExpression',
+ ],
+ 'sort-imports': ['error', { ignoreDeclarationSort: true }],
+
+ 'import/no-nodejs-modules': [
+ 'error',
+ { allow: builtinModules.map(mod => `node:${mod}`) },
+ ],
+ // This rule enforces the preference for using '@ts-expect-error' comments in TypeScript
+ // code to indicate intentional type errors, improving code clarity and maintainability.
+ '@typescript-eslint/prefer-ts-expect-error': 'error',
+ // Enforce the use of 'import type' for importing types
+ '@typescript-eslint/consistent-type-imports': [
+ 'error',
+ {
+ fixStyle: 'inline-type-imports',
+ disallowTypeAnnotations: false,
+ },
+ ],
+ // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers
+ '@typescript-eslint/no-import-type-side-effects': 'error',
},
overrides: [
// tests, no restrictions (runs in Node / jest with jsdom)
{
files: ['**/__tests__/**', 'packages/dts-test/**'],
rules: {
+ 'no-console': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'jest/no-disabled-tests': 'error',
- 'jest/no-focused-tests': 'error'
- }
+ 'jest/no-focused-tests': 'error',
+ },
},
// shared, may be used in any env
{
- files: ['packages/shared/**'],
+ files: ['packages/shared/**', '.eslintrc.cjs'],
rules: {
- 'no-restricted-globals': 'off'
- }
+ 'no-restricted-globals': 'off',
+ },
},
// Packages targeting DOM
{
files: ['packages/{vue,vue-compat,runtime-dom}/**'],
rules: {
- 'no-restricted-globals': ['error', ...NodeGlobals]
- }
+ 'no-restricted-globals': ['error', ...NodeGlobals],
+ },
},
// Packages targeting Node
{
- files: [
- 'packages/{compiler-sfc,compiler-ssr,server-renderer,reactivity-transform}/**'
- ],
+ files: ['packages/{compiler-sfc,compiler-ssr,server-renderer}/**'],
rules: {
'no-restricted-globals': ['error', ...DOMGlobals],
- 'no-restricted-syntax': 'off'
- }
+ 'no-restricted-syntax': ['error', banConstEnum],
+ },
},
// Private package, browser only + no syntax restrictions
{
files: ['packages/template-explorer/**', 'packages/sfc-playground/**'],
rules: {
'no-restricted-globals': ['error', ...NodeGlobals],
- 'no-restricted-syntax': 'off'
- }
+ 'no-restricted-syntax': ['error', banConstEnum],
+ 'no-console': 'off',
+ },
+ },
+ // JavaScript files
+ {
+ files: ['*.js', '*.cjs'],
+ rules: {
+ // We only do `no-unused-vars` checks for js files, TS files are checked by TypeScript itself.
+ 'no-unused-vars': ['error', { vars: 'all', args: 'none' }],
+ },
},
// Node scripts
{
files: [
'scripts/**',
- '*.{js,ts}',
- 'packages/**/index.js',
- 'packages/size-check/**'
+ './*.{js,ts}',
+ 'packages/*/*.js',
+ 'packages/vue/*/*.js',
],
rules: {
'no-restricted-globals': 'off',
- 'no-restricted-syntax': 'off'
- }
- }
- ]
+ 'no-restricted-syntax': ['error', banConstEnum],
+ 'no-console': 'off',
+ },
+ },
+ // Import nodejs modules in compiler-sfc
+ {
+ files: ['packages/compiler-sfc/src/**'],
+ rules: {
+ 'import/no-nodejs-modules': ['error', { allow: builtinModules }],
+ },
+ },
+ ],
}
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 00000000000..d06b03a3f89
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,2 @@
+# update prettier & eslint config (#9162)
+bfe6b459d3a0ce6168611ee1ac7e6e789709df9d
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index af3782c8422..02f99c6bfbb 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,8 @@
blank_issues_enabled: false
contact_links:
+ - name: Feature Request
+ url: https://github.com/vuejs/rfcs/discussions
+ about: Suggest new features for consideration
- name: Discord Chat
url: https://chat.vuejs.org
about: Ask questions and discuss with other Vue users in real time.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
deleted file mode 100644
index 6861fc26d86..00000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: "\U0001F680 New feature proposal"
-description: Suggest an idea for this project
-labels: [":sparkles: feature request"]
-body:
- - type: markdown
- attributes:
- value: |
- **Before You Start...**
-
- This form is only for submitting feature requests. If you have a usage question
- or are unsure if this is really a bug, make sure to:
-
- - Read the [docs](https://vuejs.org/)
- - Ask on [Discord Chat](https://chat.vuejs.org/)
- - Ask on [GitHub Discussions](https://github.com/vuejs/core/discussions)
- - Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/ask?tags=vue.js)
-
- Also try to search for your issue - another user may have already requested something similar!
-
- - type: textarea
- id: problem-description
- attributes:
- label: What problem does this feature solve?
- description: |
- Explain your use case, context, and rationale behind this feature request. More importantly, what is the **end user experience** you are trying to build that led to the need for this feature?
-
- An important design goal of Vue is keeping the API surface small and straightforward. In general, we only consider adding new features that solve a problem that cannot be easily dealt with using existing APIs (i.e. not just an alternative way of doing things that can already be done). The problem should also be common enough to justify the addition.
- placeholder: Problem description
- validations:
- required: true
- - type: textarea
- id: proposed-API
- attributes:
- label: What does the proposed API look like?
- description: |
- Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format your code blocks.
- placeholder: Assumed API
- validations:
- required: true
diff --git a/.github/contributing.md b/.github/contributing.md
index c535aa7f4e6..da1bd5ec453 100644
--- a/.github/contributing.md
+++ b/.github/contributing.md
@@ -17,7 +17,11 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
## Pull Request Guidelines
-- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
+- Vue core has two primary work branches: `main` and `minor`.
+
+ - If your pull request is a feature that adds new API surface, it should be submitted against the `minor` branch.
+
+ - Otherwise, it should be submitted against the `main` branch.
- [Make sure to tick the "Allow edits from maintainers" box](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). This allows us to directly make minor edits / refactors and saves a lot of time.
@@ -57,9 +61,9 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
## Development Setup
-You will need [Node.js](https://nodejs.org) **version 16+**, and [PNPM](https://pnpm.io) **version 7+**.
+You will need [Node.js](https://nodejs.org) **version 18.12+**, and [PNPM](https://pnpm.io) **version 8+**.
-We also recommend installing [ni](https://github.com/antfu/ni) to help switching between repos using different package managers. `ni` also provides the handy `nr` command which running npm scripts easier.
+We also recommend installing [@antfu/ni](https://github.com/antfu/ni) to help switching between repos using different package managers. `ni` also provides the handy `nr` command which running npm scripts easier.
After cloning the repo, run:
@@ -82,11 +86,11 @@ The project uses [simple-git-hooks](https://github.com/toplenboren/simple-git-ho
- Type check the entire project
- Automatically format changed files using Prettier
-- Verify commit message format (logic in `scripts/verifyCommit.js`)
+- Verify commit message format (logic in `scripts/verify-commit.js`)
## Scripts
-**The examples below will be using the `nr` command from the [ni](https://github.com/antfu/ni) package.** You can also use plain `npm run`, but you will need to pass all additional arguments after the command after an extra `--`. For example, `nr build runtime --all` is equivalent to `npm run build -- runtime --all`.
+**The examples below will be using the `nr` command from the [@antfu/ni](https://github.com/antfu/ni) package.** You can also use plain `npm run`, but you will need to pass all additional arguments after the command after an extra `--`. For example, `nr build runtime --all` is equivalent to `npm run build -- runtime --all`.
The `run-s` and `run-p` commands found in some scripts are from [npm-run-all](https://github.com/mysticatea/npm-run-all) for orchestrating multiple scripts. `run-s` means "run in sequence" while `run-p` means "run in parallel".
@@ -181,11 +185,11 @@ Shortcut for starting the SFC Playground in local dev mode. This provides the fa
### `nr dev-esm`
-Builds and watches `vue/dist/vue-runtime.esm-bundler.js` with all deps inlined using esbuild. This is useful when debugging the ESM build in a reproductions that require real build setups: link `packages/vue` globally, then link it into the project being debugged.
+Builds and watches `vue/dist/vue-runtime.esm-bundler.js` with all deps inlined using esbuild. This is useful when debugging the ESM build in a reproduction that requires real build setups: link `packages/vue` globally, then link it into the project being debugged.
### `nr dev-compiler`
-The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:5000`. This is useful when working on pure compiler issues.
+The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:3000`. This is useful when working on pure compiler issues.
### `nr test`
@@ -248,8 +252,6 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
- `template-explorer`: A development tool for debugging compiler output, continuously deployed at https://template-explorer.vuejs.org/. To run it locally, run [`nr dev-compiler`](#nr-dev-compiler).
- - `size-check`: Used for checking built bundle sizes on CI.
-
### Importing Packages
The packages can import each other directly using their package names. Note that when importing a package, the name listed in its `package.json` should be used. Most of the time the `@vue/` prefix is needed:
@@ -261,7 +263,7 @@ import { h } from '@vue/runtime-core'
This is made possible via several configurations:
- For TypeScript, `compilerOptions.paths` in `tsconfig.json`
-- Vitest and Rollup share the sae set of aliases from `scripts/aliases.js`
+- Vitest and Rollup share the same set of aliases from `scripts/aliases.js`
- For plain Node.js, they are linked using [PNPM Workspaces](https://pnpm.io/workspaces).
### Package Dependencies
@@ -330,4 +332,4 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
Thank you to all the people who have already contributed to Vue.js!
-
+
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 206deefc560..00000000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-version: 2
-updates:
-- package-ecosystem: npm
- directory: "/"
- schedule:
- interval: monthly
- open-pull-requests-limit: 10
- versioning-strategy: lockfile-only
- ignore:
- - dependency-name: "@types/node"
- versions:
- - 14.14.24
- - 14.14.37
- - dependency-name: "@babel/parser"
- versions:
- - 7.12.11
- - 7.12.13
- - 7.12.14
- - 7.12.15
- - 7.12.16
- - 7.12.17
- - 7.13.0
- - 7.13.10
- - 7.13.11
- - 7.13.13
- - 7.13.4
- - 7.13.9
- - dependency-name: eslint
- versions:
- - 7.23.0
- - dependency-name: postcss
- versions:
- - 8.2.4
- - 8.2.5
- - 8.2.7
- - 8.2.8
- - dependency-name: typescript
- versions:
- - 4.2.2
- - dependency-name: "@babel/types"
- versions:
- - 7.12.12
- - 7.12.13
- - 7.12.17
- - 7.13.0
- - dependency-name: pug-code-gen
- versions:
- - 2.0.3
- - dependency-name: estree-walker
- versions:
- - 2.0.2
- - dependency-name: "@typescript-eslint/parser"
- versions:
- - 4.14.2
- - 4.15.0
- - dependency-name: "@microsoft/api-extractor"
- versions:
- - 7.13.1
- - dependency-name: rollup
- versions:
- - 2.38.5
- - dependency-name: node-notifier
- versions:
- - 8.0.1
-- package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: monthly
- open-pull-requests-limit: 10
- versioning-strategy: lockfile-only
diff --git a/.github/git-branch-workflow.excalidraw b/.github/git-branch-workflow.excalidraw
new file mode 100644
index 00000000000..dd9127938da
--- /dev/null
+++ b/.github/git-branch-workflow.excalidraw
@@ -0,0 +1,1746 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://excalidraw.com",
+ "elements": [
+ {
+ "type": "arrow",
+ "version": 799,
+ "versionNonce": 529220601,
+ "isDeleted": false,
+ "id": "Gao2krnDddLMCj468JSWD",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 860.0129225738813,
+ "y": 663.9911710635109,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 133.75296854079784,
+ "height": 149.58016791936518,
+ "seed": 1415631543,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": {
+ "elementId": "hDC6an14QljktaZCUhcPF",
+ "focus": 0.09950793234484598,
+ "gap": 1.2432497743127229
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 25.209039386719837,
+ 85.96948921803892
+ ],
+ [
+ 133.75296854079784,
+ 149.58016791936518
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 563,
+ "versionNonce": 290881303,
+ "isDeleted": false,
+ "id": "N3wyyEU7TQ8BsOQgxCmlR",
+ "fillStyle": "hachure",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 292.88008929085873,
+ "y": 660.7027503334302,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 936.9972134376155,
+ "height": 1.3184243543457796,
+ "seed": 534235417,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 936.9972134376155,
+ -1.3184243543457796
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 302,
+ "versionNonce": 883286489,
+ "isDeleted": false,
+ "id": "nRDWQs5nQa37yzCWTBiXC",
+ "fillStyle": "hachure",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 293.1231624544633,
+ "y": 820.6017661012943,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 790.7091601354882,
+ "height": 0.35284814071621895,
+ "seed": 515907671,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": {
+ "elementId": "ggogfJT7E_bbfEog7Hjnp",
+ "focus": -0.14000162237652433,
+ "gap": 1
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 790.7091601354882,
+ -0.35284814071621895
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 36,
+ "versionNonce": 981763127,
+ "isDeleted": false,
+ "id": "ZPdMAnEUq5Jgj1W07Zqiw",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 292.0450153578305,
+ "y": 619.3959946602608,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#b2f2bb",
+ "width": 46.875,
+ "height": 24,
+ "seed": 1311694519,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 3,
+ "text": "main",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "main",
+ "lineHeight": 1.2,
+ "baseline": 20
+ },
+ {
+ "type": "text",
+ "version": 94,
+ "versionNonce": 18759353,
+ "isDeleted": false,
+ "id": "g9IkEIfu4vA8Qkwtw01Hi",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 290.88990199912035,
+ "y": 779.1760596323645,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#b2f2bb",
+ "width": 58.59375,
+ "height": 24,
+ "seed": 329886135,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 3,
+ "text": "minor",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "minor",
+ "lineHeight": 1.2,
+ "baseline": 20
+ },
+ {
+ "type": "ellipse",
+ "version": 50,
+ "versionNonce": 1442112855,
+ "isDeleted": false,
+ "id": "RrdEQ7hwgGGDPhzDnuZj1",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 361.55609907891005,
+ "y": 649.8742329483416,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 2077639991,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 79,
+ "versionNonce": 1547173785,
+ "isDeleted": false,
+ "id": "Zmp49FKWxGSzKnVKomjQc",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 427.3015090315691,
+ "y": 650.256485100784,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 372652121,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 76,
+ "versionNonce": 586949239,
+ "isDeleted": false,
+ "id": "UOl9nLBksM7RPdH9mzjJa",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 490.9435520120701,
+ "y": 651.2601420343765,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 508667545,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 120,
+ "versionNonce": 874947705,
+ "isDeleted": false,
+ "id": "oMC55V0VO_hOXoZ1se8Kl",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 555.4481126698772,
+ "y": 650.7975189165487,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1914963513,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 66,
+ "versionNonce": 39762839,
+ "isDeleted": false,
+ "id": "DZY5DC5uVP7-U5c3ngIZ4",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 622.5167031502219,
+ "y": 649.3743647489936,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 165914713,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 107,
+ "versionNonce": 1689103705,
+ "isDeleted": false,
+ "id": "Vsw6oIiTM3fQypkiCic3f",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 690.330195260967,
+ "y": 650.6681412649529,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 280044345,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "lwYvAs-7FTjcwxKjcx0KV",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 148,
+ "versionNonce": 1986194201,
+ "isDeleted": false,
+ "id": "D14w9erv_2l53mINe2nSt",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 361.004283792179,
+ "y": 810.2809579853473,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1203257975,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 179,
+ "versionNonce": 1172811511,
+ "isDeleted": false,
+ "id": "6WO8xOpG0rf673b_bT0m7",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 426.74969374483805,
+ "y": 810.6632101377896,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 2056706967,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "mE8Mu0qKfFaWPCC5vmF_f",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 173,
+ "versionNonce": 820518905,
+ "isDeleted": false,
+ "id": "VB9U8oH-78hf530hIb_mG",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 490.391736725339,
+ "y": 811.6668670713822,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1149587639,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 218,
+ "versionNonce": 1227143191,
+ "isDeleted": false,
+ "id": "Bxv1hcS0VmxUwI0JLFH97",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 554.8962973831461,
+ "y": 811.2042439535543,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1864901079,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "M14Q0Uo1DBy2Ss2SOFSgW",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 167,
+ "versionNonce": 1387509977,
+ "isDeleted": false,
+ "id": "4v23gkfhy-hzk18YdkfLz",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 621.9648878634908,
+ "y": 809.7810897859994,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 462671607,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "vEF1cIIYYWKm84KLKqEz3",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 200,
+ "versionNonce": 774085943,
+ "isDeleted": false,
+ "id": "AtEf7o4WZQn4Zxq8EN5fH",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 689.7783799742359,
+ "y": 811.0748663019584,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1414322199,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "3heKY3vfe3-6ni4dX7Uqo",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 199,
+ "versionNonce": 1834563001,
+ "isDeleted": false,
+ "id": "ugDby5sBv4NKdNt8eC1sg",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 762.6179978227377,
+ "y": 810.2986003923828,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1598537015,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 211,
+ "versionNonce": 407428695,
+ "isDeleted": false,
+ "id": "Fwe4F2sB_0jptOZGYsusj",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 837.1081608628116,
+ "y": 810.859236882632,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1340669527,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "M14Q0Uo1DBy2Ss2SOFSgW",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "arrow",
+ "version": 57,
+ "versionNonce": 335287961,
+ "isDeleted": false,
+ "id": "mE8Mu0qKfFaWPCC5vmF_f",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 437.60867586595543,
+ "y": 830.4227236701945,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 0.5232394659406623,
+ "height": 33.25787987764363,
+ "seed": 482155929,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": {
+ "elementId": "6WO8xOpG0rf673b_bT0m7",
+ "focus": -0.1727591064041787,
+ "gap": 1.046152088903881
+ },
+ "endBinding": {
+ "elementId": "JALHBtowuh3_a86loej2x",
+ "focus": 0.015156451076917701,
+ "gap": 15.586906139714472
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -0.5232394659406623,
+ 33.25787987764363
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 59,
+ "versionNonce": 1248394103,
+ "isDeleted": false,
+ "id": "AI-_jSAuzesxTqwRvpk0s",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 501.2878833373983,
+ "y": 652.3088851192829,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#ffc9c9",
+ "width": 0,
+ "height": 40.40111211199792,
+ "seed": 1052632343,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ -40.40111211199792
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 261,
+ "versionNonce": 693099385,
+ "isDeleted": false,
+ "id": "lwYvAs-7FTjcwxKjcx0KV",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 786.7392304423553,
+ "y": 649.6016935672433,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#ffc9c9",
+ "width": 0,
+ "height": 40.40111211199792,
+ "seed": 1233043511,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": {
+ "elementId": "s0PKxsWTJSDbQeEl_WI-C",
+ "focus": 0.016372633695398757,
+ "gap": 1
+ },
+ "endBinding": {
+ "elementId": "9ia1Uwc5X0fRw5iaahmcT",
+ "focus": 0.025318405829282714,
+ "gap": 14.862364635333904
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ -40.40111211199792
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 121,
+ "versionNonce": 952661143,
+ "isDeleted": false,
+ "id": "qWW8uxDIcV3Bkj28uvRLr",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 454.32425448306674,
+ "y": 537.8854189061962,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 93.75,
+ "height": 57.599999999999994,
+ "seed": 809847769,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "patch\nrelease\ne.g. 3.3.8",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "patch\nrelease\ne.g. 3.3.8",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "text",
+ "version": 257,
+ "versionNonce": 1838679129,
+ "isDeleted": false,
+ "id": "9ia1Uwc5X0fRw5iaahmcT",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 741.0510307156029,
+ "y": 536.7382168199114,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 93.75,
+ "height": 57.599999999999994,
+ "seed": 213765431,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [
+ {
+ "id": "lwYvAs-7FTjcwxKjcx0KV",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "patch\nrelease\ne.g. 3.3.9",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "patch\nrelease\ne.g. 3.3.9",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "text",
+ "version": 222,
+ "versionNonce": 1528547767,
+ "isDeleted": false,
+ "id": "JALHBtowuh3_a86loej2x",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 350.7264132088442,
+ "y": 879.2675096875524,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 168.75,
+ "height": 57.599999999999994,
+ "seed": 41180921,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [
+ {
+ "id": "mE8Mu0qKfFaWPCC5vmF_f",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "pre minor\nrelease\ne.g. 3.4.0-alpha.1",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "pre minor\nrelease\ne.g. 3.4.0-alpha.1",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "arrow",
+ "version": 345,
+ "versionNonce": 1286082873,
+ "isDeleted": false,
+ "id": "3heKY3vfe3-6ni4dX7Uqo",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 699.5281288163526,
+ "y": 831.0290882554708,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 0.5502191262773977,
+ "height": 33.25154356841597,
+ "seed": 627698359,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "startBinding": {
+ "elementId": "AtEf7o4WZQn4Zxq8EN5fH",
+ "focus": -0.05612657009295625,
+ "gap": 1.1451322685712295
+ },
+ "endBinding": {
+ "elementId": "9t6qH-tAxVUexkHHi2pd2",
+ "focus": 0.015156451076917755,
+ "gap": 15.586906139714358
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -0.5502191262773977,
+ 33.25154356841597
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 365,
+ "versionNonce": 1049066199,
+ "isDeleted": false,
+ "id": "9t6qH-tAxVUexkHHi2pd2",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 617.3409291322284,
+ "y": 879.8675379636011,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 159.375,
+ "height": 57.599999999999994,
+ "seed": 1013545943,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [
+ {
+ "id": "3heKY3vfe3-6ni4dX7Uqo",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613071,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "pre minor\nrelease\ne.g. 3.4.0-beta.1",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "pre minor\nrelease\ne.g. 3.4.0-beta.1",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "arrow",
+ "version": 788,
+ "versionNonce": 1810072089,
+ "isDeleted": false,
+ "id": "vEF1cIIYYWKm84KLKqEz3",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 630.3597332113623,
+ "y": 667.2735668205443,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 2.258228100583324,
+ "height": 140.75112333166828,
+ "seed": 2091697367,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": {
+ "elementId": "4v23gkfhy-hzk18YdkfLz",
+ "focus": 0.13930391883256707,
+ "gap": 1.8256906627890626
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1.8426514015177418,
+ 69.09942755691065
+ ],
+ [
+ 2.258228100583324,
+ 140.75112333166828
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 687,
+ "versionNonce": 2017318649,
+ "isDeleted": false,
+ "id": "M14Q0Uo1DBy2Ss2SOFSgW",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 370.5976915356099,
+ "y": 667.5155013947814,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 1.5329291446666957,
+ "height": 145.39303664953377,
+ "seed": 361678233,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -0.34892760581925586,
+ 83.56228079137543
+ ],
+ [
+ 1.1840015388474399,
+ 145.39303664953377
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 537,
+ "versionNonce": 342487319,
+ "isDeleted": false,
+ "id": "CHAOOJMz7tNaG1VsG_uzT",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 384.81046417498214,
+ "y": 725.4677076298137,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 131.25,
+ "height": 57.599999999999994,
+ "seed": 1656007289,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "merge main\ninto minor\nbefore release",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "merge main\ninto minor\nbefore release",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "ellipse",
+ "version": 202,
+ "versionNonce": 876253145,
+ "isDeleted": false,
+ "id": "hDC6an14QljktaZCUhcPF",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 993.0386151813434,
+ "y": 810.335845473903,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1433430105,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "Gao2krnDddLMCj468JSWD",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "arrow",
+ "version": 1525,
+ "versionNonce": 777631287,
+ "isDeleted": false,
+ "id": "ces8IwHCpQlTnELpjFDIn",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1092.5386800881793,
+ "y": 827.5114796878765,
+ "strokeColor": "#f08c00",
+ "backgroundColor": "#ffc9c9",
+ "width": 0.3315362017829102,
+ "height": 49.45191086419197,
+ "seed": 225867737,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": {
+ "elementId": "8rWUxp-jRNGrGRmhHHfm4",
+ "focus": -0.2047594653982401,
+ "gap": 10.392197401393389
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -0.3315362017829102,
+ 49.45191086419197
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 894,
+ "versionNonce": 1173171385,
+ "isDeleted": false,
+ "id": "8rWUxp-jRNGrGRmhHHfm4",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1047.251646167428,
+ "y": 887.3555879534618,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 112.5,
+ "height": 57.599999999999994,
+ "seed": 1600918713,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [
+ {
+ "id": "ces8IwHCpQlTnELpjFDIn",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "stable minor\nrelease\ne.g. 3.4.0",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "stable minor\nrelease\ne.g. 3.4.0",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "ellipse",
+ "version": 201,
+ "versionNonce": 78435447,
+ "isDeleted": false,
+ "id": "3RHuRn_evSK0YUe02B4MY",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 909.9742423218671,
+ "y": 810.4142561718397,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 1199705047,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 371,
+ "versionNonce": 2093872087,
+ "isDeleted": false,
+ "id": "9h2Cu__8owLUgUGjGcWDe",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 848.4414471158692,
+ "y": 650.826922928275,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 603147257,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 361,
+ "versionNonce": 1981618457,
+ "isDeleted": false,
+ "id": "s0PKxsWTJSDbQeEl_WI-C",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 777.1778842958995,
+ "y": 650.2466837635417,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#b2f2bb",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 326722777,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "lwYvAs-7FTjcwxKjcx0KV",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "text",
+ "version": 871,
+ "versionNonce": 1528156247,
+ "isDeleted": false,
+ "id": "3JAdSa7kqqSDSom5ZFDoE",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 904.3603861670398,
+ "y": 707.2413714353705,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 140.625,
+ "height": 57.599999999999994,
+ "seed": 1011049431,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "final merge\nmain into minor\nbefore release",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "final merge\nmain into minor\nbefore release",
+ "lineHeight": 1.2,
+ "baseline": 53
+ },
+ {
+ "type": "arrow",
+ "version": 591,
+ "versionNonce": 1714373785,
+ "isDeleted": false,
+ "id": "7kFBLq2Iczmj0lVnVk8Ad",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1100.7141458557703,
+ "y": 814.2034531496416,
+ "strokeColor": "#2f9e44",
+ "backgroundColor": "#ffffff",
+ "width": 127.38209933342364,
+ "height": 144.5383600420214,
+ "seed": 25829591,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": {
+ "elementId": "Y7VXnuc9QEz2N2l9i0xrc",
+ "focus": 0.3932764551319699,
+ "gap": 5.928572790502042
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 88.94909573964219,
+ -43.721805169626464
+ ],
+ [
+ 127.38209933342364,
+ -144.5383600420214
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 1208,
+ "versionNonce": 1254600055,
+ "isDeleted": false,
+ "id": "gwFWlPLabuYhxCOweJjWz",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1223.0464288187204,
+ "y": 725.1565933898091,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 150,
+ "height": 38.4,
+ "seed": 51102743,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "main merge minor\n(fast forward)",
+ "textAlign": "center",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "main merge minor\n(fast forward)",
+ "lineHeight": 1.2,
+ "baseline": 34
+ },
+ {
+ "type": "ellipse",
+ "version": 597,
+ "versionNonce": 1760381305,
+ "isDeleted": false,
+ "id": "Y7VXnuc9QEz2N2l9i0xrc",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1227.4473966637659,
+ "y": 647.6689320688656,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 412038615,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "7kFBLq2Iczmj0lVnVk8Ad",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 547,
+ "versionNonce": 1585505943,
+ "isDeleted": false,
+ "id": "ggogfJT7E_bbfEog7Hjnp",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1083.7911569735343,
+ "y": 809.5203742153592,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 18.814646969963974,
+ "height": 18.814646969963974,
+ "seed": 741463161,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [
+ {
+ "id": "nRDWQs5nQa37yzCWTBiXC",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "text",
+ "version": 229,
+ "versionNonce": 1935127129,
+ "isDeleted": false,
+ "id": "eU-EgpwDD42CLYUEIDLaD",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 305.8405004265049,
+ "y": 389.31989430571576,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 581.25,
+ "height": 19.2,
+ "seed": 1086231577,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "- merge feature PRs into, and release minors from minor branch",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "- merge feature PRs into, and release minors from minor branch",
+ "lineHeight": 1.2,
+ "baseline": 15
+ },
+ {
+ "type": "text",
+ "version": 397,
+ "versionNonce": 116088535,
+ "isDeleted": false,
+ "id": "Kt6VBAVD4sLM4IexsRGoX",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 305.4136207977353,
+ "y": 358.61173442109686,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 618.75,
+ "height": 19.2,
+ "seed": 273353945,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927617946,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "- merge fix / chore PRs into, and release patches from main branch",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "- merge fix / chore PRs into, and release patches from main branch",
+ "lineHeight": 1.2,
+ "baseline": 15
+ },
+ {
+ "type": "text",
+ "version": 459,
+ "versionNonce": 440532793,
+ "isDeleted": false,
+ "id": "JwKEdnU6H_Nu74WbEAX5M",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 305.6723761009271,
+ "y": 418.3724478537203,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 459.375,
+ "height": 19.2,
+ "seed": 1001222329,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "- merge main into minor before each minor release",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "- merge main into minor before each minor release",
+ "lineHeight": 1.2,
+ "baseline": 15
+ },
+ {
+ "type": "text",
+ "version": 602,
+ "versionNonce": 1108720119,
+ "isDeleted": false,
+ "id": "mb9ZoP803MiH7MTO8wH-2",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 305.0895924262568,
+ "y": 447.44321411383333,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#a5d8ff",
+ "width": 534.375,
+ "height": 19.2,
+ "seed": 264651479,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "- fast forward main to minor after a stable minor release",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "- fast forward main to minor after a stable minor release",
+ "lineHeight": 1.2,
+ "baseline": 15
+ },
+ {
+ "type": "text",
+ "version": 612,
+ "versionNonce": 1588872441,
+ "isDeleted": false,
+ "id": "IfJPOFiwrCibpaBQqc5g-",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 2,
+ "opacity": 100,
+ "angle": 0,
+ "x": 646.7131179044119,
+ "y": 724.4984335940012,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "#ffc9c9",
+ "width": 131.25,
+ "height": 57.599999999999994,
+ "seed": 1301100087,
+ "groupIds": [],
+ "frameId": null,
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1698927613072,
+ "link": null,
+ "locked": false,
+ "fontSize": 16,
+ "fontFamily": 3,
+ "text": "merge main\ninto minor\nbefore release",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "merge main\ninto minor\nbefore release",
+ "lineHeight": 1.2,
+ "baseline": 53
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#ffffff"
+ },
+ "files": {}
+}
\ No newline at end of file
diff --git a/.github/git-branch-workflow.png b/.github/git-branch-workflow.png
new file mode 100644
index 00000000000..6c8ee07d484
Binary files /dev/null and b/.github/git-branch-workflow.png differ
diff --git a/.github/issue-workflow.png b/.github/issue-workflow.png
new file mode 100644
index 00000000000..92b1de0633c
Binary files /dev/null and b/.github/issue-workflow.png differ
diff --git a/.github/maintenance.md b/.github/maintenance.md
new file mode 100644
index 00000000000..8d4317c6b01
--- /dev/null
+++ b/.github/maintenance.md
@@ -0,0 +1,122 @@
+# Vue Core Maintenance Handbook
+
+Unlike [contributing.md](./contributing.md), which targets external contributors, this document is mainly intended for team members responsible for maintaining the project. It provides guidelines on how to triage issues, review & merge PRs, and publish releases. However, it should also be valuable to external contributors even if you are not a maintainer, as it gives you a better idea of how the maintainers operate, and how you can better collaborate with them. And who knows - maybe one day you will join as a maintainer as well!
+
+- [Issue Triage Workflow](#issue-triage-workflow)
+- [Pull Request Review Guidelines](#pull-request-review-guidelines)
+ - [Reviewing a Fix](#reviewing-a-fix)
+ - [Reviewing a Refactor](#reviewing-a-refactor)
+ - [Reviewing a Feature](#reviewing-a-feature)
+ - [Common Considerations for All PRs](#common-considerations-for-all-prs)
+- [PR Merge Rules for Team Members](#pr-merge-rules-for-team-members)
+- [Git Branch and Release Workflow](#git-branch-and-release-workflow)
+
+## Issue Triage Workflow
+
+
+
+## Pull Request Review Guidelines
+
+The first step of reviewing a PR is to identify its purpose. We can usually put a PR in one of these categories:
+
+- **Fix**: fixes some wrong behavior. Usually associated with an issue that has a reproduction of the behavior being fixed.
+- **Refactor**: improves performance or code quality, but does not affect behavior.
+- **Feature**: implements something that increases the public API surface.
+
+Depending on the type of the PR, different considerations need to be taken into account.
+
+### Reviewing a Fix
+
+- Is the PR fixing a well defined issue / bug report?
+ - If not, ask to clarify context / provide reproduction or failing test case
+- In most cases, a fix PR should include a test case that fails without the fix.
+- Is it the right fix?
+ - If not, guide user to rework the PR.
+ - If the needed change is small and obvious, can directly push to the PR or add inline suggestions to reduce the back-and-forth.
+- Is the cost justified?
+ - Sometimes the fix for a rare edge case might be introducing disproportionately large overhead (perf or code size). We should try our best to reduce the overhead to make the fix a reasonable tradeoff.
+- If the reviewer is not sure about a fix, try to leave a comment explaining the concerns / reservations so the contributor at least gets some feedback.
+
+#### Verifying a Fix
+
+- **Always locally verify that the fix indeed fixes the original behavior, either through a reproduction or a failing test case.**
+- We will run [ecosystem-ci](https://github.com/vuejs/ecosystem-ci) before every release, but if you are concerned about the potential impact of a change, it never hurts to manually run ecosystem-ci by leaving a `/ecosystem-ci run` comment (only works for team members).
+- Take extra caution with snapshot tests! The CI can be "passing" even if the code generated in the snapshot contains bugs. It's best to always accompany a snapshot test with extra `expect(code).toMatch(...)` assertions.
+
+### Reviewing a Refactor
+
+- Performance: if a refactor PR claims to improve performance, there should be benchmarks showcasing said performance unless the improvement is self-explanatory.
+
+- Code quality / stylistic PRs: we should be conservative on merging this type PRs because (1) they can be subjective in many cases, and (2) they often come with large git diffs, causing merge conflicts with other pending PRs, and leading to unwanted noise when tracing changes through git history. Use your best judgement on this type of PRs on whether they are worth it.
+
+ - For PRs in this category that are approved, do not merge immediately. Group them before releasing a new minor, after all feature-oriented PRs are merged.
+
+### Reviewing a Feature
+
+- Feature PRs should always have clear context and explanation on why the feature should be added, ideally in the form of an RFC. If the PR doesn't explain what real-world problem it is solving, ask the contributor to clarify.
+
+- Decide if the feature should require an RFC process. The line isn't always clear, but a rough criteria is whether it is augmenting an existing API vs. adding a new API. Some examples:
+
+ - Adding a new built-in component or directive is "significant" and definitely requires an RFC.
+ - Template syntax additions like adding a new `v-on` modifier or a new `v-bind` syntax sugar are "substantial". It would be nice to have an RFC for it, but a detailed explanation on the use case and reasoning behind the design directly in the PR itself can be acceptable.
+ - Small, low-impact additions like exposing a new utility type or adding a new app config option can be self-explanatory, but should still provide enough context in the PR.
+
+- Always ask if the use case can be solved with existing APIs. Vue already has a pretty large API surface, so we want to make sure every new addition either solves something that wasn't possible before, or significantly improves the DX of a common task.
+
+### Common Considerations for All PRs
+
+- Scope: a PR should only contain changes directly related to the problem being addressed. It should not contain unnecessary code style changes.
+
+- Implementation: code style should be consistent with the rest of the codebase, follow common best practices. Prefer code that is boring but easy to understand over "clever" code.
+
+- Size: bundle size matters. We have a GitHub action that compares the size change for every PR. We should always aim to realize the desired changes with the smallest amount of code size increase.
+
+ - Sometimes we need to compare the size increase vs. perceived benefits to decide whether a change is justifiable. Also take extra care to make sure added code can be tree-shaken if not needed.
+
+ - Make sure to put dev-only code in `__DEV__` branches so they are tree-shakable.
+
+ - Runtime code is more sensitive to size increase than compiler code.
+
+ - Make sure it doesn't accidentally cause dev-only or compiler-only code branches to be included in the runtime build. Notable case is that some functions in @vue/shared are compiler-only and should not be used in runtime code, e.g. `isHTMLTag` and `isSVGTag`.
+
+- Performance
+ - Be careful about code changes in "hot paths", in particular the Virtual DOM renderer (`runtime-core/src/renderer.ts`) and component instantiation code.
+
+- Potential Breakage
+ - avoiding runtime behavior breakage is the highest priority
+ - if not sure, use `ecosystem-ci` to verify!
+ - some fix inevitably cause behavior change, these must be discussed case-by-case
+ - type level breakage (e.g upgrading TS) is possible between minors
+
+## PR Merge Rules for Team Members
+
+Given that the PR meets the review requirements:
+
+- Chore / dependencies bumps: can merge directly.
+- Fixes / refactors: can merge with two or more approvals from team members.
+ - If you believe a PR looks good but you are not 100% confident to merge, label with "ready for merge" and Evan will provide a final review before merging.
+- Features: if approved by two or more team members, label with "ready to merge". Evan will review periodically, or they can be raised and discussed at team meetings.
+
+## Git Branch and Release Workflow
+
+We use two primary work branches: `main` and `minor`.
+
+- The `main` branch is for stable releases. Changes that are bug fixes or refactors that do not affect the public API surface should land in this branch. We periodically release patch releases from the `main` branch.
+
+- The `minor` branch is the WIP branch for the next minor release. Changes that are new features or those that affect public API behavior should land in this branch. We will periodically release pre-releases (alpha / beta) for the next minor from this branch.
+
+Before each release, we merge latest `main` into `minor` so it would include the latest bug fixes.
+
+When the minor is ready, we do a final merge of `main` into `minor`, and then release a stable minor from this branch (e.g. `3.4.0`). After that, the `main` branch is fast-forwarded to the release commit, so the two branches are synced at each stable minor release.
+
+
+
+### Reasoning Behind the Workflow
+
+The reason behind this workflow is to allow merging and releasing of fixes and features in parallel. In the past, we used a linear trunk-based development model. While the linear model results in a clean git history, the downside is that we need to be careful about when to merge patches vs. features.
+
+Vue typically groups a number of features with the same scope in a minor release. We don't want to release a minor just because we happened to merge a feature PR along with a bunch of small bug fixes. So we usually "wait" until we feel we are ready to start working on a minor release before merging feature PRs.
+
+But in reality, there are always bugs to fix and patch release to work on - this caused the intervals between minors to drag on longer than we had hoped, and many feature PRs were left waiting for a long period of time.
+
+This is why we decided to separate bug fixes and feature PRs into separate branches. With this two-branch model, we are able to merge and release both types of changes in parallel.
diff --git a/.github/renovate.json5 b/.github/renovate.json5
new file mode 100644
index 00000000000..a43f4ae30cf
--- /dev/null
+++ b/.github/renovate.json5
@@ -0,0 +1,50 @@
+{
+ $schema: 'https://docs.renovatebot.com/renovate-schema.json',
+ extends: ['config:base', 'schedule:weekly', 'group:allNonMajor'],
+ labels: ['dependencies'],
+ ignorePaths: ['**/__tests__/**'],
+ rangeStrategy: 'bump',
+ packageRules: [
+ {
+ depTypeList: ['peerDependencies'],
+ enabled: false,
+ },
+ {
+ groupName: 'test',
+ matchPackageNames: ['vitest', 'jsdom', 'puppeteer'],
+ matchPackagePrefixes: ['@vitest'],
+ },
+ {
+ groupName: 'playground',
+ matchFileNames: [
+ 'packages/sfc-playground/package.json',
+ 'packages/template-explorer/package.json',
+ ],
+ },
+ {
+ groupName: 'compiler',
+ matchPackageNames: ['magic-string'],
+ matchPackagePrefixes: ['@babel', 'postcss'],
+ },
+ {
+ groupName: 'build',
+ matchPackageNames: ['vite', 'terser'],
+ matchPackagePrefixes: ['rollup', 'esbuild', '@rollup', '@vitejs'],
+ },
+ {
+ groupName: 'lint',
+ matchPackageNames: ['simple-git-hooks', 'lint-staged'],
+ matchPackagePrefixes: ['@typescript-eslint', 'eslint', 'prettier'],
+ },
+ ],
+ ignoreDeps: [
+ 'vue',
+
+ // manually bumping
+ 'node',
+ 'typescript',
+
+ // ESM only
+ 'estree-walker',
+ ],
+}
diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml
new file mode 100644
index 00000000000..d7f11b0d220
--- /dev/null
+++ b/.github/workflows/autofix.yml
@@ -0,0 +1,33 @@
+name: autofix.ci
+
+on:
+ pull_request:
+permissions:
+ contents: read
+
+jobs:
+ autofix:
+ runs-on: ubuntu-latest
+ env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: Set node version to 18
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ cache: pnpm
+
+ - run: pnpm install
+
+ - name: Run eslint
+ run: pnpm run lint --fix
+
+ - name: Run prettier
+ run: pnpm run format
+
+ - uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
diff --git a/.github/workflows/canary-minor.yml b/.github/workflows/canary-minor.yml
new file mode 100644
index 00000000000..27fbd42c90c
--- /dev/null
+++ b/.github/workflows/canary-minor.yml
@@ -0,0 +1,33 @@
+name: canary minor release
+on:
+ # Runs every Monday at 1 AM UTC (9:00 AM in Singapore)
+ schedule:
+ - cron: 0 1 * * MON
+ workflow_dispatch:
+
+jobs:
+ canary:
+ # prevents this action from running on forks
+ if: github.repository == 'vuejs/core'
+ runs-on: ubuntu-latest
+ environment: Release
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: minor
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: Set node version to 18
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ registry-url: 'https://registry.npmjs.org'
+ cache: 'pnpm'
+
+ - run: pnpm install
+
+ - run: pnpm release --canary --tag minor
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml
index cabd601a8ef..61490232f66 100644
--- a/.github/workflows/canary.yml
+++ b/.github/workflows/canary.yml
@@ -12,15 +12,15 @@ jobs:
runs-on: ubuntu-latest
environment: Release
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
- - name: Set node version to 18
- uses: actions/setup-node@v3
+ - name: Install Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c52bbc06970..e458fbd57f3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,21 +14,20 @@ jobs:
unit-test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+ env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
- - name: Set node version to 18
- uses: actions/setup-node@v3
+ - name: Install Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: '.node-version'
cache: 'pnpm'
- - name: Skip Puppeteer download
- run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
-
- run: pnpm install
- name: Run unit tests
@@ -37,21 +36,20 @@ jobs:
unit-test-windows:
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+ env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
- - name: Set node version to 18
- uses: actions/setup-node@v3
+ - name: Install Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: '.node-version'
cache: 'pnpm'
- - name: Skip Puppeteer download
- run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $env:GITHUB_ENV
-
- run: pnpm install
- name: Run compiler unit tests
@@ -64,73 +62,81 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup cache for Chromium binary
uses: actions/cache@v3
with:
- path: ~/.cache/puppeteer/chrome
+ path: ~/.cache/puppeteer
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install pnpm
uses: pnpm/action-setup@v2
- - name: Set node version to 18
- uses: actions/setup-node@v3
+ - name: Install Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: '.node-version'
cache: 'pnpm'
- run: pnpm install
+ - run: node node_modules/puppeteer/install.mjs
- name: Run e2e tests
run: pnpm run test-e2e
+ - name: verify treeshaking
+ run: node scripts/verify-treeshaking.js
+
lint-and-test-dts:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+ env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
- - name: Set node version to 18
- uses: actions/setup-node@v3
+ - name: Install Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: '.node-version'
cache: 'pnpm'
- - name: Skip Puppeteer download
- run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
-
- run: pnpm install
- name: Run eslint
run: pnpm run lint
- # - name: Run prettier
- # run: pnpm run format-check
+ - name: Run prettier
+ run: pnpm run format-check
- name: Run type declaration tests
run: pnpm run test-dts
- size:
- runs-on: ubuntu-latest
- if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
- env:
- CI_JOB_NUMBER: 1
- steps:
- - uses: actions/checkout@v3
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
-
- - name: Set node version to 18
- uses: actions/setup-node@v3
- with:
- node-version: 18
- cache: 'pnpm'
-
- - run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
- - run: pnpm run size
+ # benchmarks:
+ # runs-on: ubuntu-latest
+ # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+ # env:
+ # PUPPETEER_SKIP_DOWNLOAD: 'true'
+ # steps:
+ # - uses: actions/checkout@v4
+
+ # - name: Install pnpm
+ # uses: pnpm/action-setup@v2
+
+ # - name: Install Node.js
+ # uses: actions/setup-node@v4
+ # with:
+ # node-version-file: '.node-version'
+ # cache: 'pnpm'
+
+ # - run: pnpm install
+
+ # - name: Run benchmarks
+ # uses: CodSpeedHQ/action@v2
+ # with:
+ # run: pnpm vitest bench --run
+ # token: ${{ secrets.CODSPEED_TOKEN }}
diff --git a/.github/workflows/ecosystem-ci-trigger.yml b/.github/workflows/ecosystem-ci-trigger.yml
index bd3a2749431..25adf7c85f4 100644
--- a/.github/workflows/ecosystem-ci-trigger.yml
+++ b/.github/workflows/ecosystem-ci-trigger.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'vuejs/core' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
steps:
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
with:
script: |
const user = context.payload.sender.login
@@ -43,7 +43,7 @@ jobs:
})
throw new Error('not allowed')
}
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
id: get-pr-data
with:
script: |
@@ -58,7 +58,7 @@ jobs:
branchName: pr.head.ref,
repo: pr.head.repo.full_name
}
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
id: trigger
env:
COMMENT: ${{ github.event.comment.body }}
diff --git a/.github/workflows/lock-closed-issues.yml b/.github/workflows/lock-closed-issues.yml
new file mode 100644
index 00000000000..68a7d6c7a15
--- /dev/null
+++ b/.github/workflows/lock-closed-issues.yml
@@ -0,0 +1,20 @@
+name: Lock Closed Issues
+
+on:
+ schedule:
+ - cron: '0 0 * * *'
+
+permissions:
+ issues: write
+
+jobs:
+ action:
+ if: github.repository == 'vuejs/core'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: dessant/lock-threads@v5
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ issue-inactive-days: '14'
+ issue-lock-reason: ''
+ process-only: 'issues'
diff --git a/.github/workflows/size-data.yml b/.github/workflows/size-data.yml
new file mode 100644
index 00000000000..bb82aa18d58
--- /dev/null
+++ b/.github/workflows/size-data.yml
@@ -0,0 +1,52 @@
+name: size data
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+permissions:
+ contents: read
+
+env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
+
+jobs:
+ upload:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: Install Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version-file: '.node-version'
+ cache: pnpm
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - run: pnpm run size
+
+ - name: Upload Size Data
+ uses: actions/upload-artifact@v3
+ with:
+ name: size-data
+ path: temp/size
+
+ - name: Save PR number
+ if: ${{github.event_name == 'pull_request'}}
+ run: echo ${{ github.event.number }} > ./pr.txt
+
+ - uses: actions/upload-artifact@v3
+ if: ${{github.event_name == 'pull_request'}}
+ with:
+ name: pr-number
+ path: pr.txt
diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml
new file mode 100644
index 00000000000..78ae44bb7ea
--- /dev/null
+++ b/.github/workflows/size-report.yml
@@ -0,0 +1,84 @@
+name: size report
+
+on:
+ workflow_run:
+ workflows: ['size data']
+ types:
+ - completed
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+
+env:
+ PUPPETEER_SKIP_DOWNLOAD: 'true'
+
+jobs:
+ size-report:
+ runs-on: ubuntu-latest
+ if: >
+ github.event.workflow_run.event == 'pull_request' &&
+ github.event.workflow_run.conclusion == 'success'
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: Install Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version-file: '.node-version'
+ cache: pnpm
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Download PR number
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ name: pr-number
+ run_id: ${{ github.event.workflow_run.id }}
+
+ - name: Read PR Number
+ id: pr-number
+ uses: juliangruber/read-file-action@v1
+ with:
+ path: ./pr.txt
+
+ - name: Download Size Data
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ name: size-data
+ run_id: ${{ github.event.workflow_run.id }}
+ path: temp/size
+
+ - name: Download Previous Size Data
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ branch: main
+ workflow: size-data.yml
+ event: push
+ name: size-data
+ path: temp/size-prev
+ if_no_artifact_found: warn
+
+ - name: Compare size
+ run: pnpm tsx scripts/size-report.ts > size-report.md
+
+ - name: Read Size Report
+ id: size-report
+ uses: juliangruber/read-file-action@v1
+ with:
+ path: ./size-report.md
+
+ - name: Create Comment
+ uses: actions-cool/maintain-one-comment@v3
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ number: ${{ steps.pr-number.outputs.content }}
+ body: |
+ ${{ steps.size-report.outputs.content }}
+
+ body-include: ''
diff --git a/.node-version b/.node-version
new file mode 100644
index 00000000000..209e3ef4b62
--- /dev/null
+++ b/.node-version
@@ -0,0 +1 @@
+20
diff --git a/.prettierignore b/.prettierignore
index 1521c8b7652..fbd3dca8ca3 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1 +1,4 @@
dist
+*.md
+*.html
+pnpm-lock.yaml
diff --git a/.prettierrc b/.prettierrc
index ef93d94821a..759232e7cf6 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,5 +1,5 @@
-semi: false
-singleQuote: true
-printWidth: 80
-trailingComma: 'none'
-arrowParens: 'avoid'
+{
+ "semi": false,
+ "singleQuote": true,
+ "arrowParens": "avoid"
+}
diff --git a/.vscode/launch.json b/.vscode/launch.json
index b63ffc79b80..b616400b48e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -21,7 +21,7 @@
"console": "integratedTerminal",
"sourceMaps": true,
"windows": {
- "program": "${workspaceFolder}/node_modules/jest/bin/jest",
+ "program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
]
diff --git a/BACKERS.md b/BACKERS.md
index 631bcb91120..d8eb697f957 100644
--- a/BACKERS.md
+++ b/BACKERS.md
@@ -4,6 +4,6 @@ Vue.js is an MIT-licensed open source project with its ongoing development made
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f2659ed589a..c6af9139403 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,404 +1,620 @@
-## [3.3.4](https://github.com/vuejs/core/compare/v3.3.3...v3.3.4) (2023-05-18)
+## [3.4.15](https://github.com/vuejs/core/compare/v3.4.14...v3.4.15) (2024-01-18)
### Bug Fixes
-* **build:** ensure correct typing for node esm ([d621d4c](https://github.com/vuejs/core/commit/d621d4c646b2d7b190fbd44ad1fd04512b3de300))
-* **build:** fix __DEV__ flag replacement edge case ([8b7c04b](https://github.com/vuejs/core/commit/8b7c04b18f73aad9a08dd57eba90101b5b2aef28)), closes [#8353](https://github.com/vuejs/core/issues/8353)
-* **compiler-sfc:** handle imported types from default exports ([5aec717](https://github.com/vuejs/core/commit/5aec717a2402652306085f58432ba3ab91848a74)), closes [#8355](https://github.com/vuejs/core/issues/8355)
+* **compiler-sfc:** fix type resolution for symlinked node_modules structure w/ pnpm ([75e866b](https://github.com/vuejs/core/commit/75e866bd4ef368b4e037a4933dbaf188920dc683)), closes [#10121](https://github.com/vuejs/core/issues/10121)
+* correct url for production error reference links ([c3087ff](https://github.com/vuejs/core/commit/c3087ff2cce7d96c60a870f8233441311ab4dfb4))
+* **hydration:** fix incorect mismatch warning for option with non-string value and inner text ([d16a213](https://github.com/vuejs/core/commit/d16a2138a33b106b9e1499bbb9e1c67790370c97))
+* **reactivity:** re-fix [#10114](https://github.com/vuejs/core/issues/10114) ([#10123](https://github.com/vuejs/core/issues/10123)) ([c2b274a](https://github.com/vuejs/core/commit/c2b274a887f61deb7e0185d1bef3b77d31e991cc))
+* **runtime-core:** should not warn out-of-render slot fn usage when mounting another app in setup ([#10125](https://github.com/vuejs/core/issues/10125)) ([6fa33e6](https://github.com/vuejs/core/commit/6fa33e67ec42af140a86fbdb86939032c3a1f345)), closes [#10124](https://github.com/vuejs/core/issues/10124)
+
+
+### Performance Improvements
+
+* **templateRef:** avoid double render when using template ref on v-for ([de4d2e2](https://github.com/vuejs/core/commit/de4d2e2143ea8397cebeb1c7a57a60007b283c9f)), closes [#9908](https://github.com/vuejs/core/issues/9908)
+* **v-model:** optimize v-model multiple select w/ large lists ([2ffb956](https://github.com/vuejs/core/commit/2ffb956efe692da059f4895669084c5278871351)), closes [#10014](https://github.com/vuejs/core/issues/10014)
-## [3.3.3](https://github.com/vuejs/core/compare/v3.3.2...v3.3.3) (2023-05-18)
+## [3.4.14](https://github.com/vuejs/core/compare/v3.4.13...v3.4.14) (2024-01-15)
### Bug Fixes
-* avoid regex s flag for old browsers ([91f1c62](https://github.com/vuejs/core/commit/91f1c62e6384a8b09f90e7e43b8d347901e529a0)), closes [#8316](https://github.com/vuejs/core/issues/8316)
-* **build:** fix dev flag replacement in esm-builder builds ([#8314](https://github.com/vuejs/core/issues/8314)) ([003836f](https://github.com/vuejs/core/commit/003836f90e1f00ebd04b77ec07ccfa4e649a2ff4)), closes [#8312](https://github.com/vuejs/core/issues/8312)
-* **compiler-sfc:** don't hoist regexp literial ([#8300](https://github.com/vuejs/core/issues/8300)) ([8ec73a3](https://github.com/vuejs/core/commit/8ec73a3aea7a52e9479f107ae5737761166ddae6))
-* **compiler-sfc:** fix props destructing default value type checking with unresolved type ([#8340](https://github.com/vuejs/core/issues/8340)) ([f69dbab](https://github.com/vuejs/core/commit/f69dbabf8794426c3e9ed33ae77dd8ce655eafd2)), closes [#8326](https://github.com/vuejs/core/issues/8326)
-* **compiler-sfc:** fix type import from path aliased vue file ([fab9c72](https://github.com/vuejs/core/commit/fab9c727805c6186c490f99023e8cf5401b0b5a9)), closes [#8348](https://github.com/vuejs/core/issues/8348)
-* **compiler-sfc:** handle ts files with relative imports with .js extension ([b36addd](https://github.com/vuejs/core/commit/b36addd3bde07467e9ff5641bd1c2bdc3085944c)), closes [#8339](https://github.com/vuejs/core/issues/8339)
-* **compiler-sfc:** parses correctly when inline mode is off ([#8337](https://github.com/vuejs/core/issues/8337)) ([ecbd42a](https://github.com/vuejs/core/commit/ecbd42a1444e3c599e464dec002e43d548d99669)), closes [#6088](https://github.com/vuejs/core/issues/6088)
-* **compiler-sfc:** support defineEmits type reference with unions ([#8299](https://github.com/vuejs/core/issues/8299)) ([b133e0f](https://github.com/vuejs/core/commit/b133e0fd97b0b4fabbb43151c19031b8fb47c05b)), closes [#7943](https://github.com/vuejs/core/issues/7943)
-* **types:** support generic usage with withDefaults + defineProps ([#8335](https://github.com/vuejs/core/issues/8335)) ([216f269](https://github.com/vuejs/core/commit/216f26995b63c2df26ca0f39f390fe8d59cdabfa)), closes [#8310](https://github.com/vuejs/core/issues/8310) [#8331](https://github.com/vuejs/core/issues/8331) [#8325](https://github.com/vuejs/core/issues/8325)
+* **compiler-sfc:** enable prefixIdentifiers by default when reparsing on consumed AST ([#10105](https://github.com/vuejs/core/issues/10105)) ([48bf8e4](https://github.com/vuejs/core/commit/48bf8e4c708ec620e4852d71c8713394457108ee))
+* **deps:** update dependency postcss to ^8.4.33 ([#10110](https://github.com/vuejs/core/issues/10110)) ([a557006](https://github.com/vuejs/core/commit/a557006f8e7f110c6f322de38931dceaab8e9cbb))
+* **reactivity:** fix regression for computed with mutation ([#10119](https://github.com/vuejs/core/issues/10119)) ([20f62af](https://github.com/vuejs/core/commit/20f62afaafd422e42b99dde9c16f9a4ebfb9c5f7)), closes [#10114](https://github.com/vuejs/core/issues/10114)
-## [3.3.2](https://github.com/vuejs/core/compare/v3.3.1...v3.3.2) (2023-05-12)
+## [3.4.13](https://github.com/vuejs/core/compare/v3.4.12...v3.4.13) (2024-01-13)
### Bug Fixes
-* **compiler-core:** treat floating point numbers as constants ([8dc8cf8](https://github.com/vuejs/core/commit/8dc8cf852bf8057aa5c4b5670f09e8c28a168b73)), closes [#8295](https://github.com/vuejs/core/issues/8295)
-* **compiler-dom:** do not throw in production on side effect tags ([c454b9d](https://github.com/vuejs/core/commit/c454b9d7f431d57abedb7184d1e4059914c4463f)), closes [#8287](https://github.com/vuejs/core/issues/8287) [#8292](https://github.com/vuejs/core/issues/8292)
-* **compiler-sfc:** fix regression on props destructure when transform is not enabled ([f25bd37](https://github.com/vuejs/core/commit/f25bd37c6707fde19d164d90a38de41168941f4b)), closes [#8289](https://github.com/vuejs/core/issues/8289)
-* **compiler-sfc:** handle prop keys that need escaping ([#7803](https://github.com/vuejs/core/issues/7803)) ([690ef29](https://github.com/vuejs/core/commit/690ef296357c7fc09f66ba9408df548e117f686f)), closes [#8291](https://github.com/vuejs/core/issues/8291)
-* **compiler-sfc:** properly parse d.ts files when resolving types ([aa1e77d](https://github.com/vuejs/core/commit/aa1e77d532b951ea5d3a5e26214a8b0c9c02fb6f)), closes [#8285](https://github.com/vuejs/core/issues/8285)
-* **compiler-sfc:** raise specific warning for failed extends and allow ignoring extends ([8235072](https://github.com/vuejs/core/commit/82350721a408e1f552c613c05971439d6c218d87)), closes [#8286](https://github.com/vuejs/core/issues/8286)
+* **reactivity:** fix dirtyLevel checks for recursive effects ([#10101](https://github.com/vuejs/core/issues/10101)) ([e45a8d2](https://github.com/vuejs/core/commit/e45a8d24b46c174deb46ed952bdaf54c81ad5a85)), closes [#10082](https://github.com/vuejs/core/issues/10082)
-## [3.3.1](https://github.com/vuejs/core/compare/v3.3.0...v3.3.1) (2023-05-11)
+## [3.4.12](https://github.com/vuejs/core/compare/v3.4.11...v3.4.12) (2024-01-13)
-### Bug Fixes
-
-* **suspense:** handle nested sync suspense for hydration ([a3f5485](https://github.com/vuejs/core/commit/a3f54857858c8ca0e6b9f12618d151ab255fb040))
+### Reverts
+* fix(reactivity): correct dirty assign in render function ([#10091](https://github.com/vuejs/core/issues/10091)) ([8b18481](https://github.com/vuejs/core/commit/8b1848173b0bc8fd84ce1da1af8d373c044bf073)), closes [#10098](https://github.com/vuejs/core/issues/10098) [#10100](https://github.com/vuejs/core/issues/10100)
-# [3.3.0 Rurouni Kenshin](https://github.com/vuejs/core/compare/v3.3.0-beta.5...v3.3.0) (2023-05-11)
-- For a detailed walkthrough of the new features in 3.3, please read the [release blog post](https://blog.vuejs.org/posts/vue-3-3).
+## [3.4.11](https://github.com/vuejs/core/compare/v3.4.10...v3.4.11) (2024-01-12)
-- Features and deprecations listed here are aggregated from the beta and alpha releases. For full chronological history, bug fixes, and other minor features, please consult the individual logs of the 3.3 beta and alpha releases.
-## Features
+### Bug Fixes
-* **sfc:** support imported types in SFC macros ([#8083](https://github.com/vuejs/core/pull/8083))
-* **types/slots:** support slot presence / props type checks via `defineSlots` macro and `slots` option ([#7982](https://github.com/vuejs/core/issues/7982)) ([5a2f5d5](https://github.com/vuejs/core/commit/5a2f5d59cffa36a99e6f2feab6b3ba7958b7362f))
-* **sfc:** support more ergnomic defineEmits type syntax ([#7992](https://github.com/vuejs/core/issues/7992)) ([8876dcc](https://github.com/vuejs/core/commit/8876dccf42a7f05375d97cb18c1afdfd0fc51c94))
-* **sfc:** introduce `defineModel` macro and `useModel` helper ([#8018](https://github.com/vuejs/core/issues/8018)) ([14f3d74](https://github.com/vuejs/core/commit/14f3d747a34d45415b0036b274517d70a27ec0d3))
-* **reactivity:** improve support of getter usage in reactivity APIs ([#7997](https://github.com/vuejs/core/issues/7997)) ([59e8284](https://github.com/vuejs/core/commit/59e828448e7f37643cd0eaea924a764e9d314448))
-* **compiler-sfc:** add defineOptions macro ([#5738](https://github.com/vuejs/core/issues/5738)) ([bcf5841](https://github.com/vuejs/core/commit/bcf5841ddecc64d0bdbd56ce1463eb8ebf01bb9d))
-* **types/jsx:** support jsxImportSource, avoid global JSX conflict ([#7958](https://github.com/vuejs/core/issues/7958)) ([d0b7ef3](https://github.com/vuejs/core/commit/d0b7ef3b61d5f83e35e5854b3c2c874e23463102))
-* **dx:** improve readability of displayed types for props ([4c9bfd2](https://github.com/vuejs/core/commit/4c9bfd2b999ce472f7481aae4f9dc5bb9f76628e))
-* **app:** app.runWithContext() ([#7451](https://github.com/vuejs/core/issues/7451)) ([869f3fb](https://github.com/vuejs/core/commit/869f3fb93e61400be4fd925e0850c2b1564749e2))
-* hasInjectionContext() for libraries ([#8111](https://github.com/vuejs/core/issues/8111)) ([5510ce3](https://github.com/vuejs/core/commit/5510ce385abfa151c07a5253cccf4abccabdd01d))
-* allow accessing console in template ([#6508](https://github.com/vuejs/core/issues/6508)) ([fe76224](https://github.com/vuejs/core/commit/fe762247f8035d28d543bc5602ad01b0c258f6d6)), closes [#7939](https://github.com/vuejs/core/issues/7939)
-* **suspense:** introduce suspensible option for `` ([#6736](https://github.com/vuejs/core/issues/6736)) ([cb37d0b](https://github.com/vuejs/core/commit/cb37d0b9ffb5d4bb81a0367d84295dec8dd4448c)), closes [#5513](https://github.com/vuejs/core/issues/5513)
-* **compiler-dom:** treat inert as boolean attribute ([#8209](https://github.com/vuejs/core/issues/8209)) ([918ec8a](https://github.com/vuejs/core/commit/918ec8a5cbc825a3947cd35fe966671c245af087)), closes [#8208](https://github.com/vuejs/core/issues/8208)
-* **types:** add slots types for built-in components ([#6033](https://github.com/vuejs/core/issues/6033)) ([3cb4dc9](https://github.com/vuejs/core/commit/3cb4dc9e5538e1c2bde9fa691b001615a848c546))
-* **types:** provide ExtractPublicPropTypes utility type ([bff63c5](https://github.com/vuejs/core/commit/bff63c5498f5fa098689c18defe48ae08d47eadb)), closes [#5272](https://github.com/vuejs/core/issues/5272) [#8168](https://github.com/vuejs/core/issues/8168)
-* **compiler-sfc:** expose parseCache ([4576548](https://github.com/vuejs/core/commit/45765488d498d94f8760c9e82f1177070057b17c)), closes [#8202](https://github.com/vuejs/core/issues/8202)
+* **hydration:** improve mismatch when client value is null or undefined ([#10086](https://github.com/vuejs/core/issues/10086)) ([08b60f5](https://github.com/vuejs/core/commit/08b60f5d0d5b57fcf3347ef66cbeab472c475a88))
+* **reactivity:** correct dirty assign in render function ([#10091](https://github.com/vuejs/core/issues/10091)) ([8d04205](https://github.com/vuejs/core/commit/8d042050411fdf04d9d1d6c153287164b12e0255)), closes [#10082](https://github.com/vuejs/core/issues/10082)
+* **runtime-core:** filter single root for nested DEV_ROOT_FRAGMENT ([#8593](https://github.com/vuejs/core/issues/8593)) ([d35b877](https://github.com/vuejs/core/commit/d35b87725ab3e2bdc86fb5781ab34939f7ec1029)), closes [#5203](https://github.com/vuejs/core/issues/5203) [#8581](https://github.com/vuejs/core/issues/8581) [#10087](https://github.com/vuejs/core/issues/10087)
-## Deprecations
-* **deprecation:** deprecate [@vnode](https://github.com/vnode) hooks in favor of vue: prefix ([5f0394a](https://github.com/vuejs/core/commit/5f0394a5ab88c82c74e240161499721f63d5462e))
-* **deprecation:** deprecate v-is directive ([bbd8301](https://github.com/vuejs/core/commit/bbd8301a1344b02de635ea16d4822db1c343bd12))
-* **deprecation:** unwrap injected refs in Options API by default, deprecate app.config.unwrapInjectedRefs ([526fa3b](https://github.com/vuejs/core/commit/526fa3b2ccf038375e76f8af2f1ddf79a7388878))
-# [3.3.0-beta.5](https://github.com/vuejs/core/compare/v3.3.0-beta.4...v3.3.0-beta.5) (2023-05-08)
+## [3.4.10](https://github.com/vuejs/core/compare/v3.4.9...v3.4.10) (2024-01-11)
### Bug Fixes
-* **build:** retain defineComponent() treeshakability in Rollup ([c2172f3](https://github.com/vuejs/core/commit/c2172f3a0ebbd7153e209dd8df6d9724bc524d9a)), closes [#8236](https://github.com/vuejs/core/issues/8236)
-* **compiler-sfc:** enable props destructure when reactivity transform option is enabled ([862edfd](https://github.com/vuejs/core/commit/862edfd91a2c2f6b75f943cb1a9682c4be5d7fa8))
-* **compiler-sfc:** fix built-in type resolving in external files ([6b194bc](https://github.com/vuejs/core/commit/6b194bcf3b8143895c2a472cd87998ebf9856146)), closes [#8244](https://github.com/vuejs/core/issues/8244)
-* **compiler-sfc:** transform destructured props when reactivity transform option is enabled ([#8252](https://github.com/vuejs/core/issues/8252)) ([287bd99](https://github.com/vuejs/core/commit/287bd999942e58925377f50540c7134cff2a9279))
-* **runtime-core:** ensure defineComponent name in extraOptions takes higher priority ([b2be75b](https://github.com/vuejs/core/commit/b2be75bad4ba70da1da6930eb914e51ce2c630b2))
-* **runtime-dom:** check attribute value when setting option value ([#8246](https://github.com/vuejs/core/issues/8246)) ([4495373](https://github.com/vuejs/core/commit/4495373d28d9fa4479eedd224adb16248ae0b9f4)), closes [#8227](https://github.com/vuejs/core/issues/8227)
-* **suspense:** fix nested suspensible suspense with no asyn deps ([e147512](https://github.com/vuejs/core/commit/e1475129fc6f8c086c2ec667476900b8c8f46774)), closes [#8206](https://github.com/vuejs/core/issues/8206)
-* **types:** remove short syntax support in defineSlots() ([1279b17](https://github.com/vuejs/core/commit/1279b1730079f77692a0817d51bbba57eb2b871b))
+* **hydration:** should not warn on falsy bindings of non-property keys ([3907c87](https://github.com/vuejs/core/commit/3907c87ce23cc6ef4a739b5a66ddb553e8723114))
-# [3.3.0-beta.4](https://github.com/vuejs/core/compare/v3.3.0-beta.3...v3.3.0-beta.4) (2023-05-05)
+## [3.4.9](https://github.com/vuejs/core/compare/v3.4.8...v3.4.9) (2024-01-11)
### Bug Fixes
-* **runtime-core:** handle template ref with number values ([#8233](https://github.com/vuejs/core/issues/8233)) ([1b1242f](https://github.com/vuejs/core/commit/1b1242f4d1349e361335b2815f41742d41283a94)), closes [#8230](https://github.com/vuejs/core/issues/8230)
-* **types:** retain compatibility for provide() usage with explicit type parameter ([038cd83](https://github.com/vuejs/core/commit/038cd830d5b34b47d7e7e1c61f0973d27cd8b915))
+* **build:** avoid accessing __FEATURE_PROD_DEVTOOLS__ flag in root scope ([dfd9654](https://github.com/vuejs/core/commit/dfd9654665890d1bc7129f6e3c2faaa5b1f28f72))
+* **hydration:** do not warn against bindings w/ object values ([dcc68ef](https://github.com/vuejs/core/commit/dcc68ef7d48973abd8dd3178b46e50e3b0785ea4))
+* **runtime-dom:** unify behavior for v-show + style display binding ([#10075](https://github.com/vuejs/core/issues/10075)) ([cd419ae](https://github.com/vuejs/core/commit/cd419aec3cb615eaea8b2324356f38f4c0ff1fcc)), closes [#10074](https://github.com/vuejs/core/issues/10074)
+* **suspense:** avoid double-patching nested suspense when parent suspense is not resolved ([#10055](https://github.com/vuejs/core/issues/10055)) ([bcda96b](https://github.com/vuejs/core/commit/bcda96b525801eb7a1d397300fb3f2f9b827ddfb)), closes [#8678](https://github.com/vuejs/core/issues/8678)
-### Features
-* **compiler-dom:** treat inert as boolean attribute ([#8209](https://github.com/vuejs/core/issues/8209)) ([918ec8a](https://github.com/vuejs/core/commit/918ec8a5cbc825a3947cd35fe966671c245af087)), closes [#8208](https://github.com/vuejs/core/issues/8208)
-* **types:** add slots types for built-in components ([#6033](https://github.com/vuejs/core/issues/6033)) ([3cb4dc9](https://github.com/vuejs/core/commit/3cb4dc9e5538e1c2bde9fa691b001615a848c546))
-* **types:** provide ExtractPublicPropTypes utility type ([bff63c5](https://github.com/vuejs/core/commit/bff63c5498f5fa098689c18defe48ae08d47eadb)), closes [#5272](https://github.com/vuejs/core/issues/5272) [#8168](https://github.com/vuejs/core/issues/8168)
+## [3.4.8](https://github.com/vuejs/core/compare/v3.4.7...v3.4.8) (2024-01-10)
+
+
+### Bug Fixes
+
+* **hydration:** fix class and style hydration mismatch message ([5af3987](https://github.com/vuejs/core/commit/5af398729168481c3bee741b4f36fa4f375e0f4a)), closes [#10067](https://github.com/vuejs/core/issues/10067)
+* **hydration:** improve attr hydration mismatch check for boolean attrs ([972face](https://github.com/vuejs/core/commit/972facee0d892a1b6d9d4ad1da5da9306ed45c3f)), closes [#10057](https://github.com/vuejs/core/issues/10057) [#10060](https://github.com/vuejs/core/issues/10060)
+* **suspense:** fix more suspense patch before resolve edge cases ([70ad4ca](https://github.com/vuejs/core/commit/70ad4caad7d19938f8ccf1ede3228a81254dd4bf)), closes [#10017](https://github.com/vuejs/core/issues/10017)
-# [3.3.0-beta.3](https://github.com/vuejs/core/compare/v3.3.0-beta.2...v3.3.0-beta.3) (2023-05-01)
+## [3.4.7](https://github.com/vuejs/core/compare/v3.4.6...v3.4.7) (2024-01-09)
### Bug Fixes
-* **compiler-core:** handle slot argument parsing edge case ([b434d12](https://github.com/vuejs/core/commit/b434d12bf6cbd49a7c99b1646d9517d8393ea49f))
-* **hmr:** keep slots proxy mutable for hmr ([c117d9c](https://github.com/vuejs/core/commit/c117d9c257820481b85304db26ce5c77af5d050c)), closes [#8188](https://github.com/vuejs/core/issues/8188)
-* **types:** fix provide type checking for ref value ([de87e6e](https://github.com/vuejs/core/commit/de87e6e405dfaf9a917d7eb423fcee35237c2020)), closes [#8201](https://github.com/vuejs/core/issues/8201)
+* **parser:** skip compat mode check for SFC root `` tags ([#10034](https://github.com/vuejs/core/issues/10034)) ([923d560](https://github.com/vuejs/core/commit/923d560d0b6713144671809b6dfeb1e2da503b1f))
+* **types:** fix functional component for `h` ([#9991](https://github.com/vuejs/core/issues/9991)) ([438a74a](https://github.com/vuejs/core/commit/438a74aad840183286fbdb488178510f37218a73))
-### Features
+### Reverts
-* **compiler-sfc:** expose parseCache ([4576548](https://github.com/vuejs/core/commit/45765488d498d94f8760c9e82f1177070057b17c)), closes [#8202](https://github.com/vuejs/core/issues/8202)
+* "dx(computed): warn incorrect use of getCurrentInstance inside computed" ([2fd3905](https://github.com/vuejs/core/commit/2fd39057386644c8bfee426c60a51f2b07a79b09))
-# [3.3.0-beta.2](https://github.com/vuejs/core/compare/v3.3.0-beta.1...v3.3.0-beta.2) (2023-04-25)
+## [3.4.6](https://github.com/vuejs/core/compare/v3.4.5...v3.4.6) (2024-01-08)
### Bug Fixes
-* **compiler-sfc:** avoid all hard errors when inferring runtime type ([2d9f6f9](https://github.com/vuejs/core/commit/2d9f6f926453c46f542789927bcd30d15da9c24b))
-* **compiler-sfc:** normalize windows paths when resolving types ([#8136](https://github.com/vuejs/core/issues/8136)) ([29da504](https://github.com/vuejs/core/commit/29da50468770fcee16ba5d5bec7166dd5bc120ee))
-* **compiler-sfc:** props bindings should not override user declared bindings ([433a58c](https://github.com/vuejs/core/commit/433a58ccb61c25512dcc3df155b8e285256917ef)), closes [#8148](https://github.com/vuejs/core/issues/8148)
+* **build:** revert "build: add production/development export conditions ([#9977](https://github.com/vuejs/core/issues/9977))" ([7bd4e90](https://github.com/vuejs/core/commit/7bd4e90506547c42234165776b01793abd37b148)), closes [#10012](https://github.com/vuejs/core/issues/10012) [#10020](https://github.com/vuejs/core/issues/10020)
+* fix post watcher fire timing on nested app mounts ([3c3561e](https://github.com/vuejs/core/commit/3c3561e7203091f49d57f1da6d822c91e462bc46)), closes [#10005](https://github.com/vuejs/core/issues/10005)
+* **hydration:** avoid hydration mismatch warning for styles with different order ([#10011](https://github.com/vuejs/core/issues/10011)) ([2701355](https://github.com/vuejs/core/commit/2701355e8eb07ab664e398d9fc05d6c4e2e9b20e)), closes [#10000](https://github.com/vuejs/core/issues/10000) [#10006](https://github.com/vuejs/core/issues/10006)
+* **runtime-core:** handle fragment with null children ([#10010](https://github.com/vuejs/core/issues/10010)) ([3bf34b7](https://github.com/vuejs/core/commit/3bf34b767e4dd3cf6a974301ecf0363ae4dda4ec)), closes [#10007](https://github.com/vuejs/core/issues/10007)
+* **scheduler:** sort nested postFlushCbs ([d9162df](https://github.com/vuejs/core/commit/d9162dfc2ee0c3a369fb9bf32ff413e74761bee6)), closes [#10003](https://github.com/vuejs/core/issues/10003)
+* **suspense:** fix anchor for suspense with transition out-in ([#9999](https://github.com/vuejs/core/issues/9999)) ([a3fbf21](https://github.com/vuejs/core/commit/a3fbf2132b0cd3655e969e290548c8fabc08fd33)), closes [#9996](https://github.com/vuejs/core/issues/9996)
+* **types:** allow `null` type for textarea value ([#9997](https://github.com/vuejs/core/issues/9997)) ([c379bc2](https://github.com/vuejs/core/commit/c379bc29efc70d6ac5840de10c357ee3dad998c0)), closes [#9904](https://github.com/vuejs/core/issues/9904)
-### Features
-* **compiler-sfc:** support project references when resolving types ([1c0be5c](https://github.com/vuejs/core/commit/1c0be5c7444966fa444460e87633cf44ec60292a)), closes [#8140](https://github.com/vuejs/core/issues/8140)
+## [3.4.5](https://github.com/vuejs/core/compare/v3.4.4...v3.4.5) (2024-01-04)
-### Performance Improvements
+### Bug Fixes
-* **compiler-sfc:** infer ref binding type for more built-in methods ([a370e80](https://github.com/vuejs/core/commit/a370e8006a70ea49a7d04c8c1a42d0947eba5dea))
+* **compiler-sfc:** fix co-usage of defineModel transform options and props destructure ([b20350d](https://github.com/vuejs/core/commit/b20350ded562d27e5901f308d0bc13344f840c4a)), closes [#9972](https://github.com/vuejs/core/issues/9972)
+* **compiler-sfc:** fix sfc template unref rewrite for class instantiation ([ae60a91](https://github.com/vuejs/core/commit/ae60a91cc23424493071ad9088782763eb1e8ff7)), closes [#6483](https://github.com/vuejs/core/issues/6483) [#6491](https://github.com/vuejs/core/issues/6491)
+* **compiler-ssr:** fix node clone edge case caused by AST reuse ([#9983](https://github.com/vuejs/core/issues/9983)) ([7dbdb3e](https://github.com/vuejs/core/commit/7dbdb3edf0ab648965331ca42f069387c97a1c8a)), closes [#9981](https://github.com/vuejs/core/issues/9981)
+* **watch:** cleanup watcher effect from scope when manually stopped ([#9978](https://github.com/vuejs/core/issues/9978)) ([d2d8955](https://github.com/vuejs/core/commit/d2d89551bb06dc05cb7ae0496b8f345ae0de78ed))
-# [3.3.0-beta.1](https://github.com/vuejs/core/compare/v3.3.0-alpha.13...v3.3.0-beta.1) (2023-04-21)
+## [3.4.4](https://github.com/vuejs/core/compare/v3.4.3...v3.4.4) (2024-01-03)
-### Features
+### Bug Fixes
-* allow accessing console in template ([#6508](https://github.com/vuejs/core/issues/6508)) ([fe76224](https://github.com/vuejs/core/commit/fe762247f8035d28d543bc5602ad01b0c258f6d6)), closes [#7939](https://github.com/vuejs/core/issues/7939)
-* **compiler-sfc:** improve utility type Partial and Required ([#8103](https://github.com/vuejs/core/issues/8103)) ([1d1d728](https://github.com/vuejs/core/commit/1d1d72894995fde14bd09e2990462c19d5176bf9))
-* **deprecation:** deprecate [@vnode](https://github.com/vnode) hooks in favor of vue: prefix ([5f0394a](https://github.com/vuejs/core/commit/5f0394a5ab88c82c74e240161499721f63d5462e))
-* **deprecation:** deprecate v-is directive ([bbd8301](https://github.com/vuejs/core/commit/bbd8301a1344b02de635ea16d4822db1c343bd12))
-* **deprecation:** unwrap injected refs in Options API by default, deprecate app.config.unwrapInjectedRefs ([526fa3b](https://github.com/vuejs/core/commit/526fa3b2ccf038375e76f8af2f1ddf79a7388878))
-* **suspense:** introduce suspensible option for `` ([#6736](https://github.com/vuejs/core/issues/6736)) ([cb37d0b](https://github.com/vuejs/core/commit/cb37d0b9ffb5d4bb81a0367d84295dec8dd4448c)), closes [#5513](https://github.com/vuejs/core/issues/5513)
+* **compiler-sfc:** fix scss source map regression ([71d3121](https://github.com/vuejs/core/commit/71d3121b72c449351e718ee1539bdfa35b68bb32)), closes [#9970](https://github.com/vuejs/core/issues/9970) [#9969](https://github.com/vuejs/core/issues/9969)
+* **compiler-sfc:** use compilerOptions when re-parsing consumed AST ([d94d8d4](https://github.com/vuejs/core/commit/d94d8d4bffd1daf171a655b292745ffc3e63052d))
+* **defineModel:** support kebab-case/camelCase mismatches ([#9950](https://github.com/vuejs/core/issues/9950)) ([10ccb9b](https://github.com/vuejs/core/commit/10ccb9bfa0f5f3016207fc32b9611bab98e6f090))
+* **runtime-core:** correctly assign suspenseId to avoid conflicts with the default id ([#9966](https://github.com/vuejs/core/issues/9966)) ([0648804](https://github.com/vuejs/core/commit/06488047c184dae3070d0008379716690edceb46)), closes [#9944](https://github.com/vuejs/core/issues/9944)
+* **ssr:** avoid rendering transition-group slot content as a fragment ([#9961](https://github.com/vuejs/core/issues/9961)) ([0160264](https://github.com/vuejs/core/commit/0160264d677478ee928e8e851f39a9e94f97e337)), closes [#9933](https://github.com/vuejs/core/issues/9933)
+* **watch:** remove instance unmounted short circuit in getter of `watchEffect` ([#9948](https://github.com/vuejs/core/issues/9948)) ([f300a40](https://github.com/vuejs/core/commit/f300a4001ec40cadef2520267eb5841ab48cf005))
+* **watch:** revert watch behavior when watching shallow reactive objects ([a9f781a](https://github.com/vuejs/core/commit/a9f781a92cbc7de7b25c9e3d5b1295ca99eb6d86)), closes [#9965](https://github.com/vuejs/core/issues/9965)
+### Performance Improvements
-# [3.3.0-alpha.13](https://github.com/vuejs/core/compare/v3.3.0-alpha.12...v3.3.0-alpha.13) (2023-04-20)
+* **watch:** avoid double traverse for reactive source ([24d77c2](https://github.com/vuejs/core/commit/24d77c25ce5d5356adb5367beef1d23e6e340b35))
-### Bug Fixes
-* **compiler-sfc:** handle type merging + fix namespace access when inferring type ([d53e157](https://github.com/vuejs/core/commit/d53e157805678db7a3b9ca2fccc74530e1dfbc48)), closes [#8102](https://github.com/vuejs/core/issues/8102)
-* **compiler-sfc:** normalize filename when invalidating cache ([9b5a34b](https://github.com/vuejs/core/commit/9b5a34bf8c0d1b4c6ec3cf1434076b7e25065f84))
-* **hmr:** always traverse static children in dev ([f17a82c](https://github.com/vuejs/core/commit/f17a82c769cfb60ee6785ef5d34d91191d153542)), closes [#7921](https://github.com/vuejs/core/issues/7921) [#8100](https://github.com/vuejs/core/issues/8100)
-* **hmr:** force update cached slots during HMR ([94fa67a](https://github.com/vuejs/core/commit/94fa67a4f73b3646c8c1e29512a71b17bd56efc3)), closes [#7155](https://github.com/vuejs/core/issues/7155) [#7158](https://github.com/vuejs/core/issues/7158)
+## [3.4.3](https://github.com/vuejs/core/compare/v3.4.2...v3.4.3) (2023-12-30)
-### Features
+### Bug Fixes
-* **compiler-sfc:** support dynamic imports when resolving types ([4496456](https://github.com/vuejs/core/commit/4496456d7d9947560ef1e35ccb176b97a27bd8f4))
-* **compiler-sfc:** support export * when resolving types ([7c3ca3c](https://github.com/vuejs/core/commit/7c3ca3cc3e122fe273e80a950c57d492a7f0bf4a))
-* **compiler-sfc:** support ExtractPropTypes when resolving types ([50c0bbe](https://github.com/vuejs/core/commit/50c0bbe5221dbc1dc353d4960e69ec7c8ba12905)), closes [#8104](https://github.com/vuejs/core/issues/8104)
-* hasInjectionContext() for libraries ([#8111](https://github.com/vuejs/core/issues/8111)) ([5510ce3](https://github.com/vuejs/core/commit/5510ce385abfa151c07a5253cccf4abccabdd01d))
+* **compiler-sfc:** respect sfc parse options in cache key ([b8d58ec](https://github.com/vuejs/core/commit/b8d58ec4f42cbeb9443bf06138add46158db9af0))
-# [3.3.0-alpha.12](https://github.com/vuejs/core/compare/v3.3.0-alpha.11...v3.3.0-alpha.12) (2023-04-18)
+## [3.4.2](https://github.com/vuejs/core/compare/v3.4.1...v3.4.2) (2023-12-30)
### Bug Fixes
-* **compiler:** fix expression codegen for literal const bindings in non-inline mode ([0f77a2b](https://github.com/vuejs/core/commit/0f77a2b1d1047d66ccdfda70382d1a223886130c))
+* **compiler-sfc:** fix dev regression for dot / namespace component usage ([dce99c1](https://github.com/vuejs/core/commit/dce99c12df981ca45a4d848c37ba8b16496025f0)), closes [#9947](https://github.com/vuejs/core/issues/9947)
+* **runtime-core:** support deep: false when watch reactive ([#9928](https://github.com/vuejs/core/issues/9928)) ([4f703d1](https://github.com/vuejs/core/commit/4f703d120d76d711084346f73ea295c73e6ef6b6)), closes [#9916](https://github.com/vuejs/core/issues/9916)
+* **ssr:** fix hydration error for slot outlet inside transition-group ([#9937](https://github.com/vuejs/core/issues/9937)) ([6cb00ed](https://github.com/vuejs/core/commit/6cb00ed0f9b64428ec18fada0f68467d6a813fde)), closes [#9933](https://github.com/vuejs/core/issues/9933)
-# [3.3.0-alpha.11](https://github.com/vuejs/core/compare/v3.3.0-alpha.10...v3.3.0-alpha.11) (2023-04-17)
+## [3.4.1](https://github.com/vuejs/core/compare/v3.4.0...v3.4.1) (2023-12-30)
### Bug Fixes
-* **compiler-sfc:** normalize windows paths when resolving types ([271df09](https://github.com/vuejs/core/commit/271df09470c61d073185ba6cf3cf50358713c500))
+* **compat:** correct enum value for COMPILER_FILTERS feature ([#9875](https://github.com/vuejs/core/issues/9875)) ([77d33e2](https://github.com/vuejs/core/commit/77d33e263cf19983caf4e5c53a0eb0bee374843c))
+* **defineModel:** always default modifiers to empty object ([9bc3c7e](https://github.com/vuejs/core/commit/9bc3c7e29cf15f5ca96703542d10cfd786a3fc55)), closes [#9945](https://github.com/vuejs/core/issues/9945)
+* **defineModel:** support local mutation when only prop but no listener is passed ([97ce041](https://github.com/vuejs/core/commit/97ce041910b6ca4bef10f939493d6b5a06ea5b07))
+* **types:** fix defineModel watch type error ([#9942](https://github.com/vuejs/core/issues/9942)) ([4af8583](https://github.com/vuejs/core/commit/4af85835f7e593a7dffa7dc7e99f14877eb70fd1)), closes [#9939](https://github.com/vuejs/core/issues/9939)
+### Features
-# [3.3.0-alpha.10](https://github.com/vuejs/core/compare/v3.3.0-alpha.9...v3.3.0-alpha.10) (2023-04-17)
+* **compiler-sfc:** support passing template parsing options when parsing sfc ([6fab855](https://github.com/vuejs/core/commit/6fab8551e4aeef4610987640de8b435b1ae321bb)) (necessary to fix https://github.com/vitejs/vite-plugin-vue/issues/322)
-### Bug Fixes
-* **hmr:** invalidate cached props/emits options on hmr ([4b5b384](https://github.com/vuejs/core/commit/4b5b384485cf8f6124f6738b89e3d047358f3a11))
-* **runtime-core:** properly merge props and emits options from mixins ([#8052](https://github.com/vuejs/core/issues/8052)) ([c94ef02](https://github.com/vuejs/core/commit/c94ef02421d7422bc59d10cf2eee9f4e7dcea6c8)), closes [#7989](https://github.com/vuejs/core/issues/7989)
+# [3.4.0 Slam Dunk](https://github.com/vuejs/core/compare/v3.4.0-rc.3...v3.4.0) (2023-12-29)
+
+> Read [this blog post](https://blog.vuejs.org/posts/vue-3-4) for an overview of the release highlights.
+
+### Potential Actions Needed
+
+1. To fully leverage new features in 3.4, it is recommended to also update the following dependencies when upgrading to 3.4:
+
+ - Volar / vue-tsc@^1.8.27 (**required**)
+ - @vitejs/plugin-vue@^5.0.0 (if using Vite)
+ - nuxt@^3.9.0 (if using Nuxt)
+ - vue-loader@^17.4.0 (if using webpack or vue-cli)
+
+2. If using TSX with Vue, check actions needed in [Removed: Global JSX Namespace](https://blog.vuejs.org/posts/vue-3-4#global-jsx-namespace).
+3. Make sure you are no longer using any deprecated features (if you are, you should have warnings in the console telling you so). They may have been [removed in 3.4](https://blog.vuejs.org/posts/vue-3-4#other-removed-features).
### Features
-* **compiler-sfc:** expose type import deps on compiled script block ([8d8ddd6](https://github.com/vuejs/core/commit/8d8ddd686c832b2ea29b87ef47666b13c4ad5d4c))
-* **compiler-sfc:** expose type resolve APIs ([f22e32e](https://github.com/vuejs/core/commit/f22e32e365bf6292cb606cb7289609e82da8b790))
-* **compiler-sfc:** mark props destructure as experimental and require explicit opt-in ([6b13e04](https://github.com/vuejs/core/commit/6b13e04b4c83fcdbb180dc1d59f536a1309c2960))
-* **compiler-sfc:** support intersection and union types in macros ([d1f973b](https://github.com/vuejs/core/commit/d1f973bff82581fb335d6fc05623d1ad3d84fb7c)), closes [#7553](https://github.com/vuejs/core/issues/7553)
-* **compiler-sfc:** support limited built-in utility types in macros ([1cfab4c](https://github.com/vuejs/core/commit/1cfab4c695b0c28f549f8c97faee5099581792a7))
-* **compiler-sfc:** support mapped types, string types & template type in macros ([fb8ecc8](https://github.com/vuejs/core/commit/fb8ecc803e58bfef0971346c63fefc529812daa7))
-* **compiler-sfc:** support namespace members type in macros ([5ff40bb](https://github.com/vuejs/core/commit/5ff40bb0dc2918b7db15fe9f49db2a135a925572))
-* **compiler-sfc:** support relative imported types in macros ([8aa4ea8](https://github.com/vuejs/core/commit/8aa4ea81d6e4d3110aa1619cca594543da4c9b63))
-* **compiler-sfc:** support resolving type imports from modules ([3982bef](https://github.com/vuejs/core/commit/3982bef533b451d1b59fa243560184a13fe8c18c))
-* **compiler-sfc:** support specifying global types for sfc macros ([4e028b9](https://github.com/vuejs/core/commit/4e028b966991937c83fb2529973fd3d41080bb61)), closes [/github.com/vuejs/core/pull/8083#issuecomment-1508468713](https://github.com//github.com/vuejs/core/pull/8083/issues/issuecomment-1508468713)
-* **compiler-sfc:** support string indexed type in macros ([3f779dd](https://github.com/vuejs/core/commit/3f779ddbf85054c8915fa4537f8a79baab392d5c))
-* **compiler-sfc:** support string/number indexed types in macros ([760755f](https://github.com/vuejs/core/commit/760755f4f83680bee13ad546cdab2e48ade38dff))
+* **general:** MathML support ([#7836](https://github.com/vuejs/core/issues/7836)) ([d42b6ba](https://github.com/vuejs/core/commit/d42b6ba3f530746eb1221eb7a4be0f44eb56f7d3)), closes [#7820](https://github.com/vuejs/core/issues/7820)
+* **reactivity:** more efficient reactivity system ([#5912](https://github.com/vuejs/core/issues/5912)) ([16e06ca](https://github.com/vuejs/core/commit/16e06ca08f5a1e2af3fc7fb35de153dbe0c3087d)), closes [#311](https://github.com/vuejs/core/issues/311) [#1811](https://github.com/vuejs/core/issues/1811) [#6018](https://github.com/vuejs/core/issues/6018) [#7160](https://github.com/vuejs/core/issues/7160) [#8714](https://github.com/vuejs/core/issues/8714) [#9149](https://github.com/vuejs/core/issues/9149) [#9419](https://github.com/vuejs/core/issues/9419) [#9464](https://github.com/vuejs/core/issues/9464)
+* **reactivity:** expose last result for computed getter ([#9497](https://github.com/vuejs/core/issues/9497)) ([48b47a1](https://github.com/vuejs/core/commit/48b47a1ab63577e2dbd91947eea544e3ef185b85))
+* **runtime-core / dx:** link errors to docs in prod build ([#9165](https://github.com/vuejs/core/issues/9165)) ([9f8ba98](https://github.com/vuejs/core/commit/9f8ba9821fe166f77e63fa940e9e7e13ec3344fa))
+* **runtime-core:** add `once` option to watch ([#9034](https://github.com/vuejs/core/issues/9034)) ([a645e7a](https://github.com/vuejs/core/commit/a645e7aa51006516ba668b3a4365d296eb92ee7d))
+* **runtime-core:** provide full props to props validator functions ([#3258](https://github.com/vuejs/core/issues/3258)) ([8e27692](https://github.com/vuejs/core/commit/8e27692029a4645cd54287f776c0420f2b82740b))
+* **compiler-core:** export error message ([#8729](https://github.com/vuejs/core/issues/8729)) ([f7e80ee](https://github.com/vuejs/core/commit/f7e80ee4a065a9eaba98720abf415d9e87756cbd))
+* **compiler-core:** support specifying root namespace when parsing ([40f72d5](https://github.com/vuejs/core/commit/40f72d5e50b389cb11b7ca13461aa2a75ddacdb4))
+* **compiler-core:** support v-bind shorthand for key and value with the same name ([#9451](https://github.com/vuejs/core/issues/9451)) ([26399aa](https://github.com/vuejs/core/commit/26399aa6fac1596b294ffeba06bb498d86f5508c))
+* **compiler-core:** improve parsing tolerance for language-tools ([41ff68e](https://github.com/vuejs/core/commit/41ff68ea579d933333392146625560359acb728a))
+* **compiler-core:** support accessing Error as global in template expressions ([#7018](https://github.com/vuejs/core/issues/7018)) ([bcca475](https://github.com/vuejs/core/commit/bcca475dbc58d76434cd8120b94929758cee2825))
+* **compiler-core:** lift vnode hooks deprecation warning to error ([8abc754](https://github.com/vuejs/core/commit/8abc754d5d86d9dfd5a7927b846f1a743f352364))
+* **compiler-core:** export runtime error strings ([#9301](https://github.com/vuejs/core/issues/9301)) ([feb2f2e](https://github.com/vuejs/core/commit/feb2f2edce2d91218a5e9a52c81e322e4033296b))
+* **compiler-core:** add current filename to TransformContext ([#8950](https://github.com/vuejs/core/issues/8950)) ([638f1ab](https://github.com/vuejs/core/commit/638f1abbb632000553e2b7d75e87c95d8ca192d6))
+* **compiler-sfc:** analyze import usage in template via AST ([#9729](https://github.com/vuejs/core/issues/9729)) ([e8bbc94](https://github.com/vuejs/core/commit/e8bbc946cba6bf74c9da56f938b67d2a04c340ba)), closes [#8897](https://github.com/vuejs/core/issues/8897) [nuxt/nuxt#22416](https://github.com/nuxt/nuxt/issues/22416)
+* **compiler-sfc:** expose resolve type-based props and emits ([#8874](https://github.com/vuejs/core/issues/8874)) ([9e77580](https://github.com/vuejs/core/commit/9e77580c0c2f0d977bd0031a1d43cc334769d433))
+* **compiler-sfc:** bump postcss-modules to v6 ([2a507e3](https://github.com/vuejs/core/commit/2a507e32f0e2ef73813705a568b8633f68bda7a9))
+* **compiler-sfc:** promote defineModel stable ([#9598](https://github.com/vuejs/core/issues/9598)) ([ef688ba](https://github.com/vuejs/core/commit/ef688ba92bfccbc8b7ea3997eb297665d13e5249))
+* **compiler-sfc:** support import attributes and `using` syntax ([#8786](https://github.com/vuejs/core/issues/8786)) ([5b2bd1d](https://github.com/vuejs/core/commit/5b2bd1df78e8ff524c3a184adaa284681aba6574))
+* **compiler-sfc:** `defineModel` support local mutation by default, remove local option ([f74785b](https://github.com/vuejs/core/commit/f74785bc4ad351102dde17fdfd2c7276b823111f)), closes [/github.com/vuejs/rfcs/discussions/503#discussioncomment-7566278](https://github.com//github.com/vuejs/rfcs/discussions/503/issues/discussioncomment-7566278)
+* **ssr:** add `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__` feature flag ([#9550](https://github.com/vuejs/core/issues/9550)) ([bc7698d](https://github.com/vuejs/core/commit/bc7698dbfed9b5327a93565f9df336ae5a94d605))
+* **ssr:** improve ssr hydration mismatch checks ([#5953](https://github.com/vuejs/core/issues/5953)) ([2ffc1e8](https://github.com/vuejs/core/commit/2ffc1e8cfdc6ec9c45c4a4dd8e3081b2aa138f1e)), closes [#5063](https://github.com/vuejs/core/issues/5063)
+* **types:** use enum to replace const enum ([#9261](https://github.com/vuejs/core/issues/9261)) ([fff7b86](https://github.com/vuejs/core/commit/fff7b864f4292d0430ba2bda7098ad43876b0210)), closes [#1228](https://github.com/vuejs/core/issues/1228)
+* **types:** add emits and slots type to `FunctionalComponent` ([#8644](https://github.com/vuejs/core/issues/8644)) ([927ab17](https://github.com/vuejs/core/commit/927ab17cfc645e82d061fdf227c34689491268e1))
+* **types:** export `AriaAttributes` type ([#8909](https://github.com/vuejs/core/issues/8909)) ([fd0b6ba](https://github.com/vuejs/core/commit/fd0b6ba01660499fa07b0cf360eefaac8cca8287))
+* **types:** export `ObjectPlugin` and `FunctionPlugin` types ([#8946](https://github.com/vuejs/core/issues/8946)) ([fa4969e](https://github.com/vuejs/core/commit/fa4969e7a3aefa6863203f9294fc5e769ddf6d8f)), closes [#8577](https://github.com/vuejs/core/issues/8577)
+* **types:** expose `DefineProps` type ([096ba81](https://github.com/vuejs/core/commit/096ba81817b7da15f61bc55fc1a93f72ac9586e0))
+* **types:** expose `PublicProps` type ([#2403](https://github.com/vuejs/core/issues/2403)) ([44135dc](https://github.com/vuejs/core/commit/44135dc95fb8fea26b84d1433839d28b8c21f708))
+* **types:** improve event type inference when using `h` with native elements ([#9756](https://github.com/vuejs/core/issues/9756)) ([a625376](https://github.com/vuejs/core/commit/a625376ac8901eea81bf3c66cb531f2157f073ef))
+* **types:** provide `ComponentInstance` type ([#5408](https://github.com/vuejs/core/issues/5408)) ([bfb8565](https://github.com/vuejs/core/commit/bfb856565d3105db4b18991ae9e404e7cc989b25))
+* **types:** support passing generics when registering global directives ([#9660](https://github.com/vuejs/core/issues/9660)) ([a41409e](https://github.com/vuejs/core/commit/a41409ed02a8c7220e637f56caf6813edeb077f8))
### Performance Improvements
-* **compiler:** use source-map-js ([19e17a9](https://github.com/vuejs/core/commit/19e17a951c3387cbd6a1597e6cd9048a4aad4528))
+* **compiler-sfc:** avoid sfc source map unnecessary serialization and parsing ([f15d2f6](https://github.com/vuejs/core/commit/f15d2f6cf69c0c39f8dfb5c33122790c68bf92e2))
+* **compiler-sfc:** remove magic-string trim on script ([e8e3ec6](https://github.com/vuejs/core/commit/e8e3ec6ca7392e43975c75b56eaaa711d5ea9410))
+* **compiler-sfc:** use faster source map addMapping ([50cde7c](https://github.com/vuejs/core/commit/50cde7cfbcc49022ba88f5f69fa9b930b483c282))
+* **compiler-core:** optimize away isBuiltInType ([66c0ed0](https://github.com/vuejs/core/commit/66c0ed0a3c1c6f37dafc6b1c52b75c6bf60e3136))
+* **compiler-core:** optimize position cloning ([2073236](https://github.com/vuejs/core/commit/20732366b9b3530d33b842cf1fc985919afb9317))
+* **codegen:** optimize line / column calculation during codegen ([3be53d9](https://github.com/vuejs/core/commit/3be53d9b974dae1a10eb795cade71ae765e17574))
+* **codegen:** optimize source map generation ([c11002f](https://github.com/vuejs/core/commit/c11002f16afd243a2b15b546816e73882eea9e4d))
+* **shared:** optimize makeMap ([ae6fba9](https://github.com/vuejs/core/commit/ae6fba94954bac6430902f77b0d1113a98a75b18))
+### BREAKING CHANGES
+
+#### Global JSX Registration Removed
+
+Starting in 3.4, Vue no longer registers the global `JSX` namespace by default. This is necessary to avoid global namespace collision with React so that TSX of both libs can co-exist in the same project. This should not affect SFC-only users with latest version of Volar.
+
+If you are using TSX, there are two options:
+
+1. Explicitly set [jsxImportSource](https://www.typescriptlang.org/tsconfig#jsxImportSource) to `'vue'` in `tsconfig.json` before upgrading to 3.4. You can also opt-in per file by adding a `/* @jsxImportSource vue */` comment at the top of the file.
+
+2. If you have code that depends on the presence of the global `JSX` namespace, e.g. usage of types like `JSX.Element` etc., you can retain the exact pre-3.4 global behavior by explicitly referencing `vue/jsx`, which registers the global `JSX` namespace.
+
+Note that this is a type-only breaking change in a minor release, which adheres to our [release policy](https://vuejs.org/about/releases.html#semantic-versioning-edge-cases).
+
+#### Deprecated Features Removed
-# [3.3.0-alpha.9](https://github.com/vuejs/core/compare/v3.3.0-alpha.8...v3.3.0-alpha.9) (2023-04-08)
+- [Reactivity Transform](https://vuejs.org/guide/extras/reactivity-transform.html) was marked deprecated in 3.3 and is now removed in 3.4. This change does not require a major due to the feature being experimental. Users who wish to continue using the feature can do so via the [Vue Macros plugin](https://vue-macros.dev/features/reactivity-transform.html).
+- `app.config.unwrapInjectedRef` has been removed. It was deprecated and enabled by default in 3.3. In 3.4 it is no longer possible to disable this behavior.
+- `@vnodeXXX` event listeners in templates are now a compiler error instead of a deprecation warning. Use `@vue:XXX` listeners instead.
+- `v-is` directive has been removed. It was deprecated in 3.3. Use the [`is` attribute with `vue:` prefix](https://vuejs.org/api/built-in-special-attributes.html#is) instead.
+
+# [3.4.0-rc.3](https://github.com/vuejs/core/compare/v3.4.0-rc.2...v3.4.0-rc.3) (2023-12-27)
### Bug Fixes
-* **compiler-sfc:** accept `StringLiteral` node in `defineEmit` tuple syntax ([#8041](https://github.com/vuejs/core/issues/8041)) ([3ccbea0](https://github.com/vuejs/core/commit/3ccbea08e09217b50a410d7b49ebb138e0c4c1e7)), closes [#8040](https://github.com/vuejs/core/issues/8040)
-* **compiler-sfc:** fix binding type for constants when hoistStatic is disabled ([#8029](https://github.com/vuejs/core/issues/8029)) ([f7f4624](https://github.com/vuejs/core/commit/f7f4624191bbdc09600dbb0eb048b947c3a4f761))
-* **compiler-sfc:** skip empty `defineOptions` and support TypeScript type assertions ([#8028](https://github.com/vuejs/core/issues/8028)) ([9557529](https://github.com/vuejs/core/commit/955752951e1d31b90d817bd20830fe3f89018771))
-* **compiler-ssr:** disable v-once transform in ssr vdom fallback branch ([05f94cf](https://github.com/vuejs/core/commit/05f94cf7b01dd05ed7d3170916a38b175d5df292)), closes [#7644](https://github.com/vuejs/core/issues/7644)
-* **types:** improve defineProps return type with generic arguments ([91a931a](https://github.com/vuejs/core/commit/91a931ae8707b8d43f10216e1ce8e18b12158f99))
-* **types:** more public type argument order fix ([af563bf](https://github.com/vuejs/core/commit/af563bf428200367b6f5bb7944f690c85d810202))
-* **types:** retain type parameters order for public types ([bdf557f](https://github.com/vuejs/core/commit/bdf557f6f233c039fff8007b1b16aec00c4e68aa))
+* also export runtime error strings in all cjs builds ([38706e4](https://github.com/vuejs/core/commit/38706e4a1e5e5380e7df910b2a784d0a9bc9db29))
### Features
-* **app:** app.runWithContext() ([#7451](https://github.com/vuejs/core/issues/7451)) ([869f3fb](https://github.com/vuejs/core/commit/869f3fb93e61400be4fd925e0850c2b1564749e2))
-* **sfc:** introduce `defineModel` macro and `useModel` helper ([#8018](https://github.com/vuejs/core/issues/8018)) ([14f3d74](https://github.com/vuejs/core/commit/14f3d747a34d45415b0036b274517d70a27ec0d3))
+* **defineModel:** support modifiers and transformers ([a772031](https://github.com/vuejs/core/commit/a772031ea8431bd732ffeaeaac09bd76a0daec9b))
-### Reverts
-* Revert "chore: remove unused args passed to ssrRender" ([b117b88](https://github.com/vuejs/core/commit/b117b8844881a732a021432066230ff2215049ea))
+# [3.4.0-rc.2](https://github.com/vuejs/core/compare/v3.4.0-rc.1...v3.4.0-rc.2) (2023-12-26)
+
+
+### Bug Fixes
+
+* **deps:** update dependency @vue/repl to ^3.1.0 ([#9911](https://github.com/vuejs/core/issues/9911)) ([f96c413](https://github.com/vuejs/core/commit/f96c413e8ef2f24cacda5bb499492922f62c6e8b))
+* **types:** fix distribution of union types when unwrapping setup bindings ([#9909](https://github.com/vuejs/core/issues/9909)) ([0695c69](https://github.com/vuejs/core/commit/0695c69e0dfaf99882a623fe75b433c9618ea648)), closes [#9903](https://github.com/vuejs/core/issues/9903)
+* **warning:** ensure prod hydration warnings actually work ([b4ebe7a](https://github.com/vuejs/core/commit/b4ebe7ae8b904f28cdda33caf87bc05718d3a08a))
+
+### Features
+
+* **compiler-sfc:** export aggregated error messages for compiler-core and compiler-dom ([25c726e](https://github.com/vuejs/core/commit/25c726eca81fc384b41fafbeba5e8dfcda1f030f))
-# [3.3.0-alpha.8](https://github.com/vuejs/core/compare/v3.3.0-alpha.7...v3.3.0-alpha.8) (2023-04-04)
+
+# [3.4.0-rc.1](https://github.com/vuejs/core/compare/v3.4.0-beta.4...v3.4.0-rc.1) (2023-12-25)
### Bug Fixes
-* **compiler-sfc:** check binding is prop before erroring ([f3145a9](https://github.com/vuejs/core/commit/f3145a915aaec11c915f1df258c5209ae4782bcc)), closes [#8017](https://github.com/vuejs/core/issues/8017)
+* **compiler-core:** fix parsing `',
+ { parseMode: 'sfc' },
+ )
+ const element = ast.children[0] as ElementNode
+ expect(element).toMatchObject({
+ type: NodeTypes.ELEMENT,
+ ns: Namespaces.HTML,
+ tag: 'script',
+ tagType: ElementTypes.ELEMENT,
+ codegenNode: undefined,
+ children: [],
+ innerLoc: {
+ start: { column: 67, line: 1, offset: 66 },
+ end: { column: 67, line: 1, offset: 66 },
+ },
+ props: [
+ {
+ loc: {
+ source: 'setup',
+ end: { column: 14, line: 1, offset: 13 },
+ start: { column: 9, line: 1, offset: 8 },
+ },
+ name: 'setup',
+ nameLoc: {
+ source: 'setup',
+ end: { column: 14, line: 1, offset: 13 },
+ start: { column: 9, line: 1, offset: 8 },
+ },
+ type: NodeTypes.ATTRIBUTE,
+ value: undefined,
+ },
+ {
+ loc: {
+ source: 'lang="ts"',
+ end: { column: 24, line: 1, offset: 23 },
+ start: { column: 15, line: 1, offset: 14 },
+ },
+ name: 'lang',
+ nameLoc: {
+ source: 'lang',
+ end: { column: 19, line: 1, offset: 18 },
+ start: { column: 15, line: 1, offset: 14 },
+ },
+ type: NodeTypes.ATTRIBUTE,
+ value: {
+ content: 'ts',
+ loc: {
+ source: '"ts"',
+ end: { column: 24, line: 1, offset: 23 },
+ start: { column: 20, line: 1, offset: 19 },
+ },
+ type: NodeTypes.TEXT,
+ },
+ },
+ {
+ loc: {
+ source: 'generic="T extends Record"',
+ end: { column: 66, line: 1, offset: 65 },
+ start: { column: 25, line: 1, offset: 24 },
+ },
+ name: 'generic',
+ nameLoc: {
+ source: 'generic',
+ end: { column: 32, line: 1, offset: 31 },
+ start: { column: 25, line: 1, offset: 24 },
+ },
+ type: NodeTypes.ATTRIBUTE,
+ value: {
+ content: 'T extends Record',
+ loc: {
+ source: '"T extends Record"',
+ end: { column: 66, line: 1, offset: 65 },
+ start: { column: 33, line: 1, offset: 32 },
+ },
+ type: NodeTypes.TEXT,
+ },
+ },
+ ],
})
})
@@ -944,76 +1081,95 @@ describe('compiler: parse', () => {
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 },
+ source: 'id',
+ },
value: {
type: NodeTypes.TEXT,
content: 'a',
loc: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 9, line: 1, column: 10 },
- source: 'a'
- }
+ source: 'a',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 9, line: 1, column: 10 },
- source: 'id=a'
- }
+ source: 'id=a',
+ },
},
{
type: NodeTypes.ATTRIBUTE,
name: 'class',
+ nameLoc: {
+ start: { offset: 10, line: 1, column: 11 },
+ end: { offset: 15, line: 1, column: 16 },
+ source: 'class',
+ },
value: {
type: NodeTypes.TEXT,
content: 'c',
loc: {
start: { offset: 16, line: 1, column: 17 },
end: { offset: 19, line: 1, column: 20 },
- source: '"c"'
- }
+ source: '"c"',
+ },
},
loc: {
start: { offset: 10, line: 1, column: 11 },
end: { offset: 19, line: 1, column: 20 },
- source: 'class="c"'
- }
+ source: 'class="c"',
+ },
},
{
type: NodeTypes.ATTRIBUTE,
name: 'inert',
+ nameLoc: {
+ start: { offset: 20, line: 1, column: 21 },
+ end: { offset: 25, line: 1, column: 26 },
+ source: 'inert',
+ },
value: undefined,
loc: {
start: { offset: 20, line: 1, column: 21 },
end: { offset: 25, line: 1, column: 26 },
- source: 'inert'
- }
+ source: 'inert',
+ },
},
{
type: NodeTypes.ATTRIBUTE,
name: 'style',
+ nameLoc: {
+ start: { offset: 26, line: 1, column: 27 },
+ end: { offset: 31, line: 1, column: 32 },
+ source: 'style',
+ },
value: {
type: NodeTypes.TEXT,
content: '',
loc: {
start: { offset: 32, line: 1, column: 33 },
end: { offset: 34, line: 1, column: 35 },
- source: "''"
- }
+ source: "''",
+ },
},
loc: {
start: { offset: 26, line: 1, column: 27 },
end: { offset: 34, line: 1, column: 35 },
- source: "style=''"
- }
- }
+ source: "style=''",
+ },
+ },
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
end: { offset: 41, line: 1, column: 42 },
- source: '
'
- }
+ source: '
',
+ },
})
})
@@ -1025,60 +1181,40 @@ describe('compiler: parse', () => {
expect(element).toStrictEqual({
children: [],
codegenNode: undefined,
- isSelfClosing: false,
loc: {
- end: {
- column: 10,
- line: 3,
- offset: 29
- },
+ start: { column: 1, line: 1, offset: 0 },
+ end: { column: 10, line: 3, offset: 29 },
source: '
',
- start: {
- column: 1,
- line: 1,
- offset: 0
- }
},
ns: Namespaces.HTML,
props: [
{
- loc: {
- end: {
- column: 3,
- line: 3,
- offset: 22
- },
- source: 'class=" \n\t c \t\n "',
- start: {
- column: 6,
- line: 1,
- offset: 5
- }
- },
name: 'class',
+ nameLoc: {
+ start: { column: 6, line: 1, offset: 5 },
+ end: { column: 11, line: 1, offset: 10 },
+ source: 'class',
+ },
type: NodeTypes.ATTRIBUTE,
value: {
content: 'c',
loc: {
- end: {
- column: 3,
- line: 3,
- offset: 22
- },
+ start: { column: 12, line: 1, offset: 11 },
+ end: { column: 3, line: 3, offset: 22 },
source: '" \n\t c \t\n "',
- start: {
- column: 12,
- line: 1,
- offset: 11
- }
},
- type: NodeTypes.TEXT
- }
- }
- ],
- tag: 'div',
+ type: NodeTypes.TEXT,
+ },
+ loc: {
+ start: { column: 6, line: 1, offset: 5 },
+ end: { column: 3, line: 3, offset: 22 },
+ source: 'class=" \n\t c \t\n "',
+ },
+ },
+ ],
+ tag: 'div',
tagType: ElementTypes.ELEMENT,
- type: NodeTypes.ELEMENT
+ type: NodeTypes.ELEMENT,
})
})
@@ -1089,14 +1225,15 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'if',
+ rawName: 'v-if',
arg: undefined,
modifiers: [],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 9, line: 1, column: 10 },
- source: 'v-if'
- }
+ source: 'v-if',
+ },
})
})
@@ -1107,6 +1244,7 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'if',
+ rawName: 'v-if',
arg: undefined,
modifiers: [],
exp: {
@@ -1117,14 +1255,14 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 11, line: 1, column: 12 },
end: { offset: 12, line: 1, column: 13 },
- source: 'a'
- }
+ source: 'a',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 13, line: 1, column: 14 },
- source: 'v-if="a"'
- }
+ source: 'v-if="a"',
+ },
})
})
@@ -1135,33 +1273,25 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:click',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'click',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 },
source: 'click',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
- }
+ },
},
modifiers: [],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 15, line: 1, column: 16 },
- source: 'v-on:click'
- }
+ source: 'v-on:click',
+ },
})
})
@@ -1174,8 +1304,7 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 12, line: 1, column: 13 },
end: { offset: 16, line: 1, column: 17 },
- source: 'slot'
- }
+ },
})
})
@@ -1185,11 +1314,11 @@ describe('compiler: parse', () => {
const directive = (ast.children[0] as ElementNode)
.props[0] as DirectiveNode
expect(directive.arg).toMatchObject({
+ content: 'item.item',
loc: {
start: { offset: 6, line: 1, column: 7 },
end: { offset: 15, line: 1, column: 16 },
- source: 'item.item'
- }
+ },
})
})
@@ -1200,33 +1329,25 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:[event]',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'event',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 18, line: 1, offset: 17 },
source: '[event]',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 18,
- line: 1,
- offset: 17
- }
- }
+ },
},
modifiers: [],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 17, line: 1, column: 18 },
- source: 'v-on:[event]'
- }
+ source: 'v-on:[event]',
+ },
})
})
@@ -1237,14 +1358,15 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on.enter',
arg: undefined,
modifiers: ['enter'],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 15, line: 1, column: 16 },
- source: 'v-on.enter'
- }
+ source: 'v-on.enter',
+ },
})
})
@@ -1255,14 +1377,15 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on.enter.exact',
arg: undefined,
modifiers: ['enter', 'exact'],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 21, line: 1, column: 22 },
- source: 'v-on.enter.exact'
- }
+ source: 'v-on.enter.exact',
+ },
})
})
@@ -1273,33 +1396,25 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:click.enter.exact',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'click',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 },
source: 'click',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
- }
+ },
},
modifiers: ['enter', 'exact'],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 27, line: 1, column: 28 },
- source: 'v-on:click.enter.exact'
- }
+ source: 'v-on:click.enter.exact',
+ },
})
})
@@ -1310,41 +1425,34 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:[a.b].camel',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a.b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 },
source: '[a.b]',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
- }
+ },
},
modifiers: ['camel'],
exp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 21, line: 1, column: 22 },
- source: 'v-on:[a.b].camel'
- }
+ source: 'v-on:[a.b].camel',
+ },
})
})
+
test('directive with no name', () => {
let errorCode = -1
const ast = baseParse('
', {
onError: err => {
errorCode = err.code as number
- }
+ },
})
const directive = (ast.children[0] as ElementNode).props[0]
@@ -1356,8 +1464,13 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 7, line: 1, column: 8 },
- source: 'v-'
- }
+ source: 'v-',
+ },
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 },
+ source: 'v-',
+ },
})
})
@@ -1368,25 +1481,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: ':a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 },
source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
- }
+ },
},
modifiers: [],
exp: {
@@ -1394,18 +1499,17 @@ describe('compiler: parse', () => {
content: 'b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 9, line: 1, column: 10 },
- source: 'b'
- }
+ source: 'b',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 9, line: 1, column: 10 },
- source: ':a=b'
- }
+ source: ':a=b',
+ },
})
})
@@ -1416,25 +1520,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: '.a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 },
source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
- }
+ },
},
modifiers: ['prop'],
exp: {
@@ -1442,18 +1538,17 @@ describe('compiler: parse', () => {
content: 'b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 9, line: 1, column: 10 },
- source: 'b'
- }
+ source: 'b',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 9, line: 1, column: 10 },
- source: '.a=b'
- }
+ source: '.a=b',
+ },
})
})
@@ -1464,25 +1559,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: ':a.sync',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 },
source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
- }
+ },
},
modifiers: ['sync'],
exp: {
@@ -1494,14 +1581,14 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 13, line: 1, column: 14 },
end: { offset: 14, line: 1, column: 15 },
- source: 'b'
- }
+ source: 'b',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 14, line: 1, column: 15 },
- source: ':a.sync=b'
- }
+ source: ':a.sync=b',
+ },
})
})
@@ -1512,25 +1599,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: '@a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 },
source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
- }
+ },
},
modifiers: [],
exp: {
@@ -1542,14 +1621,14 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 9, line: 1, column: 10 },
- source: 'b'
- }
+ source: 'b',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 9, line: 1, column: 10 },
- source: '@a=b'
- }
+ source: '@a=b',
+ },
})
})
@@ -1560,25 +1639,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: '@a.enter',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 },
source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
- }
+ },
},
modifiers: ['enter'],
exp: {
@@ -1590,14 +1661,14 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 14, line: 1, column: 15 },
end: { offset: 15, line: 1, column: 16 },
- source: 'b'
- }
+ source: 'b',
+ },
},
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 15, line: 1, column: 16 },
- source: '@a.enter=b'
- }
+ source: '@a.enter=b',
+ },
})
})
@@ -1608,24 +1679,17 @@ describe('compiler: parse', () => {
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'slot',
+ rawName: '#a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
loc: {
+ start: { column: 8, line: 1, offset: 7 },
+ end: { column: 9, line: 1, offset: 8 },
source: 'a',
- start: {
- column: 8,
- line: 1,
- offset: 7
- },
- end: {
- column: 9,
- line: 1,
- offset: 8
- }
- }
+ },
},
modifiers: [],
exp: {
@@ -1637,14 +1701,14 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 10, line: 1, column: 11 },
end: { offset: 15, line: 1, column: 16 },
- source: '{ b }'
- }
+ source: '{ b }',
+ },
},
loc: {
start: { offset: 6, line: 1, column: 7 },
end: { offset: 16, line: 1, column: 17 },
- source: '#a="{ b }"'
- }
+ source: '#a="{ b }"',
+ },
})
})
@@ -1656,32 +1720,32 @@ describe('compiler: parse', () => {
expect(directive).toMatchObject({
type: NodeTypes.DIRECTIVE,
name: 'slot',
+ rawName: 'v-slot:foo.bar',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo.bar',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
loc: {
- source: 'foo.bar',
start: {
column: 14,
line: 1,
- offset: 13
+ offset: 13,
},
end: {
column: 21,
line: 1,
- offset: 20
- }
- }
- }
+ offset: 20,
+ },
+ },
+ },
})
})
test('v-pre', () => {
const ast = baseParse(
` {{ bar }}
\n` +
- ` {{ bar }}
`
+ ` {{ bar }}
`,
)
const divWithPre = ast.children[0] as ElementNode
@@ -1691,29 +1755,22 @@ describe('compiler: parse', () => {
name: `:id`,
value: {
type: NodeTypes.TEXT,
- content: `foo`
+ content: `foo`,
},
loc: {
- source: `:id="foo"`,
- start: {
- line: 1,
- column: 12
- },
- end: {
- line: 1,
- column: 21
- }
- }
- }
+ start: { line: 1, column: 12 },
+ end: { line: 1, column: 21 },
+ },
+ },
])
expect(divWithPre.children[0]).toMatchObject({
type: NodeTypes.ELEMENT,
tagType: ElementTypes.ELEMENT,
- tag: `Comp`
+ tag: `Comp`,
})
expect(divWithPre.children[1]).toMatchObject({
type: NodeTypes.TEXT,
- content: `{{ bar }}`
+ content: `{{ bar }}`,
})
// should not affect siblings after it
@@ -1725,44 +1782,72 @@ describe('compiler: parse', () => {
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
isStatic: true,
- content: `id`
+ content: `id`,
},
exp: {
type: NodeTypes.SIMPLE_EXPRESSION,
isStatic: false,
- content: `foo`
+ content: `foo`,
},
loc: {
- source: `:id="foo"`,
start: {
line: 2,
- column: 6
+ column: 6,
},
end: {
line: 2,
- column: 15
- }
- }
- }
+ column: 15,
+ },
+ },
+ },
])
expect(divWithoutPre.children[0]).toMatchObject({
type: NodeTypes.ELEMENT,
tagType: ElementTypes.COMPONENT,
- tag: `Comp`
+ tag: `Comp`,
})
expect(divWithoutPre.children[1]).toMatchObject({
type: NodeTypes.INTERPOLATION,
content: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `bar`,
- isStatic: false
- }
+ isStatic: false,
+ },
})
})
+ // https://github.com/vuejs/docs/issues/2586
+ test('v-pre with half-open interpolation', () => {
+ const ast = baseParse(
+ `
+ {{ number
+ }}
+
+ `,
+ )
+ expect((ast.children[0] as ElementNode).children).toMatchObject([
+ {
+ type: NodeTypes.ELEMENT,
+ children: [{ type: NodeTypes.TEXT, content: `{{ number ` }],
+ },
+ {
+ type: NodeTypes.ELEMENT,
+ children: [{ type: NodeTypes.TEXT, content: `}}` }],
+ },
+ ])
+
+ const ast2 = baseParse(`{{ number
`)
+ expect((ast2.children[0] as ElementNode).children).toMatchObject([
+ {
+ type: NodeTypes.ELEMENT,
+ children: [{ type: NodeTypes.TEXT, content: `{{ number ` }],
+ },
+ ])
+ })
+
test('self-closing v-pre', () => {
const ast = baseParse(
- `
\n {{ bar }}
`
+ `
\n {{ bar }}
`,
)
// should not affect siblings after it
const divWithoutPre = ast.children[1] as ElementNode
@@ -1773,38 +1858,37 @@ describe('compiler: parse', () => {
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
isStatic: true,
- content: `id`
+ content: `id`,
},
exp: {
type: NodeTypes.SIMPLE_EXPRESSION,
isStatic: false,
- content: `foo`
+ content: `foo`,
},
loc: {
- source: `:id="foo"`,
start: {
line: 2,
- column: 6
+ column: 6,
},
end: {
line: 2,
- column: 15
- }
- }
- }
+ column: 15,
+ },
+ },
+ },
])
expect(divWithoutPre.children[0]).toMatchObject({
type: NodeTypes.ELEMENT,
tagType: ElementTypes.COMPONENT,
- tag: `Comp`
+ tag: `Comp`,
})
expect(divWithoutPre.children[1]).toMatchObject({
type: NodeTypes.INTERPOLATION,
content: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `bar`,
- isStatic: false
- }
+ isStatic: false,
+ },
})
})
@@ -1819,133 +1903,177 @@ describe('compiler: parse', () => {
loc: {
start: { offset: 5, line: 1, column: 6 },
end: { offset: 10, line: 1, column: 11 },
- source: 'hello'
- }
+ source: 'hello',
+ },
})
})
})
- test('self closing single tag', () => {
- const ast = baseParse('
')
+ describe('Edge Cases', () => {
+ test('self closing single tag', () => {
+ const ast = baseParse('
')
- expect(ast.children).toHaveLength(1)
- expect(ast.children[0]).toMatchObject({ tag: 'div' })
- })
+ expect(ast.children).toHaveLength(1)
+ expect(ast.children[0]).toMatchObject({ tag: 'div' })
+ })
- test('self closing multiple tag', () => {
- const ast = baseParse(
- `
\n` +
- `
`
- )
+ test('self closing multiple tag', () => {
+ const ast = baseParse(
+ `
\n` +
+ `
`,
+ )
- expect(ast).toMatchSnapshot()
+ expect(ast).toMatchSnapshot()
- expect(ast.children).toHaveLength(2)
- expect(ast.children[0]).toMatchObject({ tag: 'div' })
- expect(ast.children[1]).toMatchObject({ tag: 'p' })
- })
+ expect(ast.children).toHaveLength(2)
+ expect(ast.children[0]).toMatchObject({ tag: 'div' })
+ expect(ast.children[1]).toMatchObject({ tag: 'p' })
+ })
- test('valid html', () => {
- const ast = baseParse(
- `\n` +
- `
\n` +
- ` \n` +
- `
`
- )
+ test('valid html', () => {
+ const ast = baseParse(
+ `\n` +
+ `
\n` +
+ ` \n` +
+ `
`,
+ )
- expect(ast).toMatchSnapshot()
+ expect(ast).toMatchSnapshot()
- expect(ast.children).toHaveLength(1)
- const el = ast.children[0] as any
- expect(el).toMatchObject({
- tag: 'div'
- })
- expect(el.children).toHaveLength(2)
- expect(el.children[0]).toMatchObject({
- tag: 'p'
- })
- expect(el.children[1]).toMatchObject({
- type: NodeTypes.COMMENT
+ expect(ast.children).toHaveLength(1)
+ const el = ast.children[0] as any
+ expect(el).toMatchObject({
+ tag: 'div',
+ })
+ expect(el.children).toHaveLength(2)
+ expect(el.children[0]).toMatchObject({
+ tag: 'p',
+ })
+ expect(el.children[1]).toMatchObject({
+ type: NodeTypes.COMMENT,
+ })
})
- })
- test('invalid html', () => {
- expect(() => {
- baseParse(`\n\n
\n`)
- }).toThrow('Element is missing end tag.')
+ test('invalid html', () => {
+ expect(() => {
+ baseParse(`\n\n
\n`)
+ }).toThrow('Element is missing end tag.')
- const spy = vi.fn()
- const ast = baseParse(`\n\n
\n`, {
- onError: spy
- })
+ const spy = vi.fn()
+ const ast = baseParse(`\n\n
\n`, {
+ onError: spy,
+ })
- expect(spy.mock.calls).toMatchObject([
- [
- {
- code: ErrorCodes.X_MISSING_END_TAG,
- loc: {
- start: {
- offset: 6,
- line: 2,
- column: 1
- }
- }
- }
- ],
- [
+ expect(spy.mock.calls).toMatchObject([
+ [
+ {
+ code: ErrorCodes.X_MISSING_END_TAG,
+ loc: {
+ start: {
+ offset: 6,
+ line: 2,
+ column: 1,
+ },
+ },
+ },
+ ],
+ [
+ {
+ code: ErrorCodes.X_INVALID_END_TAG,
+ loc: {
+ start: {
+ offset: 20,
+ line: 4,
+ column: 1,
+ },
+ },
+ },
+ ],
+ ])
+
+ expect(ast).toMatchSnapshot()
+ })
+
+ test('parse with correct location info', () => {
+ const fooSrc = `foo\n is `
+ const barSrc = `{{ bar }}`
+ const butSrc = ` but `
+ const bazSrc = `{{ baz }}`
+ const [foo, bar, but, baz] = baseParse(
+ fooSrc + barSrc + butSrc + bazSrc,
+ ).children
+
+ let offset = 0
+ expect(foo.loc.start).toEqual({ line: 1, column: 1, offset })
+ offset += fooSrc.length
+ expect(foo.loc.end).toEqual({ line: 2, column: 5, offset })
+
+ expect(bar.loc.start).toEqual({ line: 2, column: 5, offset })
+ const barInner = (bar as InterpolationNode).content
+ offset += 3
+ expect(barInner.loc.start).toEqual({ line: 2, column: 8, offset })
+ offset += 3
+ expect(barInner.loc.end).toEqual({ line: 2, column: 11, offset })
+ offset += 3
+ expect(bar.loc.end).toEqual({ line: 2, column: 14, offset })
+
+ expect(but.loc.start).toEqual({ line: 2, column: 14, offset })
+ offset += butSrc.length
+ expect(but.loc.end).toEqual({ line: 2, column: 19, offset })
+
+ expect(baz.loc.start).toEqual({ line: 2, column: 19, offset })
+ const bazInner = (baz as InterpolationNode).content
+ offset += 3
+ expect(bazInner.loc.start).toEqual({ line: 2, column: 22, offset })
+ offset += 3
+ expect(bazInner.loc.end).toEqual({ line: 2, column: 25, offset })
+ offset += 3
+ expect(baz.loc.end).toEqual({ line: 2, column: 28, offset })
+ })
+
+ // With standard HTML parsing, the following input would ignore the slash
+ // and treat "<" and "template" as attributes on the open tag of "Hello",
+ // causing `` to fail to close, and ``,
{
- code: ErrorCodes.X_INVALID_END_TAG,
- loc: {
- start: {
- offset: 20,
- line: 4,
- column: 1
- }
- }
- }
- ]
- ])
+ onError: spy,
+ },
+ )
+ //
+ expect(ast.children.length).toBe(2)
+ expect(ast.children[1]).toMatchObject({
+ type: NodeTypes.ELEMENT,
+ tag: 'script',
+ })
+ })
- expect(ast).toMatchSnapshot()
- })
+ test('arg should be undefined on shorthand dirs with no arg', () => {
+ const ast = baseParse(` `)
+ const el = ast.children[0] as ElementNode
+ expect(el.props[0]).toMatchObject({
+ type: NodeTypes.DIRECTIVE,
+ name: 'slot',
+ exp: undefined,
+ arg: undefined,
+ })
+ })
- test('parse with correct location info', () => {
- const [foo, bar, but, baz] = baseParse(
- `
-foo
- is {{ bar }} but {{ baz }}`.trim()
- ).children
-
- let offset = 0
- expect(foo.loc.start).toEqual({ line: 1, column: 1, offset })
- offset += foo.loc.source.length
- expect(foo.loc.end).toEqual({ line: 2, column: 5, offset })
-
- expect(bar.loc.start).toEqual({ line: 2, column: 5, offset })
- const barInner = (bar as InterpolationNode).content
- offset += 3
- expect(barInner.loc.start).toEqual({ line: 2, column: 8, offset })
- offset += barInner.loc.source.length
- expect(barInner.loc.end).toEqual({ line: 2, column: 11, offset })
- offset += 3
- expect(bar.loc.end).toEqual({ line: 2, column: 14, offset })
-
- expect(but.loc.start).toEqual({ line: 2, column: 14, offset })
- offset += but.loc.source.length
- expect(but.loc.end).toEqual({ line: 2, column: 19, offset })
-
- expect(baz.loc.start).toEqual({ line: 2, column: 19, offset })
- const bazInner = (baz as InterpolationNode).content
- offset += 3
- expect(bazInner.loc.start).toEqual({ line: 2, column: 22, offset })
- offset += bazInner.loc.source.length
- expect(bazInner.loc.end).toEqual({ line: 2, column: 25, offset })
- offset += 3
- expect(baz.loc.end).toEqual({ line: 2, column: 28, offset })
+ // edge case found in vue-macros where the input is TS or JSX
+ test('should reset inRCDATA state', () => {
+ baseParse(``, { parseMode: 'sfc', onError() {} })
+ expect(() => baseParse(`{ foo }`)).not.toThrow()
+ })
})
describe('decodeEntities option', () => {
- test('use default map', () => {
+ test('use decode by default', () => {
const ast: any = baseParse('><&'"&foo;')
expect(ast.children.length).toBe(1)
@@ -1953,15 +2081,14 @@ foo
expect(ast.children[0].content).toBe('><&\'"&foo;')
})
- test('use the given map', () => {
- const ast: any = baseParse('&∪︀', {
+ test('should warn in non-browser build', () => {
+ baseParse('&∪︀', {
decodeEntities: text => text.replace('∪︀', '\u222A\uFE00'),
- onError: () => {} // Ignore errors
+ onError: () => {}, // Ignore errors
})
-
- expect(ast.children.length).toBe(1)
- expect(ast.children[0].type).toBe(NodeTypes.TEXT)
- expect(ast.children[0].content).toBe('&\u222A\uFE00')
+ expect(
+ `decodeEntities option is passed but will be ignored`,
+ ).toHaveBeenWarned()
})
})
@@ -1969,21 +2096,21 @@ foo
const parse = (content: string, options?: ParserOptions) =>
baseParse(content, {
whitespace: 'condense',
- ...options
+ ...options,
})
- it('should remove whitespaces at start/end inside an element', () => {
+ test('should remove whitespaces at start/end inside an element', () => {
const ast = parse(`
`)
expect((ast.children[0] as ElementNode).children.length).toBe(1)
})
- it('should remove whitespaces w/ newline between elements', () => {
+ test('should remove whitespaces w/ newline between elements', () => {
const ast = parse(`
\n
\n
`)
expect(ast.children.length).toBe(3)
expect(ast.children.every(c => c.type === NodeTypes.ELEMENT)).toBe(true)
})
- it('should remove whitespaces adjacent to comments', () => {
+ test('should remove whitespaces adjacent to comments', () => {
const ast = parse(`
\n
`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.ELEMENT)
@@ -1991,7 +2118,7 @@ foo
expect(ast.children[2].type).toBe(NodeTypes.ELEMENT)
})
- it('should remove whitespaces w/ newline between comments and elements', () => {
+ test('should remove whitespaces w/ newline between comments and elements', () => {
const ast = parse(`
\n \n
`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.ELEMENT)
@@ -1999,29 +2126,29 @@ foo
expect(ast.children[2].type).toBe(NodeTypes.ELEMENT)
})
- it('should NOT remove whitespaces w/ newline between interpolations', () => {
+ test('should NOT remove whitespaces w/ newline between interpolations', () => {
const ast = parse(`{{ foo }} \n {{ bar }}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.INTERPOLATION)
expect(ast.children[1]).toMatchObject({
type: NodeTypes.TEXT,
- content: ' '
+ content: ' ',
})
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- it('should NOT remove whitespaces w/ newline between interpolation and comment', () => {
+ test('should NOT remove whitespaces w/ newline between interpolation and comment', () => {
const ast = parse(` \n {{msg}}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.COMMENT)
expect(ast.children[1]).toMatchObject({
type: NodeTypes.TEXT,
- content: ' '
+ content: ' ',
})
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- it('should NOT remove whitespaces w/o newline between elements', () => {
+ test('should NOT remove whitespaces w/o newline between elements', () => {
const ast = parse(`
`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
@@ -2029,18 +2156,18 @@ foo
NodeTypes.TEXT,
NodeTypes.ELEMENT,
NodeTypes.TEXT,
- NodeTypes.ELEMENT
+ NodeTypes.ELEMENT,
])
})
- it('should condense consecutive whitespaces in text', () => {
+ test('should condense consecutive whitespaces in text', () => {
const ast = parse(` foo \n bar baz `)
expect((ast.children[0] as TextNode).content).toBe(` foo bar baz `)
})
- it('should remove leading newline character immediately following the pre element start tag', () => {
+ test('should remove leading newline character immediately following the pre element start tag', () => {
const ast = baseParse(`\n foo bar `, {
- isPreTag: tag => tag === 'pre'
+ isPreTag: tag => tag === 'pre',
})
expect(ast.children).toHaveLength(1)
const preElement = ast.children[0] as ElementNode
@@ -2048,30 +2175,29 @@ foo
expect((preElement.children[0] as TextNode).content).toBe(` foo bar `)
})
- it('should NOT remove leading newline character immediately following child-tag of pre element', () => {
+ test('should NOT remove leading newline character immediately following child-tag of pre element', () => {
const ast = baseParse(` \n foo bar `, {
- isPreTag: tag => tag === 'pre'
+ isPreTag: tag => tag === 'pre',
})
const preElement = ast.children[0] as ElementNode
expect(preElement.children).toHaveLength(2)
expect((preElement.children[1] as TextNode).content).toBe(
- `\n foo bar `
+ `\n foo bar `,
)
})
- it('self-closing pre tag', () => {
+ test('self-closing pre tag', () => {
const ast = baseParse(`\n foo bar `, {
- isPreTag: tag => tag === 'pre'
+ isPreTag: tag => tag === 'pre',
})
const elementAfterPre = ast.children[1] as ElementNode
// should not affect the and condense its whitespace inside
expect((elementAfterPre.children[0] as TextNode).content).toBe(` foo bar`)
})
- it('should NOT condense whitespaces in RCDATA text mode', () => {
+ test('should NOT condense whitespaces in RCDATA text mode', () => {
const ast = baseParse(``, {
- getTextMode: ({ tag }) =>
- tag === 'textarea' ? TextModes.RCDATA : TextModes.DATA
+ parseMode: 'html',
})
const preElement = ast.children[0] as ElementNode
expect(preElement.children).toHaveLength(1)
@@ -2083,15 +2209,15 @@ foo
const parse = (content: string, options?: ParserOptions) =>
baseParse(content, {
whitespace: 'preserve',
- ...options
+ ...options,
})
- it('should still remove whitespaces at start/end inside an element', () => {
+ test('should still remove whitespaces at start/end inside an element', () => {
const ast = parse(`
`)
expect((ast.children[0] as ElementNode).children.length).toBe(1)
})
- it('should preserve whitespaces w/ newline between elements', () => {
+ test('should preserve whitespaces w/ newline between elements', () => {
const ast = parse(`
\n
\n
`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
@@ -2099,11 +2225,11 @@ foo
NodeTypes.TEXT,
NodeTypes.ELEMENT,
NodeTypes.TEXT,
- NodeTypes.ELEMENT
+ NodeTypes.ELEMENT,
])
})
- it('should preserve whitespaces adjacent to comments', () => {
+ test('should preserve whitespaces adjacent to comments', () => {
const ast = parse(`
\n
`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
@@ -2111,11 +2237,11 @@ foo
NodeTypes.TEXT,
NodeTypes.COMMENT,
NodeTypes.TEXT,
- NodeTypes.ELEMENT
+ NodeTypes.ELEMENT,
])
})
- it('should preserve whitespaces w/ newline between comments and elements', () => {
+ test('should preserve whitespaces w/ newline between comments and elements', () => {
const ast = parse(`
\n \n
`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
@@ -2123,22 +2249,22 @@ foo
NodeTypes.TEXT,
NodeTypes.COMMENT,
NodeTypes.TEXT,
- NodeTypes.ELEMENT
+ NodeTypes.ELEMENT,
])
})
- it('should preserve whitespaces w/ newline between interpolations', () => {
+ test('should preserve whitespaces w/ newline between interpolations', () => {
const ast = parse(`{{ foo }} \n {{ bar }}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.INTERPOLATION)
expect(ast.children[1]).toMatchObject({
type: NodeTypes.TEXT,
- content: ' '
+ content: ' ',
})
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- it('should preserve whitespaces w/o newline between elements', () => {
+ test('should preserve whitespaces w/o newline between elements', () => {
const ast = parse(`
`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
@@ -2146,18 +2272,79 @@ foo
NodeTypes.TEXT,
NodeTypes.ELEMENT,
NodeTypes.TEXT,
- NodeTypes.ELEMENT
+ NodeTypes.ELEMENT,
])
})
- it('should preserve consecutive whitespaces in text', () => {
+ test('should preserve consecutive whitespaces in text', () => {
const content = ` foo \n bar baz `
const ast = parse(content)
expect((ast.children[0] as TextNode).content).toBe(content)
})
})
+ describe('expression parsing', () => {
+ test('interpolation', () => {
+ const ast = baseParse(`{{ a + b }}`, { prefixIdentifiers: true })
+ // @ts-expect-error
+ expect((ast.children[0] as InterpolationNode).content.ast?.type).toBe(
+ 'BinaryExpression',
+ )
+ })
+
+ test('v-bind', () => {
+ const ast = baseParse(`
`, {
+ prefixIdentifiers: true,
+ })
+ const dir = (ast.children[0] as ElementNode).props[0] as DirectiveNode
+ // @ts-expect-error
+ expect(dir.arg?.ast?.type).toBe('BinaryExpression')
+ // @ts-expect-error
+ expect(dir.exp?.ast?.type).toBe('CallExpression')
+ })
+
+ test('v-on multi statements', () => {
+ const ast = baseParse(`
`, {
+ prefixIdentifiers: true,
+ })
+ const dir = (ast.children[0] as ElementNode).props[0] as DirectiveNode
+ // @ts-expect-error
+ expect(dir.exp?.ast?.type).toBe('Program')
+ expect((dir.exp?.ast as Program).body).toMatchObject([
+ { type: 'ExpressionStatement' },
+ { type: 'ExpressionStatement' },
+ ])
+ })
+
+ test('v-slot', () => {
+ const ast = baseParse(` `, {
+ prefixIdentifiers: true,
+ })
+ const dir = (ast.children[0] as ElementNode).props[0] as DirectiveNode
+ // @ts-expect-error
+ expect(dir.exp?.ast?.type).toBe('ArrowFunctionExpression')
+ })
+
+ test('v-for', () => {
+ const ast = baseParse(`
`, {
+ prefixIdentifiers: true,
+ })
+ const dir = (ast.children[0] as ElementNode).props[0] as DirectiveNode
+ const { source, value, key, index } = dir.forParseResult!
+ // @ts-expect-error
+ expect(source.ast?.type).toBe('MemberExpression')
+ // @ts-expect-error
+ expect(value?.ast?.type).toBe('ArrowFunctionExpression')
+ expect(key?.ast).toBeNull() // simple ident
+ expect(index?.ast).toBeNull() // simple ident
+ })
+ })
+
describe('Errors', () => {
+ // HTML parsing errors as specified at
+ // https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
+ // We ignore some errors that do NOT affect parse result in meaningful ways
+ // but have non-trivial implementation cost.
const patterns: {
[key: string]: Array<{
code: string
@@ -2165,44 +2352,44 @@ foo
options?: Partial
}>
} = {
- ABRUPT_CLOSING_OF_EMPTY_COMMENT: [
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.ABRUPT_CLOSING_OF_EMPTY_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- },
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.ABRUPT_CLOSING_OF_EMPTY_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- },
- {
- code: ' ',
- errors: []
- }
- ],
+ // ABRUPT_CLOSING_OF_EMPTY_COMMENT: [
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.ABRUPT_CLOSING_OF_EMPTY_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.ABRUPT_CLOSING_OF_EMPTY_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: []
+ // }
+ // ],
CDATA_IN_HTML_CONTENT: [
{
code: ' ',
errors: [
{
type: ErrorCodes.CDATA_IN_HTML_CONTENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
+ loc: { offset: 10, line: 1, column: 11 },
+ },
+ ],
},
{
code: ' ',
- errors: []
- }
+ errors: [],
+ },
],
DUPLICATE_ATTRIBUTE: [
{
@@ -2210,60 +2397,60 @@ foo
errors: [
{
type: ErrorCodes.DUPLICATE_ATTRIBUTE,
- loc: { offset: 21, line: 1, column: 22 }
- }
- ]
- }
- ],
- END_TAG_WITH_ATTRIBUTES: [
- {
- code: '
',
- errors: [
- {
- type: ErrorCodes.END_TAG_WITH_ATTRIBUTES,
- loc: { offset: 21, line: 1, column: 22 }
- }
- ]
- }
- ],
- END_TAG_WITH_TRAILING_SOLIDUS: [
- {
- code: '
',
- errors: [
- {
- type: ErrorCodes.END_TAG_WITH_TRAILING_SOLIDUS,
- loc: { offset: 20, line: 1, column: 21 }
- }
- ]
- }
+ loc: { offset: 21, line: 1, column: 22 },
+ },
+ ],
+ },
],
+ // END_TAG_WITH_ATTRIBUTES: [
+ // {
+ // code: '
',
+ // errors: [
+ // {
+ // type: ErrorCodes.END_TAG_WITH_ATTRIBUTES,
+ // loc: { offset: 21, line: 1, column: 22 }
+ // }
+ // ]
+ // }
+ // ],
+ // END_TAG_WITH_TRAILING_SOLIDUS: [
+ // {
+ // code: '
',
+ // errors: [
+ // {
+ // type: ErrorCodes.END_TAG_WITH_TRAILING_SOLIDUS,
+ // loc: { offset: 20, line: 1, column: 21 }
+ // }
+ // ]
+ // }
+ // ],
EOF_BEFORE_TAG_NAME: [
{
code: '<',
errors: [
{
type: ErrorCodes.EOF_BEFORE_TAG_NAME,
- loc: { offset: 11, line: 1, column: 12 }
+ loc: { offset: 11, line: 1, column: 12 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
},
{
code: '',
errors: [
{
type: ErrorCodes.EOF_BEFORE_TAG_NAME,
- loc: { offset: 12, line: 1, column: 13 }
+ loc: { offset: 12, line: 1, column: 13 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
- }
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
+ },
],
EOF_IN_CDATA: [
{
@@ -2271,35 +2458,35 @@ foo
errors: [
{
type: ErrorCodes.EOF_IN_CDATA,
- loc: { offset: 29, line: 1, column: 30 }
+ loc: { offset: 29, line: 1, column: 30 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 10, line: 1, column: 11 }
+ loc: { offset: 10, line: 1, column: 11 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
},
{
code: ' ',
- errors: [
- {
- type: ErrorCodes.INCORRECTLY_CLOSED_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- }
- ],
- INCORRECTLY_OPENED_COMMENT: [
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- },
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- },
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
- },
- // Just ignore doctype.
- {
- code: '',
- errors: []
- }
- ],
- INVALID_FIRST_CHARACTER_OF_TAG_NAME: [
- {
- code: 'a < b ',
- errors: [
- {
- type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
- loc: { offset: 13, line: 1, column: 14 }
- }
- ]
- },
- {
- code: '<�> ',
- errors: [
- {
- type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
- loc: { offset: 11, line: 1, column: 12 }
- }
- ]
- },
- {
- code: 'a b ',
- errors: [
- {
- type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
- loc: { offset: 14, line: 1, column: 15 }
+ loc: { offset: 10, line: 1, column: 11 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
- },
- {
- code: '�> ',
- errors: [
- {
- type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
- loc: { offset: 12, line: 1, column: 13 }
- }
- ]
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
},
- // Don't throw invalid-first-character-of-tag-name in interpolation
- {
- code: '{{a < b}} ',
- errors: []
- }
],
+ // INCORRECTLY_CLOSED_COMMENT: [
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INCORRECTLY_CLOSED_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // }
+ // ],
+ // INCORRECTLY_OPENED_COMMENT: [
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INCORRECTLY_OPENED_COMMENT,
+ // loc: { offset: 10, line: 1, column: 11 }
+ // }
+ // ]
+ // },
+ // // Just ignore doctype.
+ // {
+ // code: '',
+ // errors: []
+ // }
+ // ],
+ // INVALID_FIRST_CHARACTER_OF_TAG_NAME: [
+ // {
+ // code: 'a < b ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
+ // loc: { offset: 13, line: 1, column: 14 }
+ // }
+ // ]
+ // },
+ // {
+ // code: '<�> ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
+ // loc: { offset: 11, line: 1, column: 12 }
+ // }
+ // ]
+ // },
+ // {
+ // code: 'a b ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
+ // loc: { offset: 14, line: 1, column: 15 }
+ // },
+ // {
+ // type: ErrorCodes.X_MISSING_END_TAG,
+ // loc: { offset: 0, line: 1, column: 1 }
+ // }
+ // ]
+ // },
+ // {
+ // code: '�> ',
+ // errors: [
+ // {
+ // type: ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME,
+ // loc: { offset: 12, line: 1, column: 13 }
+ // }
+ // ]
+ // },
+ // // Don't throw invalid-first-character-of-tag-name in interpolation
+ // {
+ // code: '{{a < b}} ',
+ // errors: []
+ // }
+ // ],
MISSING_ATTRIBUTE_VALUE: [
{
code: '
',
errors: [
{
type: ErrorCodes.MISSING_ATTRIBUTE_VALUE,
- loc: { offset: 18, line: 1, column: 19 }
- }
- ]
+ loc: { offset: 18, line: 1, column: 19 },
+ },
+ ],
},
{
code: '
',
errors: [
{
type: ErrorCodes.MISSING_ATTRIBUTE_VALUE,
- loc: { offset: 19, line: 1, column: 20 }
- }
- ]
+ loc: { offset: 19, line: 1, column: 20 },
+ },
+ ],
},
{
code: '
',
- errors: []
- }
+ errors: [],
+ },
],
MISSING_END_TAG_NAME: [
{
@@ -2764,106 +2903,106 @@ foo
errors: [
{
type: ErrorCodes.MISSING_END_TAG_NAME,
- loc: { offset: 12, line: 1, column: 13 }
- }
- ]
- }
- ],
- MISSING_WHITESPACE_BETWEEN_ATTRIBUTES: [
- {
- code: '
',
- errors: [
- {
- type: ErrorCodes.MISSING_WHITESPACE_BETWEEN_ATTRIBUTES,
- loc: { offset: 23, line: 1, column: 24 }
- }
- ]
- },
- // CR doesn't appear in tokenization phase, but all CR are removed in preprocessing.
- // https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream
- {
- code: '
',
- errors: []
- }
- ],
- NESTED_COMMENT: [
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.NESTED_COMMENT,
- loc: { offset: 15, line: 1, column: 16 }
- }
- ]
- },
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.NESTED_COMMENT,
- loc: { offset: 15, line: 1, column: 16 }
+ loc: { offset: 12, line: 1, column: 13 },
},
- {
- type: ErrorCodes.NESTED_COMMENT,
- loc: { offset: 20, line: 1, column: 21 }
- }
- ]
+ ],
},
- {
- code: ' ',
- errors: [
- {
- type: ErrorCodes.NESTED_COMMENT,
- loc: { offset: 15, line: 1, column: 16 }
- }
- ]
- },
- {
- code: ' ',
- errors: []
- },
- {
- code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.NESTED_COMMENT,
+ // loc: { offset: 15, line: 1, column: 16 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.NESTED_COMMENT,
+ // loc: { offset: 15, line: 1, column: 16 }
+ // },
+ // {
+ // type: ErrorCodes.NESTED_COMMENT,
+ // loc: { offset: 20, line: 1, column: 21 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: [
+ // {
+ // type: ErrorCodes.NESTED_COMMENT,
+ // loc: { offset: 15, line: 1, column: 16 }
+ // }
+ // ]
+ // },
+ // {
+ // code: ' ',
+ // errors: []
+ // },
+ // {
+ // code: '',
- errors: []
- }
+ errors: [],
+ },
],
X_MISSING_END_TAG: [
{
@@ -3000,23 +3152,23 @@ foo
errors: [
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 10, line: 1, column: 11 }
- }
- ]
+ loc: { offset: 10, line: 1, column: 11 },
+ },
+ ],
},
{
code: '',
errors: [
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 10, line: 1, column: 11 }
+ loc: { offset: 10, line: 1, column: 11 },
},
{
type: ErrorCodes.X_MISSING_END_TAG,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
- }
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
+ },
],
X_MISSING_INTERPOLATION_END: [
{
@@ -3024,23 +3176,36 @@ foo
errors: [
{
type: ErrorCodes.X_MISSING_INTERPOLATION_END,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
},
{
code: '{{',
errors: [
{
type: ErrorCodes.X_MISSING_INTERPOLATION_END,
- loc: { offset: 0, line: 1, column: 1 }
- }
- ]
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
+ },
+ {
+ code: '
{{ foo
',
+ errors: [
+ {
+ type: ErrorCodes.X_MISSING_INTERPOLATION_END,
+ loc: { offset: 5, line: 1, column: 6 },
+ },
+ {
+ type: ErrorCodes.X_MISSING_END_TAG,
+ loc: { offset: 0, line: 1, column: 1 },
+ },
+ ],
},
{
code: '{{}}',
- errors: []
- }
+ errors: [],
+ },
],
X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END: [
{
@@ -3048,11 +3213,11 @@ foo
errors: [
{
type: ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END,
- loc: { offset: 15, line: 1, column: 16 }
- }
- ]
- }
- ]
+ loc: { offset: 15, line: 1, column: 16 },
+ },
+ ],
+ },
+ ],
}
for (const key of Object.keys(patterns)) {
@@ -3061,41 +3226,26 @@ foo
test(
code.replace(
/[\r\n]/g,
- c => `\\x0${c.codePointAt(0)!.toString(16)};`
+ c => `\\x0${c.codePointAt(0)!.toString(16)};`,
),
() => {
const spy = vi.fn()
const ast = baseParse(code, {
- getNamespace: (tag, parent) => {
- const ns = parent ? parent.ns : Namespaces.HTML
- if (ns === Namespaces.HTML) {
- if (tag === 'svg') {
- return (Namespaces.HTML + 1) as any
- }
- }
- return ns
- },
- getTextMode: ({ tag }) => {
- if (tag === 'textarea') {
- return TextModes.RCDATA
- }
- if (tag === 'script') {
- return TextModes.RAWTEXT
- }
- return TextModes.DATA
- },
+ parseMode: 'html',
+ getNamespace: tag =>
+ tag === 'svg' ? Namespaces.SVG : Namespaces.HTML,
...options,
- onError: spy
+ onError: spy,
})
expect(
spy.mock.calls.map(([err]) => ({
type: err.code,
- loc: err.loc.start
- }))
+ loc: err.loc.start,
+ })),
).toMatchObject(errors)
expect(ast).toMatchSnapshot()
- }
+ },
)
}
})
diff --git a/packages/compiler-core/__tests__/scopeId.spec.ts b/packages/compiler-core/__tests__/scopeId.spec.ts
index 5f7ea0d2e6a..c7a21df7a78 100644
--- a/packages/compiler-core/__tests__/scopeId.spec.ts
+++ b/packages/compiler-core/__tests__/scopeId.spec.ts
@@ -1,5 +1,5 @@
import { baseCompile } from '../src/compile'
-import { PUSH_SCOPE_ID, POP_SCOPE_ID } from '../src/runtimeHelpers'
+import { POP_SCOPE_ID, PUSH_SCOPE_ID } from '../src/runtimeHelpers'
import { PatchFlags } from '@vue/shared'
import { genFlagText } from './testUtils'
@@ -18,7 +18,7 @@ describe('scopeId compiler support', () => {
test('should wrap default slot', () => {
const { code } = baseCompile(`
`, {
mode: 'module',
- scopeId: 'test'
+ scopeId: 'test',
})
expect(code).toMatch(`default: _withCtx(() => [`)
expect(code).toMatchSnapshot()
@@ -33,8 +33,8 @@ describe('scopeId compiler support', () => {
`,
{
mode: 'module',
- scopeId: 'test'
- }
+ scopeId: 'test',
+ },
)
expect(code).toMatch(`foo: _withCtx(({ msg }) => [`)
expect(code).toMatch(`bar: _withCtx(() => [`)
@@ -50,8 +50,8 @@ describe('scopeId compiler support', () => {
`,
{
mode: 'module',
- scopeId: 'test'
- }
+ scopeId: 'test',
+ },
)
expect(code).toMatch(/name: "foo",\s+fn: _withCtx\(/)
expect(code).toMatch(/name: i,\s+fn: _withCtx\(/)
@@ -64,8 +64,8 @@ describe('scopeId compiler support', () => {
{
mode: 'module',
scopeId: 'test',
- hoistStatic: true
- }
+ hoistStatic: true,
+ },
)
expect(ast.helpers).toContain(PUSH_SCOPE_ID)
expect(ast.helpers).toContain(POP_SCOPE_ID)
@@ -73,11 +73,11 @@ describe('scopeId compiler support', () => {
;[
`const _withScopeId = n => (_pushScopeId("test"),n=n(),_popScopeId(),n)`,
`const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("div", null, "hello", ${genFlagText(
- PatchFlags.HOISTED
+ PatchFlags.HOISTED,
)}))`,
`const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("div", null, "world", ${genFlagText(
- PatchFlags.HOISTED
- )}))`
+ PatchFlags.HOISTED,
+ )}))`,
].forEach(c => expect(code).toMatch(c))
expect(code).toMatchSnapshot()
})
diff --git a/packages/compiler-core/__tests__/testUtils.ts b/packages/compiler-core/__tests__/testUtils.ts
index 23a29a777e3..9618a482add 100644
--- a/packages/compiler-core/__tests__/testUtils.ts
+++ b/packages/compiler-core/__tests__/testUtils.ts
@@ -1,17 +1,17 @@
import {
+ type ElementNode,
+ ElementTypes,
+ Namespaces,
NodeTypes,
- ElementNode,
+ type VNodeCall,
locStub,
- Namespaces,
- ElementTypes,
- VNodeCall
} from '../src'
import {
- isString,
- PatchFlags,
PatchFlagNames,
+ type PatchFlags,
+ type ShapeFlags,
isArray,
- ShapeFlags
+ isString,
} from '@vue/shared'
const leadingBracketRE = /^\[/
@@ -30,16 +30,16 @@ export function createObjectMatcher(obj: Record
) {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: key.replace(bracketsRE, ''),
- isStatic: !leadingBracketRE.test(key)
+ isStatic: !leadingBracketRE.test(key),
},
value: isString(obj[key])
? {
type: NodeTypes.SIMPLE_EXPRESSION,
content: obj[key].replace(bracketsRE, ''),
- isStatic: !leadingBracketRE.test(obj[key])
+ isStatic: !leadingBracketRE.test(obj[key]),
}
- : obj[key]
- }))
+ : obj[key],
+ })),
}
}
@@ -48,7 +48,7 @@ export function createElementWithCodegen(
props?: VNodeCall['props'],
children?: VNodeCall['children'],
patchFlag?: VNodeCall['patchFlag'],
- dynamicProps?: VNodeCall['dynamicProps']
+ dynamicProps?: VNodeCall['dynamicProps'],
): ElementNode {
return {
type: NodeTypes.ELEMENT,
@@ -56,7 +56,6 @@ export function createElementWithCodegen(
ns: Namespaces.HTML,
tag: 'div',
tagType: ElementTypes.ELEMENT,
- isSelfClosing: false,
props: [],
children: [],
codegenNode: {
@@ -70,15 +69,15 @@ export function createElementWithCodegen(
isBlock: false,
disableTracking: false,
isComponent: false,
- loc: locStub
- }
+ loc: locStub,
+ },
}
}
type Flags = PatchFlags | ShapeFlags
export function genFlagText(
flag: Flags | Flags[],
- names: { [k: number]: string } = PatchFlagNames
+ names: { [k: number]: string } = PatchFlagNames,
) {
if (isArray(flag)) {
let f = 0
diff --git a/packages/compiler-core/__tests__/transform.spec.ts b/packages/compiler-core/__tests__/transform.spec.ts
index 915ae7a60cd..a56be51bc5c 100644
--- a/packages/compiler-core/__tests__/transform.spec.ts
+++ b/packages/compiler-core/__tests__/transform.spec.ts
@@ -1,19 +1,18 @@
-import { vi } from 'vitest'
-import { baseParse } from '../src/parse'
-import { transform, NodeTransform } from '../src/transform'
+import { baseParse } from '../src/parser'
+import { type NodeTransform, transform } from '../src/transform'
import {
- ElementNode,
+ type DirectiveNode,
+ type ElementNode,
+ type ExpressionNode,
NodeTypes,
- DirectiveNode,
- ExpressionNode,
- VNodeCall
+ type VNodeCall,
} from '../src/ast'
import { ErrorCodes, createCompilerError } from '../src/errors'
import {
- TO_DISPLAY_STRING,
+ CREATE_COMMENT,
FRAGMENT,
RENDER_SLOT,
- CREATE_COMMENT
+ TO_DISPLAY_STRING,
} from '../src/runtimeHelpers'
import { transformIf } from '../src/transforms/vIf'
import { transformFor } from '../src/transforms/vFor'
@@ -35,7 +34,7 @@ describe('compiler: transform', () => {
}
transform(ast, {
- nodeTransforms: [plugin]
+ nodeTransforms: [plugin],
})
const div = ast.children[0] as ElementNode
@@ -44,29 +43,29 @@ describe('compiler: transform', () => {
ast,
{
parent: null,
- currentNode: ast
- }
+ currentNode: ast,
+ },
])
expect(calls[1]).toMatchObject([
div,
{
parent: ast,
- currentNode: div
- }
+ currentNode: div,
+ },
])
expect(calls[2]).toMatchObject([
div.children[0],
{
parent: div,
- currentNode: div.children[0]
- }
+ currentNode: div.children[0],
+ },
])
expect(calls[3]).toMatchObject([
div.children[1],
{
parent: div,
- currentNode: div.children[1]
- }
+ currentNode: div.children[1],
+ },
])
})
@@ -82,16 +81,16 @@ describe('compiler: transform', () => {
{
type: NodeTypes.TEXT,
content: 'hello',
- isEmpty: false
- }
- ]
- })
+ isEmpty: false,
+ },
+ ],
+ }),
)
}
}
const spy = vi.fn(plugin)
transform(ast, {
- nodeTransforms: [spy]
+ nodeTransforms: [spy],
})
expect(ast.children.length).toBe(2)
@@ -116,7 +115,7 @@ describe('compiler: transform', () => {
}
const spy = vi.fn(plugin)
transform(ast, {
- nodeTransforms: [spy]
+ nodeTransforms: [spy],
})
expect(ast.children.length).toBe(2)
@@ -144,7 +143,7 @@ describe('compiler: transform', () => {
}
const spy = vi.fn(plugin)
transform(ast, {
- nodeTransforms: [spy]
+ nodeTransforms: [spy],
})
expect(ast.children.length).toBe(1)
@@ -171,7 +170,7 @@ describe('compiler: transform', () => {
}
const spy = vi.fn(plugin)
transform(ast, {
- nodeTransforms: [spy]
+ nodeTransforms: [spy],
})
expect(ast.children.length).toBe(1)
@@ -195,31 +194,51 @@ describe('compiler: transform', () => {
}
}
transform(ast, {
- nodeTransforms: [mock]
+ nodeTransforms: [mock],
})
expect(ast.hoists).toMatchObject(hoisted)
expect((ast as any).children[0].props[0].exp.content).toBe(`_hoisted_1`)
expect((ast as any).children[1].props[0].exp.content).toBe(`_hoisted_2`)
})
+ test('context.filename and selfName', () => {
+ const ast = baseParse(`
`)
+
+ const calls: any[] = []
+ const plugin: NodeTransform = (node, context) => {
+ calls.push({ ...context })
+ }
+
+ transform(ast, {
+ filename: '/the/fileName.vue',
+ nodeTransforms: [plugin],
+ })
+
+ expect(calls.length).toBe(2)
+ expect(calls[1]).toMatchObject({
+ filename: '/the/fileName.vue',
+ selfName: 'FileName',
+ })
+ })
+
test('onError option', () => {
const ast = baseParse(`
`)
const loc = ast.children[0].loc
const plugin: NodeTransform = (node, context) => {
context.onError(
- createCompilerError(ErrorCodes.X_INVALID_END_TAG, node.loc)
+ createCompilerError(ErrorCodes.X_INVALID_END_TAG, node.loc),
)
}
const spy = vi.fn()
transform(ast, {
nodeTransforms: [plugin],
- onError: spy
+ onError: spy,
})
expect(spy.mock.calls[0]).toMatchObject([
{
code: ErrorCodes.X_INVALID_END_TAG,
- loc
- }
+ loc,
+ },
])
})
@@ -244,8 +263,8 @@ describe('compiler: transform', () => {
transformFor,
transformText,
transformSlotOutlet,
- transformElement
- ]
+ transformElement,
+ ],
})
return ast
}
@@ -254,7 +273,7 @@ describe('compiler: transform', () => {
tag: VNodeCall['tag'],
props?: VNodeCall['props'],
children?: VNodeCall['children'],
- patchFlag?: VNodeCall['patchFlag']
+ patchFlag?: VNodeCall['patchFlag'],
) {
return {
type: NodeTypes.VNODE_CALL,
@@ -262,7 +281,7 @@ describe('compiler: transform', () => {
tag,
props,
children,
- patchFlag
+ patchFlag,
}
}
@@ -276,8 +295,8 @@ describe('compiler: transform', () => {
expect(ast.codegenNode).toMatchObject({
codegenNode: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: RENDER_SLOT
- }
+ callee: RENDER_SLOT,
+ },
})
})
@@ -289,14 +308,14 @@ describe('compiler: transform', () => {
test('root v-if', () => {
const ast = transformWithCodegen(`
`)
expect(ast.codegenNode).toMatchObject({
- type: NodeTypes.IF
+ type: NodeTypes.IF,
})
})
test('root v-for', () => {
const ast = transformWithCodegen(`
`)
expect(ast.codegenNode).toMatchObject({
- type: NodeTypes.FOR
+ type: NodeTypes.FOR,
})
})
@@ -304,28 +323,28 @@ describe('compiler: transform', () => {
const ast = transformWithCodegen(`
`)
expect(ast.codegenNode).toMatchObject({
type: NodeTypes.VNODE_CALL,
- directives: { type: NodeTypes.JS_ARRAY_EXPRESSION }
+ directives: { type: NodeTypes.JS_ARRAY_EXPRESSION },
})
})
test('single text', () => {
const ast = transformWithCodegen(`hello`)
expect(ast.codegenNode).toMatchObject({
- type: NodeTypes.TEXT
+ type: NodeTypes.TEXT,
})
})
test('single interpolation', () => {
const ast = transformWithCodegen(`{{ foo }}`)
expect(ast.codegenNode).toMatchObject({
- type: NodeTypes.INTERPOLATION
+ type: NodeTypes.INTERPOLATION,
})
})
test('single CompoundExpression', () => {
const ast = transformWithCodegen(`{{ foo }} bar baz`)
expect(ast.codegenNode).toMatchObject({
- type: NodeTypes.COMPOUND_EXPRESSION
+ type: NodeTypes.COMPOUND_EXPRESSION,
})
})
@@ -337,10 +356,10 @@ describe('compiler: transform', () => {
undefined,
[
{ type: NodeTypes.ELEMENT, tag: `div` },
- { type: NodeTypes.ELEMENT, tag: `div` }
+ { type: NodeTypes.ELEMENT, tag: `div` },
] as any,
- genFlagText(PatchFlags.STABLE_FRAGMENT)
- )
+ genFlagText(PatchFlags.STABLE_FRAGMENT),
+ ),
)
})
@@ -353,13 +372,13 @@ describe('compiler: transform', () => {
[
{ type: NodeTypes.COMMENT },
{ type: NodeTypes.ELEMENT, tag: `div` },
- { type: NodeTypes.COMMENT }
+ { type: NodeTypes.COMMENT },
] as any,
genFlagText([
PatchFlags.STABLE_FRAGMENT,
- PatchFlags.DEV_ROOT_FRAGMENT
- ])
- )
+ PatchFlags.DEV_ROOT_FRAGMENT,
+ ]),
+ ),
)
})
})
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap
index e67694a9bf9..ef3e2b8f4d6 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap
@@ -4,7 +4,7 @@ exports[`compiler: hoistStatic transform > hoist element with static key 1`] = `
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", { key: \\"foo\\" }, null, -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", { key: "foo" }, null, -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
@@ -13,7 +13,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -22,9 +22,9 @@ exports[`compiler: hoistStatic transform > hoist nested static tree 1`] = `
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"p\\", null, [
- /*#__PURE__*/_createElementVNode(\\"span\\"),
- /*#__PURE__*/_createElementVNode(\\"span\\")
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("p", null, [
+ /*#__PURE__*/_createElementVNode("span"),
+ /*#__PURE__*/_createElementVNode("span")
], -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
@@ -34,7 +34,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -43,8 +43,8 @@ exports[`compiler: hoistStatic transform > hoist nested static tree with comment
"const _Vue = Vue
const { createElementVNode: _createElementVNode, createCommentVNode: _createCommentVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, [
- /*#__PURE__*/_createCommentVNode(\\"comment\\")
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", null, [
+ /*#__PURE__*/_createCommentVNode("comment")
], -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
@@ -54,7 +54,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createCommentVNode: _createCommentVNode, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -63,8 +63,8 @@ exports[`compiler: hoistStatic transform > hoist siblings with common non-hoista
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"span\\", null, null, -1 /* HOISTED */)
-const _hoisted_2 = /*#__PURE__*/_createElementVNode(\\"div\\", null, null, -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("span", null, null, -1 /* HOISTED */)
+const _hoisted_2 = /*#__PURE__*/_createElementVNode("div", null, null, -1 /* HOISTED */)
const _hoisted_3 = [
_hoisted_1,
_hoisted_2
@@ -74,7 +74,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_3))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_3))
}
}"
`;
@@ -83,7 +83,7 @@ exports[`compiler: hoistStatic transform > hoist simple element 1`] = `
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"inline\\" }, \\"hello\\", -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("span", { class: "inline" }, "hello", -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
@@ -92,7 +92,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -101,16 +101,16 @@ exports[`compiler: hoistStatic transform > hoist static props for elements with
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = { id: \\"foo\\" }
+const _hoisted_1 = { id: "foo" }
return function render(_ctx, _cache) {
with (_ctx) {
const { resolveDirective: _resolveDirective, createElementVNode: _createElementVNode, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- const _directive_foo = _resolveDirective(\\"foo\\")
+ const _directive_foo = _resolveDirective("foo")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _withDirectives(_createElementVNode(\\"div\\", _hoisted_1, null, 512 /* NEED_PATCH */), [
+ return (_openBlock(), _createElementBlock("div", null, [
+ _withDirectives(_createElementVNode("div", _hoisted_1, null, 512 /* NEED_PATCH */), [
[_directive_foo]
])
]))
@@ -122,14 +122,14 @@ exports[`compiler: hoistStatic transform > hoist static props for elements with
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = { id: \\"foo\\" }
+const _hoisted_1 = { id: "foo" }
return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", _hoisted_1, _toDisplayString(hello), 1 /* TEXT */)
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", _hoisted_1, _toDisplayString(hello), 1 /* TEXT */)
]))
}
}"
@@ -139,16 +139,16 @@ exports[`compiler: hoistStatic transform > hoist static props for elements with
"const _Vue = Vue
const { createVNode: _createVNode, createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = { id: \\"foo\\" }
+const _hoisted_1 = { id: "foo" }
return function render(_ctx, _cache) {
with (_ctx) {
const { resolveComponent: _resolveComponent, createVNode: _createVNode, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", _hoisted_1, [
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", _hoisted_1, [
_createVNode(_component_Comp)
])
]))
@@ -168,8 +168,8 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, normalizeClass: _normalizeClass, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"span\\", _hoisted_1, _toDisplayString(_ctx.bar), 1 /* TEXT */)
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("span", _hoisted_1, _toDisplayString(_ctx.bar), 1 /* TEXT */)
]))
}
}"
@@ -179,7 +179,7 @@ exports[`compiler: hoistStatic transform > prefixIdentifiers > hoist nested stat
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"span\\", null, \\"foo \\" + /*#__PURE__*/_toDisplayString(1) + \\" \\" + /*#__PURE__*/_toDisplayString(true), -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("span", null, "foo " + /*#__PURE__*/_toDisplayString(1) + " " + /*#__PURE__*/_toDisplayString(true), -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
@@ -188,7 +188,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -197,7 +197,7 @@ exports[`compiler: hoistStatic transform > prefixIdentifiers > hoist nested stat
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"span\\", { foo: 0 }, /*#__PURE__*/_toDisplayString(1), -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("span", { foo: 0 }, /*#__PURE__*/_toDisplayString(1), -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
@@ -206,7 +206,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}
}"
`;
@@ -215,7 +215,7 @@ exports[`compiler: hoistStatic transform > prefixIdentifiers > should NOT hoist
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"path\\", { d: \\"M2,3H5.5L12\\" }, null, -1 /* HOISTED */)
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("path", { d: "M2,3H5.5L12" }, null, -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
@@ -224,10 +224,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, resolveDirective: _resolveDirective, openBlock: _openBlock, createElementBlock: _createElementBlock, withDirectives: _withDirectives } = _Vue
- const _directive_foo = _resolveDirective(\\"foo\\")
+ const _directive_foo = _resolveDirective("foo")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _withDirectives((_openBlock(), _createElementBlock(\\"svg\\", null, _hoisted_2)), [
+ return (_openBlock(), _createElementBlock("div", null, [
+ _withDirectives((_openBlock(), _createElementBlock("svg", null, _hoisted_2)), [
[_directive_foo]
])
]))
@@ -236,12 +236,12 @@ return function render(_ctx, _cache) {
`;
exports[`compiler: hoistStatic transform > prefixIdentifiers > should NOT hoist elements with cached handlers + other bindings 1`] = `
-"import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", null, [
- _createElementVNode(\\"div\\", {
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", null, [
+ _createElementVNode("div", {
class: _normalizeClass({}),
onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.foo && _ctx.foo(...args)))
})
@@ -251,12 +251,12 @@ export function render(_ctx, _cache) {
`;
exports[`compiler: hoistStatic transform > prefixIdentifiers > should NOT hoist elements with cached handlers 1`] = `
-"import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", null, [
- _createElementVNode(\\"div\\", {
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", null, [
+ _createElementVNode("div", {
onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.foo && _ctx.foo(...args)))
})
])
@@ -271,10 +271,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, toDisplayString: _toDisplayString, createElementVNode: _createElementVNode } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (o) => {
- return (_openBlock(), _createElementBlock(\\"p\\", null, [
- _createElementVNode(\\"span\\", null, _toDisplayString(o + 'foo'), 1 /* TEXT */)
+ return (_openBlock(), _createElementBlock("p", null, [
+ _createElementVNode("span", null, _toDisplayString(o + 'foo'), 1 /* TEXT */)
]))
}), 256 /* UNKEYED_FRAGMENT */))
]))
@@ -289,7 +289,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
default: _withCtx(({ foo }) => [
@@ -308,10 +308,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, toDisplayString: _toDisplayString, createElementVNode: _createElementVNode } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (o) => {
- return (_openBlock(), _createElementBlock(\\"p\\", null, [
- _createElementVNode(\\"span\\", null, _toDisplayString(o), 1 /* TEXT */)
+ return (_openBlock(), _createElementBlock("p", null, [
+ _createElementVNode("span", null, _toDisplayString(o), 1 /* TEXT */)
]))
}), 256 /* UNKEYED_FRAGMENT */))
]))
@@ -326,9 +326,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return (_openBlock(), _createElementBlock(\\"span\\", { key: item }))
+ return (_openBlock(), _createElementBlock("span", { key: item }))
}), 128 /* KEYED_FRAGMENT */))
]))
}
@@ -342,9 +342,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { resolveComponent: _resolveComponent, createVNode: _createVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_createVNode(_component_Comp)
]))
}
@@ -358,8 +358,8 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- (_openBlock(), _createElementBlock(\\"div\\", { key: foo }))
+ return (_openBlock(), _createElementBlock("div", null, [
+ (_openBlock(), _createElementBlock("div", { key: foo }))
]))
}
}"
@@ -369,14 +369,14 @@ exports[`compiler: hoistStatic transform > should NOT hoist element with dynamic
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = [\\"id\\"]
+const _hoisted_1 = ["id"]
return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", { id: foo }, null, 8 /* PROPS */, _hoisted_1)
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, _hoisted_1)
]))
}
}"
@@ -389,8 +389,8 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _createElementVNode(\\"div\\", { ref: foo }, null, 512 /* NEED_PATCH */)
+ return (_openBlock(), _createElementBlock("div", null, [
+ _createElementVNode("div", { ref: foo }, null, 512 /* NEED_PATCH */)
]))
}
}"
@@ -403,7 +403,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\"))
+ return (_openBlock(), _createElementBlock("div"))
}
}"
`;
@@ -412,8 +412,8 @@ exports[`compiler: hoistStatic transform > should hoist v-for children if static
"const _Vue = Vue
const { createElementVNode: _createElementVNode } = _Vue
-const _hoisted_1 = { id: \\"foo\\" }
-const _hoisted_2 = /*#__PURE__*/_createElementVNode(\\"span\\", null, null, -1 /* HOISTED */)
+const _hoisted_1 = { id: "foo" }
+const _hoisted_2 = /*#__PURE__*/_createElementVNode("span", null, null, -1 /* HOISTED */)
const _hoisted_3 = [
_hoisted_2
]
@@ -422,9 +422,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, createElementVNode: _createElementVNode } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
- return (_openBlock(), _createElementBlock(\\"div\\", _hoisted_1, _hoisted_3))
+ return (_openBlock(), _createElementBlock("div", _hoisted_1, _hoisted_3))
}), 256 /* UNKEYED_FRAGMENT */))
]))
}
@@ -437,9 +437,9 @@ const { createElementVNode: _createElementVNode, createCommentVNode: _createComm
const _hoisted_1 = {
key: 0,
- id: \\"foo\\"
+ id: "foo"
}
-const _hoisted_2 = /*#__PURE__*/_createElementVNode(\\"span\\", null, null, -1 /* HOISTED */)
+const _hoisted_2 = /*#__PURE__*/_createElementVNode("span", null, null, -1 /* HOISTED */)
const _hoisted_3 = [
_hoisted_2
]
@@ -448,10 +448,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
ok
- ? (_openBlock(), _createElementBlock(\\"div\\", _hoisted_1, _hoisted_3))
- : _createCommentVNode(\\"v-if\\", true)
+ ? (_openBlock(), _createElementBlock("div", _hoisted_1, _hoisted_3))
+ : _createCommentVNode("v-if", true)
]))
}
}"
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap
index c72e0229832..9f4406864db 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap
@@ -2,7 +2,7 @@
exports[`compiler: expression transform > bindingMetadata > inline mode 1`] = `
"(_ctx, _cache) => {
- return (_openBlock(), _createElementBlock(\\"div\\", null, _toDisplayString(__props.props) + \\" \\" + _toDisplayString(_unref(setup)) + \\" \\" + _toDisplayString(setupConst) + \\" \\" + _toDisplayString(_ctx.data) + \\" \\" + _toDisplayString(_ctx.options), 1 /* TEXT */))
+ return (_openBlock(), _createElementBlock("div", null, _toDisplayString(__props.props) + " " + _toDisplayString(_unref(setup)) + " " + _toDisplayString(setupConst) + " " + _toDisplayString(_ctx.data) + " " + _toDisplayString(_ctx.options) + " " + _toDisplayString(isNaN.value), 1 /* TEXT */))
}"
`;
@@ -10,6 +10,48 @@ exports[`compiler: expression transform > bindingMetadata > non-inline mode 1`]
"const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
return function render(_ctx, _cache, $props, $setup, $data, $options) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, _toDisplayString($props.props) + \\" \\" + _toDisplayString($setup.setup) + \\" \\" + _toDisplayString($data.data) + \\" \\" + _toDisplayString($options.options), 1 /* TEXT */))
+ return (_openBlock(), _createElementBlock("div", null, _toDisplayString($props.props) + " " + _toDisplayString($setup.setup) + " " + _toDisplayString($data.data) + " " + _toDisplayString($options.options) + " " + _toDisplayString($setup.isNaN), 1 /* TEXT */))
+}"
+`;
+
+exports[`compiler: expression transform > bindingMetadata > should not prefix temp variable of for loop 1`] = `
+"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
+
+return function render(_ctx, _cache, $props, $setup, $data, $options) {
+ return (_openBlock(), _createElementBlock("div", {
+ onClick: () => {
+ for (let i = 0; i < _ctx.list.length; i++) {
+ _ctx.log(i)
+ }
+ }
+ }, null, 8 /* PROPS */, ["onClick"]))
+}"
+`;
+
+exports[`compiler: expression transform > bindingMetadata > should not prefix temp variable of for...in 1`] = `
+"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
+
+return function render(_ctx, _cache, $props, $setup, $data, $options) {
+ return (_openBlock(), _createElementBlock("div", {
+ onClick: () => {
+ for (const x in _ctx.list) {
+ _ctx.log(x)
+ }
+ }
+ }, null, 8 /* PROPS */, ["onClick"]))
+}"
+`;
+
+exports[`compiler: expression transform > bindingMetadata > should not prefix temp variable of for...of 1`] = `
+"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
+
+return function render(_ctx, _cache, $props, $setup, $data, $options) {
+ return (_openBlock(), _createElementBlock("div", {
+ onClick: () => {
+ for (const x of _ctx.list) {
+ _ctx.log(x)
+ }
+ }
+ }, null, 8 /* PROPS */, ["onClick"]))
}"
`;
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/transformText.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/transformText.spec.ts.snap
index 8e716acb83e..7fb49ea7887 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/transformText.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/transformText.spec.ts.snap
@@ -9,7 +9,7 @@ return function render(_ctx, _cache) {
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
return (_openBlock(), _createElementBlock(_Fragment, null, [
- _createTextVNode(\\"foo\\")
+ _createTextVNode("foo")
], 64 /* STABLE_FRAGMENT */))
}), 256 /* UNKEYED_FRAGMENT */))
}
@@ -23,7 +23,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString } = _Vue
- return _toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz)
+ return _toDisplayString(foo) + " bar " + _toDisplayString(baz)
}
}"
`;
@@ -36,9 +36,9 @@ return function render(_ctx, _cache) {
const { createElementVNode: _createElementVNode, toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(), _createElementBlock(_Fragment, null, [
- _createElementVNode(\\"div\\"),
- _createTextVNode(_toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz), 1 /* TEXT */),
- _createElementVNode(\\"div\\")
+ _createElementVNode("div"),
+ _createTextVNode(_toDisplayString(foo) + " bar " + _toDisplayString(baz), 1 /* TEXT */),
+ _createElementVNode("div")
], 64 /* STABLE_FRAGMENT */))
}
}"
@@ -52,11 +52,11 @@ return function render(_ctx, _cache) {
const { createElementVNode: _createElementVNode, toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(), _createElementBlock(_Fragment, null, [
- _createElementVNode(\\"div\\"),
- _createTextVNode(_toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz), 1 /* TEXT */),
- _createElementVNode(\\"div\\"),
- _createTextVNode(\\"hello\\"),
- _createElementVNode(\\"div\\")
+ _createElementVNode("div"),
+ _createTextVNode(_toDisplayString(foo) + " bar " + _toDisplayString(baz), 1 /* TEXT */),
+ _createElementVNode("div"),
+ _createTextVNode("hello"),
+ _createElementVNode("div")
], 64 /* STABLE_FRAGMENT */))
}
}"
@@ -69,9 +69,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, resolveDirective: _resolveDirective, openBlock: _openBlock, createElementBlock: _createElementBlock, withDirectives: _withDirectives } = _Vue
- const _directive_foo = _resolveDirective(\\"foo\\")
+ const _directive_foo = _resolveDirective("foo")
- return _withDirectives((_openBlock(), _createElementBlock(\\"p\\", null, [
+ return _withDirectives((_openBlock(), _createElementBlock("p", null, [
_createTextVNode(_toDisplayString(foo), 1 /* TEXT */)
])), [
[_directive_foo]
@@ -100,9 +100,9 @@ return function render(_ctx, _cache) {
const { createElementVNode: _createElementVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(), _createElementBlock(_Fragment, null, [
- _createElementVNode(\\"div\\"),
- _createTextVNode(\\"hello\\"),
- _createElementVNode(\\"div\\")
+ _createElementVNode("div"),
+ _createTextVNode("hello"),
+ _createElementVNode("div")
], 64 /* STABLE_FRAGMENT */))
}
}"
@@ -112,6 +112,6 @@ exports[`compiler: transform text > with prefixIdentifiers: true 1`] = `
"const { toDisplayString: _toDisplayString } = Vue
return function render(_ctx, _cache) {
- return _toDisplayString(_ctx.foo) + \\" bar \\" + _toDisplayString(_ctx.baz + _ctx.qux)
+ return _toDisplayString(_ctx.foo) + " bar " + _toDisplayString(_ctx.baz + _ctx.qux)
}"
`;
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snap
index 2c38177f11a..3da778eb675 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snap
@@ -8,7 +8,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return (_openBlock(), _createElementBlock(\\"span\\"))
+ return (_openBlock(), _createElementBlock("span"))
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -23,8 +23,8 @@ return function render(_ctx, _cache) {
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
return (_openBlock(), _createElementBlock(_Fragment, { key: item }, [
- \\"hello\\",
- _createElementVNode(\\"span\\")
+ "hello",
+ _createElementVNode("span")
], 64 /* STABLE_FRAGMENT */))
}), 128 /* KEYED_FRAGMENT */))
}
@@ -39,7 +39,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return (_openBlock(), _createElementBlock(\\"span\\", { key: item }))
+ return (_openBlock(), _createElementBlock("span", { key: item }))
}), 128 /* KEYED_FRAGMENT */))
}
}"
@@ -53,7 +53,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item, __, index) => {
- return (_openBlock(), _createElementBlock(\\"span\\"))
+ return (_openBlock(), _createElementBlock("span"))
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -67,7 +67,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (_, __, index) => {
- return (_openBlock(), _createElementBlock(\\"span\\"))
+ return (_openBlock(), _createElementBlock("span"))
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -81,7 +81,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (_, key, index) => {
- return (_openBlock(), _createElementBlock(\\"span\\"))
+ return (_openBlock(), _createElementBlock("span"))
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -96,8 +96,8 @@ return function render(_ctx, _cache) {
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
return (_openBlock(), _createElementBlock(_Fragment, null, [
- \\"hello\\",
- _createElementVNode(\\"span\\")
+ "hello",
+ _createElementVNode("span")
], 64 /* STABLE_FRAGMENT */))
}), 256 /* UNKEYED_FRAGMENT */))
}
@@ -112,10 +112,10 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return (_openBlock(), _createElementBlock(\\"span\\", {
+ return (_openBlock(), _createElementBlock("span", {
key: item.id,
id: item.id
- }, null, 8 /* PROPS */, [\\"id\\"]))
+ }, null, 8 /* PROPS */, ["id"]))
}), 128 /* KEYED_FRAGMENT */))
}
}"
@@ -129,7 +129,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return _renderSlot($slots, \\"default\\")
+ return _renderSlot($slots, "default")
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -143,7 +143,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
- return _renderSlot($slots, \\"default\\")
+ return _renderSlot($slots, "default")
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
@@ -156,10 +156,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, resolveDirective: _resolveDirective, withDirectives: _withDirectives } = _Vue
- const _directive_foo = _resolveDirective(\\"foo\\")
+ const _directive_foo = _resolveDirective("foo")
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
- return _withDirectives((_openBlock(), _createElementBlock(\\"div\\", null, null, 512 /* NEED_PATCH */)), [
+ return _withDirectives((_openBlock(), _createElementBlock("div", null, null, 512 /* NEED_PATCH */)), [
[_directive_foo]
])
}), 256 /* UNKEYED_FRAGMENT */))
@@ -175,7 +175,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, toDisplayString: _toDisplayString, createElementVNode: _createElementVNode } = _Vue
return (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (item) => {
- return _createElementVNode(\\"p\\", null, _toDisplayString(item), 1 /* TEXT */)
+ return _createElementVNode("p", null, _toDisplayString(item), 1 /* TEXT */)
}), 64 /* STABLE_FRAGMENT */))
}
}"
@@ -190,9 +190,9 @@ return function render(_ctx, _cache) {
return ok
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(list, (i) => {
- return (_openBlock(), _createElementBlock(\\"div\\"))
+ return (_openBlock(), _createElementBlock("div"))
}), 256 /* UNKEYED_FRAGMENT */))
- : _createCommentVNode(\\"v-if\\", true)
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -208,7 +208,7 @@ return function render(_ctx, _cache) {
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(list, (i) => {
return (_openBlock(), _createElementBlock(_Fragment, null, [], 64 /* STABLE_FRAGMENT */))
}), 256 /* UNKEYED_FRAGMENT */))
- : _createCommentVNode(\\"v-if\\", true)
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -221,7 +221,7 @@ return function render(_ctx, _cache) {
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item, key, index) => {
- return (_openBlock(), _createElementBlock(\\"span\\"))
+ return (_openBlock(), _createElementBlock("span"))
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snap
index 4da71c3ea5b..65ee73c46f4 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snap
@@ -8,8 +8,8 @@ return function render(_ctx, _cache) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
- : _createCommentVNode(\\"v-if\\", true)
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -23,13 +23,13 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createElementBlock(_Fragment, null, [
ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
- : (_openBlock(), _createElementBlock(\\"p\\", { key: 1 })),
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
+ : (_openBlock(), _createElementBlock("p", { key: 1 })),
another
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 2 }))
+ ? (_openBlock(), _createElementBlock("div", { key: 2 }))
: orNot
- ? (_openBlock(), _createElementBlock(\\"p\\", { key: 3 }))
- : (_openBlock(), _createElementBlock(\\"p\\", { key: 4 }))
+ ? (_openBlock(), _createElementBlock("p", { key: 3 }))
+ : (_openBlock(), _createElementBlock("p", { key: 4 }))
], 64 /* STABLE_FRAGMENT */))
}
}"
@@ -44,11 +44,11 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createElementBlock(_Fragment, null, [
ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
- : _createCommentVNode(\\"v-if\\", true),
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
+ : _createCommentVNode("v-if", true),
orNot
- ? (_openBlock(), _createElementBlock(\\"p\\", { key: 1 }))
- : _createCommentVNode(\\"v-if\\", true)
+ ? (_openBlock(), _createElementBlock("p", { key: 1 }))
+ : _createCommentVNode("v-if", true)
], 64 /* STABLE_FRAGMENT */))
}
}"
@@ -63,11 +63,11 @@ return function render(_ctx, _cache) {
return ok
? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [
- _createElementVNode(\\"div\\"),
- \\"hello\\",
- _createElementVNode(\\"p\\")
+ _createElementVNode("div"),
+ "hello",
+ _createElementVNode("p")
], 64 /* STABLE_FRAGMENT */))
- : _createCommentVNode(\\"v-if\\", true)
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -80,8 +80,8 @@ return function render(_ctx, _cache) {
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? _renderSlot($slots, \\"default\\", { key: 0 })
- : _createCommentVNode(\\"v-if\\", true)
+ ? _renderSlot($slots, "default", { key: 0 })
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -94,8 +94,8 @@ return function render(_ctx, _cache) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
- : (_openBlock(), _createElementBlock(\\"p\\", { key: 1 }))
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
+ : (_openBlock(), _createElementBlock("p", { key: 1 }))
}
}"
`;
@@ -108,10 +108,10 @@ return function render(_ctx, _cache) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, Fragment: _Fragment } = _Vue
return ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
: orNot
- ? (_openBlock(), _createElementBlock(\\"p\\", { key: 1 }))
- : (_openBlock(), _createElementBlock(_Fragment, { key: 2 }, [\\"fine\\"], 64 /* STABLE_FRAGMENT */))
+ ? (_openBlock(), _createElementBlock("p", { key: 1 }))
+ : (_openBlock(), _createElementBlock(_Fragment, { key: 2 }, ["fine"], 64 /* STABLE_FRAGMENT */))
}
}"
`;
@@ -124,10 +124,10 @@ return function render(_ctx, _cache) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }))
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }))
: orNot
- ? (_openBlock(), _createElementBlock(\\"p\\", { key: 1 }))
- : _createCommentVNode(\\"v-if\\", true)
+ ? (_openBlock(), _createElementBlock("p", { key: 1 }))
+ : _createCommentVNode("v-if", true)
}
}"
`;
@@ -140,8 +140,8 @@ return function render(_ctx, _cache) {
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? _renderSlot($slots, \\"default\\", { key: 0 })
- : _createCommentVNode(\\"v-if\\", true)
+ ? _renderSlot($slots, "default", { key: 0 })
+ : _createCommentVNode("v-if", true)
}
}"
`;
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vMemo.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vMemo.spec.ts.snap
index 844cd27870b..220bc177418 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vMemo.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vMemo.spec.ts.snap
@@ -1,44 +1,44 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`compiler: v-memo transform > on component 1`] = `
-"import { resolveComponent as _resolveComponent, createVNode as _createVNode, withMemo as _withMemo, openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { resolveComponent as _resolveComponent, createVNode as _createVNode, withMemo as _withMemo, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_withMemo([_ctx.x], () => _createVNode(_component_Comp), _cache, 0)
]))
}"
`;
exports[`compiler: v-memo transform > on normal element 1`] = `
-"import { openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo } from \\"vue\\"
+"import { openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
- _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock(\\"div\\")), _cache, 0)
+ return (_openBlock(), _createElementBlock("div", null, [
+ _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock("div")), _cache, 0)
]))
}"
`;
exports[`compiler: v-memo transform > on root element 1`] = `
-"import { openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo } from \\"vue\\"
+"import { openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo } from "vue"
export function render(_ctx, _cache) {
- return _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock(\\"div\\")), _cache, 0)
+ return _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock("div")), _cache, 0)
}"
`;
exports[`compiler: v-memo transform > on template v-for 1`] = `
-"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, isMemoSame as _isMemoSame, withMemo as _withMemo } from \\"vue\\"
+"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, isMemoSame as _isMemoSame, withMemo as _withMemo } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, ({ x, y }, __, ___, _cached) => {
const _memo = ([x, y === _ctx.z])
if (_cached && _cached.key === x && _isMemoSame(_cached, _memo)) return _cached
- const _item = (_openBlock(), _createElementBlock(\\"span\\", { key: x }, \\"foobar\\"))
+ const _item = (_openBlock(), _createElementBlock("span", { key: x }, "foobar"))
_item.memo = _memo
return _item
}, _cache, 0), 128 /* KEYED_FRAGMENT */))
@@ -47,15 +47,15 @@ export function render(_ctx, _cache) {
`;
exports[`compiler: v-memo transform > on v-for 1`] = `
-"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, isMemoSame as _isMemoSame, withMemo as _withMemo } from \\"vue\\"
+"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, isMemoSame as _isMemoSame, withMemo as _withMemo } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, ({ x, y }, __, ___, _cached) => {
const _memo = ([x, y === _ctx.z])
if (_cached && _cached.key === x && _isMemoSame(_cached, _memo)) return _cached
- const _item = (_openBlock(), _createElementBlock(\\"div\\", { key: x }, [
- _createElementVNode(\\"span\\", null, \\"foobar\\")
+ const _item = (_openBlock(), _createElementBlock("div", { key: x }, [
+ _createElementVNode("span", null, "foobar")
]))
_item.memo = _memo
return _item
@@ -65,16 +65,16 @@ export function render(_ctx, _cache) {
`;
exports[`compiler: v-memo transform > on v-if 1`] = `
-"import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock } from \\"vue\\"
+"import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withMemo as _withMemo, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock } from "vue"
export function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
(_ctx.ok)
- ? _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, [
- _createElementVNode(\\"span\\", null, \\"foo\\"),
- _createTextVNode(\\"bar\\")
+ ? _withMemo([_ctx.x], () => (_openBlock(), _createElementBlock("div", { key: 0 }, [
+ _createElementVNode("span", null, "foo"),
+ _createTextVNode("bar")
])), _cache, 0)
: _withMemo([_ctx.x], () => (_openBlock(), _createBlock(_component_Comp, { key: 1 })), _cache, 1)
]))
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
index e59df2d5458..17c4e80b160 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
@@ -1,13 +1,13 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`compiler: transform v-model > compound expression (with prefixIdentifiers) 1`] = `
-"import { openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"input\\", {
+ return (_openBlock(), _createElementBlock("input", {
modelValue: _ctx.model[_ctx.index],
- \\"onUpdate:modelValue\\": $event => ((_ctx.model[_ctx.index]) = $event)
- }, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
+ "onUpdate:modelValue": $event => ((_ctx.model[_ctx.index]) = $event)
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue"]))
}"
`;
@@ -18,10 +18,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"input\\", {
+ return (_openBlock(), _createElementBlock("input", {
modelValue: model[index],
- \\"onUpdate:modelValue\\": $event => ((model[index]) = $event)
- }, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
+ "onUpdate:modelValue": $event => ((model[index]) = $event)
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue"]))
}
}"
`;
@@ -33,30 +33,30 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"input\\", {
+ return (_openBlock(), _createElementBlock("input", {
modelValue:
model
.
foo
,
- \\"onUpdate:modelValue\\": $event => ((
+ "onUpdate:modelValue": $event => ((
model
.
foo
) = $event)
- }, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue"]))
}
}"
`;
exports[`compiler: transform v-model > simple expression (with prefixIdentifiers) 1`] = `
-"import { openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"input\\", {
+ return (_openBlock(), _createElementBlock("input", {
modelValue: _ctx.model,
- \\"onUpdate:modelValue\\": $event => ((_ctx.model) = $event)
- }, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
+ "onUpdate:modelValue": $event => ((_ctx.model) = $event)
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue"]))
}"
`;
@@ -67,10 +67,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"input\\", {
+ return (_openBlock(), _createElementBlock("input", {
modelValue: model,
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue"]))
}
}"
`;
@@ -82,21 +82,21 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"input\\", {
- \\"foo-value\\": model,
- \\"onUpdate:fooValue\\": $event => ((model) = $event)
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, [\\"foo-value\\", \\"onUpdate:fooValue\\"]))
+ return (_openBlock(), _createElementBlock("input", {
+ "foo-value": model,
+ "onUpdate:fooValue": $event => ((model) = $event)
+ }, null, 40 /* PROPS, NEED_HYDRATION */, ["foo-value", "onUpdate:fooValue"]))
}
}"
`;
exports[`compiler: transform v-model > with dynamic argument (with prefixIdentifiers) 1`] = `
-"import { normalizeProps as _normalizeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { normalizeProps as _normalizeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"input\\", _normalizeProps({
+ return (_openBlock(), _createElementBlock("input", _normalizeProps({
[_ctx.value]: _ctx.model,
- [\\"onUpdate:\\" + _ctx.value]: $event => ((_ctx.model) = $event)
+ ["onUpdate:" + _ctx.value]: $event => ((_ctx.model) = $event)
}), null, 16 /* FULL_PROPS */))
}"
`;
@@ -108,9 +108,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { normalizeProps: _normalizeProps, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"input\\", _normalizeProps({
+ return (_openBlock(), _createElementBlock("input", _normalizeProps({
[value]: model,
- [\\"onUpdate:\\" + value]: $event => ((model) = $event)
+ ["onUpdate:" + value]: $event => ((model) = $event)
}), null, 16 /* FULL_PROPS */))
}
}"
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap
index 1246c47fc64..1c1203552db 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap
@@ -9,7 +9,7 @@ return function render(_ctx, _cache) {
return _cache[0] || (
_setBlockTracking(-1),
- _cache[0] = _createElementVNode(\\"div\\", { id: foo }, null, 8 /* PROPS */, [\\"id\\"]),
+ _cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"]),
_setBlockTracking(1),
_cache[0]
)
@@ -24,12 +24,12 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { setBlockTracking: _setBlockTracking, resolveComponent: _resolveComponent, createVNode: _createVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_cache[0] || (
_setBlockTracking(-1),
- _cache[0] = _createVNode(_component_Comp, { id: foo }, null, 8 /* PROPS */, [\\"id\\"]),
+ _cache[0] = _createVNode(_component_Comp, { id: foo }, null, 8 /* PROPS */, ["id"]),
_setBlockTracking(1),
_cache[0]
)
@@ -45,10 +45,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { setBlockTracking: _setBlockTracking, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_cache[0] || (
_setBlockTracking(-1),
- _cache[0] = _createElementVNode(\\"div\\", { id: foo }, null, 8 /* PROPS */, [\\"id\\"]),
+ _cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"]),
_setBlockTracking(1),
_cache[0]
)
@@ -64,10 +64,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { setBlockTracking: _setBlockTracking, renderSlot: _renderSlot, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_cache[0] || (
_setBlockTracking(-1),
- _cache[0] = _renderSlot($slots, \\"default\\"),
+ _cache[0] = _renderSlot($slots, "default"),
_setBlockTracking(1),
_cache[0]
)
@@ -83,10 +83,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { setBlockTracking: _setBlockTracking, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return (_openBlock(), _createElementBlock(\\"div\\", null, [
+ return (_openBlock(), _createElementBlock("div", null, [
_cache[0] || (
_setBlockTracking(-1),
- _cache[0] = _createElementVNode(\\"div\\"),
+ _cache[0] = _createElementVNode("div"),
_setBlockTracking(1),
_cache[0]
)
diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap
index 0c8e061f9ef..0d9c0e743de 100644
--- a/packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap
+++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap
@@ -4,7 +4,7 @@ exports[`compiler: transform component slots > dynamically named slots 1`] = `
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
[_ctx.one]: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
@@ -18,11 +18,11 @@ exports[`compiler: transform component slots > implicit default slot 1`] = `
"const { createElementVNode: _createElementVNode, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
default: _withCtx(() => [
- _createElementVNode(\\"div\\")
+ _createElementVNode("div")
]),
_: 1 /* STABLE */
}))
@@ -33,7 +33,7 @@ exports[`compiler: transform component slots > named slot with v-for w/ prefixId
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, renderList: _renderList, createSlots: _createSlots, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
_renderList(_ctx.list, (name) => {
@@ -50,14 +50,14 @@ exports[`compiler: transform component slots > named slot with v-if + prefixIden
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, createSlots: _createSlots, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
(_ctx.ok)
? {
- name: \\"one\\",
+ name: "one",
fn: _withCtx((props) => [_toDisplayString(props)]),
- key: \\"0\\"
+ key: "0"
}
: undefined
]), 1024 /* DYNAMIC_SLOTS */))
@@ -71,25 +71,25 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { resolveComponent: _resolveComponent, withCtx: _withCtx, createSlots: _createSlots, openBlock: _openBlock, createBlock: _createBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
ok
? {
- name: \\"one\\",
- fn: _withCtx(() => [\\"foo\\"]),
- key: \\"0\\"
+ name: "one",
+ fn: _withCtx(() => ["foo"]),
+ key: "0"
}
: orNot
? {
- name: \\"two\\",
- fn: _withCtx((props) => [\\"bar\\"]),
- key: \\"1\\"
+ name: "two",
+ fn: _withCtx((props) => ["bar"]),
+ key: "1"
}
: {
- name: \\"one\\",
- fn: _withCtx(() => [\\"baz\\"]),
- key: \\"2\\"
+ name: "one",
+ fn: _withCtx(() => ["baz"]),
+ key: "2"
}
]), 1024 /* DYNAMIC_SLOTS */))
}
@@ -103,14 +103,14 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { resolveComponent: _resolveComponent, withCtx: _withCtx, createSlots: _createSlots, openBlock: _openBlock, createBlock: _createBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
ok
? {
- name: \\"one\\",
- fn: _withCtx(() => [\\"hello\\"]),
- key: \\"0\\"
+ name: "one",
+ fn: _withCtx(() => ["hello"]),
+ key: "0"
}
: undefined
]), 1024 /* DYNAMIC_SLOTS */))
@@ -125,13 +125,13 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { createElementVNode: _createElementVNode, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = _Vue
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
- one: _withCtx(() => [\\"foo\\"]),
+ one: _withCtx(() => ["foo"]),
default: _withCtx(() => [
- \\"bar\\",
- _createElementVNode(\\"span\\")
+ "bar",
+ _createElementVNode("span")
]),
_: 1 /* STABLE */
}))
@@ -143,8 +143,8 @@ exports[`compiler: transform component slots > nested slots scoping 1`] = `
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, createVNode: _createVNode, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Inner = _resolveComponent(\\"Inner\\")
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Inner = _resolveComponent("Inner")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
default: _withCtx(({ foo }) => [
@@ -152,7 +152,7 @@ return function render(_ctx, _cache) {
default: _withCtx(({ bar }) => [_toDisplayString(foo), _toDisplayString(bar), _toDisplayString(_ctx.baz)]),
_: 2 /* DYNAMIC */
}, 1024 /* DYNAMIC_SLOTS */),
- \\" \\",
+ " ",
_toDisplayString(foo),
_toDisplayString(_ctx.bar),
_toDisplayString(_ctx.baz)
@@ -166,7 +166,7 @@ exports[`compiler: transform component slots > on component dynamically named sl
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
[_ctx.named]: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
@@ -179,7 +179,7 @@ exports[`compiler: transform component slots > on component named slot 1`] = `
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
named: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
@@ -192,7 +192,7 @@ exports[`compiler: transform component slots > on-component default slot 1`] = `
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
default: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
@@ -205,7 +205,7 @@ exports[`compiler: transform component slots > template named slots 1`] = `
"const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
one: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
@@ -219,13 +219,13 @@ exports[`compiler: transform component slots > with whitespace: 'preserve' > imp
"const { createElementVNode: _createElementVNode, resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
- header: _withCtx(() => [\\" Header \\"]),
+ header: _withCtx(() => [" Header "]),
default: _withCtx(() => [
- \\" \\",
- _createElementVNode(\\"p\\")
+ " ",
+ _createElementVNode("p")
]),
_: 1 /* STABLE */
}))
@@ -236,11 +236,11 @@ exports[`compiler: transform component slots > with whitespace: 'preserve' > nam
"const { resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
- header: _withCtx(() => [\\" Header \\"]),
- default: _withCtx(() => [\\" Default \\"]),
+ header: _withCtx(() => [" Header "]),
+ default: _withCtx(() => [" Default "]),
_: 1 /* STABLE */
}))
}"
@@ -250,11 +250,11 @@ exports[`compiler: transform component slots > with whitespace: 'preserve' > sho
"const { resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
return function render(_ctx, _cache) {
- const _component_Comp = _resolveComponent(\\"Comp\\")
+ const _component_Comp = _resolveComponent("Comp")
return (_openBlock(), _createBlock(_component_Comp, null, {
- header: _withCtx(() => [\\" Header \\"]),
- footer: _withCtx(() => [\\" Footer \\"]),
+ header: _withCtx(() => [" Header "]),
+ footer: _withCtx(() => [" Footer "]),
_: 1 /* STABLE */
}))
}"
diff --git a/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts b/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts
index eec5a76d363..d6c46b52eb3 100644
--- a/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts
@@ -1,19 +1,19 @@
import {
- baseParse as parse,
- transform,
+ type CompilerOptions,
+ ConstantTypes,
+ type ElementNode,
+ type ForNode,
+ type IfNode,
NodeTypes,
+ type VNodeCall,
generate,
- CompilerOptions,
- VNodeCall,
- IfNode,
- ElementNode,
- ForNode,
- ConstantTypes
+ baseParse as parse,
+ transform,
} from '../../src'
import {
FRAGMENT,
+ NORMALIZE_CLASS,
RENDER_LIST,
- NORMALIZE_CLASS
} from '../../src/runtimeHelpers'
import { transformElement } from '../../src/transforms/transformElement'
import { transformExpression } from '../../src/transforms/transformExpression'
@@ -31,9 +31,9 @@ const hoistedChildrenArrayMatcher = (startIndex = 1, length = 1) => ({
type: NodeTypes.ELEMENT,
codegenNode: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_hoisted_${startIndex + i}`
- }
- }))
+ content: `_hoisted_${startIndex + i}`,
+ },
+ })),
})
function transformWithHoist(template: string, options: CompilerOptions = {}) {
@@ -45,17 +45,17 @@ function transformWithHoist(template: string, options: CompilerOptions = {}) {
transformFor,
...(options.prefixIdentifiers ? [transformExpression] : []),
transformElement,
- transformText
+ transformText,
],
directiveTransforms: {
on: transformOn,
- bind: transformBind
+ bind: transformBind,
},
- ...options
+ ...options,
})
expect(ast.codegenNode).toMatchObject({
type: NodeTypes.VNODE_CALL,
- isBlock: true
+ isBlock: true,
})
return ast
}
@@ -67,14 +67,14 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(`
`)
expect(root.hoists.length).toBe(0)
expect(root.codegenNode).toMatchObject({
- tag: `"div"`
+ tag: `"div"`,
})
expect(generate(root).code).toMatchSnapshot()
})
test('hoist simple element', () => {
const root = transformWithHoist(
- `hello
`
+ `hello
`,
)
expect(root.hoists).toMatchObject([
{
@@ -83,15 +83,15 @@ describe('compiler: hoistStatic transform', () => {
props: createObjectMatcher({ class: 'inline' }),
children: {
type: NodeTypes.TEXT,
- content: `hello`
- }
+ content: `hello`,
+ },
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect(root.codegenNode).toMatchObject({
tag: `"div"`,
props: undefined,
- children: { content: `_hoisted_2` }
+ children: { content: `_hoisted_2` },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -105,13 +105,13 @@ describe('compiler: hoistStatic transform', () => {
props: undefined,
children: [
{ type: NodeTypes.ELEMENT, tag: `span` },
- { type: NodeTypes.ELEMENT, tag: `span` }
- ]
+ { type: NodeTypes.ELEMENT, tag: `span` },
+ ],
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect((root.codegenNode as VNodeCall).children).toMatchObject({
- content: '_hoisted_2'
+ content: '_hoisted_2',
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -123,12 +123,12 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: undefined,
- children: [{ type: NodeTypes.COMMENT, content: `comment` }]
+ children: [{ type: NodeTypes.COMMENT, content: `comment` }],
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect((root.codegenNode as VNodeCall).children).toMatchObject({
- content: `_hoisted_2`
+ content: `_hoisted_2`,
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -138,16 +138,16 @@ describe('compiler: hoistStatic transform', () => {
expect(root.hoists).toMatchObject([
{
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
+ tag: `"span"`,
},
{
type: NodeTypes.VNODE_CALL,
- tag: `"div"`
+ tag: `"div"`,
},
- hoistedChildrenArrayMatcher(1, 2)
+ hoistedChildrenArrayMatcher(1, 2),
])
expect((root.codegenNode as VNodeCall).children).toMatchObject({
- content: '_hoisted_3'
+ content: '_hoisted_3',
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -160,9 +160,9 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.ELEMENT,
codegenNode: {
type: NodeTypes.VNODE_CALL,
- tag: `_component_Comp`
- }
- }
+ tag: `_component_Comp`,
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
@@ -177,17 +177,17 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: createObjectMatcher({
- id: `[foo]`
+ id: `[foo]`,
}),
children: undefined,
patchFlag: genFlagText(PatchFlags.PROPS),
dynamicProps: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `_hoisted_1`,
- isStatic: false
- }
- }
- }
+ isStatic: false,
+ },
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
@@ -199,14 +199,14 @@ describe('compiler: hoistStatic transform', () => {
{
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
- props: createObjectMatcher({ key: 'foo' })
+ props: createObjectMatcher({ key: 'foo' }),
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect(root.codegenNode).toMatchObject({
tag: `"div"`,
props: undefined,
- children: { content: `_hoisted_2` }
+ children: { content: `_hoisted_2` },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -221,10 +221,10 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: createObjectMatcher({
- key: `[foo]`
- })
- }
- }
+ key: `[foo]`,
+ }),
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
@@ -239,12 +239,12 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: createObjectMatcher({
- ref: `[foo]`
+ ref: `[foo]`,
}),
children: undefined,
- patchFlag: genFlagText(PatchFlags.NEED_PATCH)
- }
- }
+ patchFlag: genFlagText(PatchFlags.NEED_PATCH),
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
@@ -260,22 +260,22 @@ describe('compiler: hoistStatic transform', () => {
tag: `"div"`,
props: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_hoisted_1`
+ content: `_hoisted_1`,
},
children: undefined,
patchFlag: genFlagText(PatchFlags.NEED_PATCH),
directives: {
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
- }
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
test('hoist static props for elements with dynamic text children', () => {
const root = transformWithHoist(
- ``
+ ``,
)
expect(root.hoists).toMatchObject([createObjectMatcher({ id: 'foo' })])
expect((root.codegenNode as VNodeCall).children).toMatchObject([
@@ -286,9 +286,9 @@ describe('compiler: hoistStatic transform', () => {
tag: `"div"`,
props: { content: `_hoisted_1` },
children: { type: NodeTypes.INTERPOLATION },
- patchFlag: genFlagText(PatchFlags.TEXT)
- }
- }
+ patchFlag: genFlagText(PatchFlags.TEXT),
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
@@ -303,30 +303,30 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: { content: `_hoisted_1` },
- children: [{ type: NodeTypes.ELEMENT, tag: `Comp` }]
- }
- }
+ children: [{ type: NodeTypes.ELEMENT, tag: `Comp` }],
+ },
+ },
])
expect(generate(root).code).toMatchSnapshot()
})
test('should hoist v-if props/children if static', () => {
const root = transformWithHoist(
- ``
+ ``,
)
expect(root.hoists).toMatchObject([
createObjectMatcher({
key: `[0]`, // key injected by v-if branch
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
+ tag: `"span"`,
},
- hoistedChildrenArrayMatcher(2)
+ hoistedChildrenArrayMatcher(2),
])
expect(
- ((root.children[0] as ElementNode).children[0] as IfNode).codegenNode
+ ((root.children[0] as ElementNode).children[0] as IfNode).codegenNode,
).toMatchObject({
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
consequent: {
@@ -334,25 +334,25 @@ describe('compiler: hoistStatic transform', () => {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: { content: `_hoisted_1` },
- children: { content: `_hoisted_3` }
- }
+ children: { content: `_hoisted_3` },
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
test('should hoist v-for children if static', () => {
const root = transformWithHoist(
- ``
+ ``,
)
expect(root.hoists).toMatchObject([
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
+ tag: `"span"`,
},
- hoistedChildrenArrayMatcher(2)
+ hoistedChildrenArrayMatcher(2),
])
const forBlockCodegen = (
(root.children[0] as ElementNode).children[0] as ForNode
@@ -363,16 +363,16 @@ describe('compiler: hoistStatic transform', () => {
props: undefined,
children: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: RENDER_LIST
+ callee: RENDER_LIST,
},
- patchFlag: genFlagText(PatchFlags.UNKEYED_FRAGMENT)
+ patchFlag: genFlagText(PatchFlags.UNKEYED_FRAGMENT),
})
const innerBlockCodegen = forBlockCodegen!.children.arguments[1]
expect(innerBlockCodegen.returns).toMatchObject({
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
props: { content: `_hoisted_1` },
- children: { content: `_hoisted_3` }
+ children: { content: `_hoisted_3` },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -382,8 +382,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
`foo {{ 1 }} {{ true }}
`,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists).toMatchObject([
{
@@ -391,18 +391,18 @@ describe('compiler: hoistStatic transform', () => {
tag: `"span"`,
props: undefined,
children: {
- type: NodeTypes.COMPOUND_EXPRESSION
- }
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ },
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect(root.codegenNode).toMatchObject({
tag: `"div"`,
props: undefined,
children: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_hoisted_2`
- }
+ content: `_hoisted_2`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -411,8 +411,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
`{{ 1 }}
`,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists).toMatchObject([
@@ -425,19 +425,19 @@ describe('compiler: hoistStatic transform', () => {
content: {
content: `1`,
isStatic: false,
- constType: ConstantTypes.CAN_STRINGIFY
- }
- }
+ constType: ConstantTypes.CAN_STRINGIFY,
+ },
+ },
},
- hoistedChildrenArrayMatcher()
+ hoistedChildrenArrayMatcher(),
])
expect(root.codegenNode).toMatchObject({
tag: `"div"`,
props: undefined,
children: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_hoisted_2`
- }
+ content: `_hoisted_2`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -446,8 +446,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
`{{ bar }}
`,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists).toMatchObject([
@@ -458,7 +458,7 @@ describe('compiler: hoistStatic transform', () => {
key: {
content: `class`,
isStatic: true,
- constType: ConstantTypes.CAN_STRINGIFY
+ constType: ConstantTypes.CAN_STRINGIFY,
},
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -467,13 +467,13 @@ describe('compiler: hoistStatic transform', () => {
{
content: `{ foo: true }`,
isStatic: false,
- constType: ConstantTypes.CAN_STRINGIFY
- }
- ]
- }
- }
- ]
- }
+ constType: ConstantTypes.CAN_STRINGIFY,
+ },
+ ],
+ },
+ },
+ ],
+ },
])
expect(root.codegenNode).toMatchObject({
tag: `"div"`,
@@ -486,20 +486,20 @@ describe('compiler: hoistStatic transform', () => {
tag: `"span"`,
props: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_hoisted_1`
+ content: `_hoisted_1`,
},
children: {
type: NodeTypes.INTERPOLATION,
content: {
content: `_ctx.bar`,
isStatic: false,
- constType: ConstantTypes.NOT_CONSTANT
- }
+ constType: ConstantTypes.NOT_CONSTANT,
+ },
},
- patchFlag: `1 /* TEXT */`
- }
- }
- ]
+ patchFlag: `1 /* TEXT */`,
+ },
+ },
+ ],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -508,8 +508,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
``,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists.length).toBe(0)
@@ -520,8 +520,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
``,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists.length).toBe(0)
@@ -532,8 +532,8 @@ describe('compiler: hoistStatic transform', () => {
const root = transformWithHoist(
`{{ foo }} `,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.hoists.length).toBe(0)
@@ -545,8 +545,8 @@ describe('compiler: hoistStatic transform', () => {
``,
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).toBe(1)
@@ -554,8 +554,8 @@ describe('compiler: hoistStatic transform', () => {
expect(
generate(root, {
mode: 'module',
- prefixIdentifiers: true
- }).code
+ prefixIdentifiers: true,
+ }).code,
).toMatchSnapshot()
})
@@ -564,8 +564,8 @@ describe('compiler: hoistStatic transform', () => {
``,
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).toBe(1)
@@ -573,14 +573,14 @@ describe('compiler: hoistStatic transform', () => {
expect(
generate(root, {
mode: 'module',
- prefixIdentifiers: true
- }).code
+ prefixIdentifiers: true,
+ }).code,
).toMatchSnapshot()
})
test('should NOT hoist keyed template v-for with plain element child', () => {
const root = transformWithHoist(
- `
`
+ `
`,
)
expect(root.hoists.length).toBe(0)
expect(generate(root).code).toMatchSnapshot()
@@ -588,10 +588,22 @@ describe('compiler: hoistStatic transform', () => {
test('should NOT hoist SVG with directives', () => {
const root = transformWithHoist(
- ``
+ ``,
)
expect(root.hoists.length).toBe(2)
expect(generate(root).code).toMatchSnapshot()
})
+
+ test('clone hoisted array children in HMR mode', () => {
+ const root = transformWithHoist(`
`, {
+ hmr: true,
+ })
+ expect(root.hoists.length).toBe(2)
+ expect(root.codegenNode).toMatchObject({
+ children: {
+ content: '[..._hoisted_2]',
+ },
+ })
+ })
})
})
diff --git a/packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts b/packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts
index 96a60bd1d42..fa711051c18 100644
--- a/packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/noopDirectiveTransform.spec.ts
@@ -1,9 +1,9 @@
import {
+ type ElementNode,
+ type VNodeCall,
+ noopDirectiveTransform,
baseParse as parse,
transform,
- ElementNode,
- noopDirectiveTransform,
- VNodeCall
} from '../../src'
import { transformElement } from '../../src/transforms/transformElement'
@@ -13,8 +13,8 @@ describe('compiler: noop directive transform', () => {
transform(ast, {
nodeTransforms: [transformElement],
directiveTransforms: {
- noop: noopDirectiveTransform
- }
+ noop: noopDirectiveTransform,
+ },
})
const node = ast.children[0] as ElementNode
// As v-noop adds no properties the codegen should be identical to
diff --git a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts
index 335a30704ad..5d3f92ced18 100644
--- a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts
@@ -1,37 +1,36 @@
-import { vi } from 'vitest'
import {
- CompilerOptions,
+ BindingTypes,
+ type CompilerOptions,
+ ErrorCodes,
+ type NodeTransform,
+ baseCompile,
baseParse as parse,
transform,
- ErrorCodes,
- BindingTypes,
- NodeTransform,
transformExpression,
- baseCompile
} from '../../src'
import {
- RESOLVE_COMPONENT,
+ BASE_TRANSITION,
CREATE_VNODE,
+ GUARD_REACTIVE_PROPS,
+ KEEP_ALIVE,
MERGE_PROPS,
+ NORMALIZE_CLASS,
+ NORMALIZE_PROPS,
+ NORMALIZE_STYLE,
+ RESOLVE_COMPONENT,
RESOLVE_DIRECTIVE,
- TO_HANDLERS,
- helperNameMap,
- TELEPORT,
RESOLVE_DYNAMIC_COMPONENT,
SUSPENSE,
- KEEP_ALIVE,
- BASE_TRANSITION,
- NORMALIZE_CLASS,
- NORMALIZE_STYLE,
- NORMALIZE_PROPS,
- GUARD_REACTIVE_PROPS
+ TELEPORT,
+ TO_HANDLERS,
+ helperNameMap,
} from '../../src/runtimeHelpers'
import {
+ type DirectiveNode,
NodeTypes,
+ type RootNode,
+ type VNodeCall,
createObjectProperty,
- DirectiveNode,
- RootNode,
- VNodeCall
} from '../../src/ast'
import { transformElement } from '../../src/transforms/transformElement'
import { transformStyle } from '../../../compiler-dom/src/transforms/transformStyle'
@@ -43,7 +42,7 @@ import { transformText } from '../../src/transforms/transformText'
function parseWithElementTransform(
template: string,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
): {
root: RootNode
node: VNodeCall
@@ -53,14 +52,14 @@ function parseWithElementTransform(
const ast = parse(`${template}
`, options)
transform(ast, {
nodeTransforms: [transformElement, transformText],
- ...options
+ ...options,
})
const codegenNode = (ast as any).children[0].children[0]
.codegenNode as VNodeCall
expect(codegenNode.type).toBe(NodeTypes.VNODE_CALL)
return {
root: ast,
- node: codegenNode
+ node: codegenNode,
}
}
@@ -69,8 +68,8 @@ function parseWithBind(template: string, options?: CompilerOptions) {
...options,
directiveTransforms: {
...options?.directiveTransforms,
- bind: transformBind
- }
+ bind: transformBind,
+ },
})
}
@@ -83,7 +82,7 @@ describe('compiler: element transform', () => {
test('resolve implicitly self-referencing component', () => {
const { root } = parseWithElementTransform(` `, {
- filename: `/foo/bar/Example.vue?vue&type=template`
+ filename: `/foo/bar/Example.vue?vue&type=template`,
})
expect(root.helpers).toContain(RESOLVE_COMPONENT)
expect(root.components).toContain(`Example__self`)
@@ -92,8 +91,8 @@ describe('compiler: element transform', () => {
test('resolve component from setup bindings', () => {
const { root, node } = parseWithElementTransform(` `, {
bindingMetadata: {
- Example: BindingTypes.SETUP_MAYBE_REF
- }
+ Example: BindingTypes.SETUP_MAYBE_REF,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`$setup["Example"]`)
@@ -103,8 +102,8 @@ describe('compiler: element transform', () => {
const { root, node } = parseWithElementTransform(` `, {
inline: true,
bindingMetadata: {
- Example: BindingTypes.SETUP_MAYBE_REF
- }
+ Example: BindingTypes.SETUP_MAYBE_REF,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`_unref(Example)`)
@@ -114,8 +113,8 @@ describe('compiler: element transform', () => {
const { root, node } = parseWithElementTransform(` `, {
inline: true,
bindingMetadata: {
- Example: BindingTypes.SETUP_CONST
- }
+ Example: BindingTypes.SETUP_CONST,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`Example`)
@@ -124,8 +123,8 @@ describe('compiler: element transform', () => {
test('resolve namespaced component from setup bindings', () => {
const { root, node } = parseWithElementTransform(` `, {
bindingMetadata: {
- Foo: BindingTypes.SETUP_MAYBE_REF
- }
+ Foo: BindingTypes.SETUP_MAYBE_REF,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`$setup["Foo"].Example`)
@@ -135,8 +134,8 @@ describe('compiler: element transform', () => {
const { root, node } = parseWithElementTransform(` `, {
inline: true,
bindingMetadata: {
- Foo: BindingTypes.SETUP_MAYBE_REF
- }
+ Foo: BindingTypes.SETUP_MAYBE_REF,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`_unref(Foo).Example`)
@@ -146,20 +145,42 @@ describe('compiler: element transform', () => {
const { root, node } = parseWithElementTransform(` `, {
inline: true,
bindingMetadata: {
- Foo: BindingTypes.SETUP_CONST
- }
+ Foo: BindingTypes.SETUP_CONST,
+ },
})
expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
expect(node.tag).toBe(`Foo.Example`)
})
+ test('resolve namespaced component from props bindings (inline)', () => {
+ const { root, node } = parseWithElementTransform(` `, {
+ inline: true,
+ bindingMetadata: {
+ Foo: BindingTypes.PROPS,
+ },
+ })
+ expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
+ expect(node.tag).toBe(`_unref(__props["Foo"]).Example`)
+ })
+
+ test('resolve namespaced component from props bindings (non-inline)', () => {
+ const { root, node } = parseWithElementTransform(` `, {
+ inline: false,
+ bindingMetadata: {
+ Foo: BindingTypes.PROPS,
+ },
+ })
+ expect(root.helpers).not.toContain(RESOLVE_COMPONENT)
+ expect(node.tag).toBe('_unref($props["Foo"]).Example')
+ })
+
test('do not resolve component from non-script-setup bindings', () => {
const bindingMetadata = {
- Example: BindingTypes.SETUP_MAYBE_REF
+ Example: BindingTypes.SETUP_MAYBE_REF,
}
Object.defineProperty(bindingMetadata, '__isScriptSetup', { value: false })
const { root } = parseWithElementTransform(` `, {
- bindingMetadata
+ bindingMetadata,
})
expect(root.helpers).toContain(RESOLVE_COMPONENT)
expect(root.components).toContain(`Example`)
@@ -171,9 +192,9 @@ describe('compiler: element transform', () => {
tag: `"div"`,
props: createObjectMatcher({
id: 'foo',
- class: 'bar'
+ class: 'bar',
}),
- children: undefined
+ children: undefined,
})
})
@@ -183,7 +204,7 @@ describe('compiler: element transform', () => {
expect(node).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
children: [
{
@@ -191,10 +212,10 @@ describe('compiler: element transform', () => {
tag: 'span',
codegenNode: {
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
- }
- }
- ]
+ tag: `"span"`,
+ },
+ },
+ ],
})
})
@@ -210,10 +231,10 @@ describe('compiler: element transform', () => {
tag: 'span',
codegenNode: {
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
- }
- }
- ]
+ tag: `"span"`,
+ },
+ },
+ ],
})
})
@@ -235,17 +256,17 @@ describe('compiler: element transform', () => {
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
- }
- ]
- }
- ]
+ content: `obj`,
+ },
+ ],
+ },
+ ],
})
})
test('v-bind="obj" after static prop', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -254,19 +275,19 @@ describe('compiler: element transform', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
- }
- ]
+ content: `obj`,
+ },
+ ],
})
})
test('v-bind="obj" before static prop', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -276,18 +297,18 @@ describe('compiler: element transform', () => {
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
+ content: `obj`,
},
createObjectMatcher({
- id: 'foo'
- })
- ]
+ id: 'foo',
+ }),
+ ],
})
})
test('v-bind="obj" between static props', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -296,22 +317,22 @@ describe('compiler: element transform', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
+ content: `obj`,
},
createObjectMatcher({
- class: 'bar'
- })
- ]
+ class: 'bar',
+ }),
+ ],
})
})
test('v-on="obj"', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -320,7 +341,7 @@ describe('compiler: element transform', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -328,21 +349,21 @@ describe('compiler: element transform', () => {
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
+ content: `obj`,
},
- `true`
- ]
+ `true`,
+ ],
},
createObjectMatcher({
- class: 'bar'
- })
- ]
+ class: 'bar',
+ }),
+ ],
})
})
test('v-on="obj" on component', () => {
const { root, node } = parseWithElementTransform(
- ` `
+ ` `,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -351,7 +372,7 @@ describe('compiler: element transform', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -359,20 +380,20 @@ describe('compiler: element transform', () => {
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
- }
- ]
+ content: `obj`,
+ },
+ ],
},
createObjectMatcher({
- class: 'bar'
- })
- ]
+ class: 'bar',
+ }),
+ ],
})
})
test('v-on="obj" + v-bind="obj"', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(MERGE_PROPS)
@@ -381,7 +402,7 @@ describe('compiler: element transform', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- id: 'foo'
+ id: 'foo',
}),
{
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -389,16 +410,16 @@ describe('compiler: element transform', () => {
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `handlers`
+ content: `handlers`,
},
- `true`
- ]
+ `true`,
+ ],
},
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `obj`
- }
- ]
+ content: `obj`,
+ },
+ ],
})
})
@@ -408,15 +429,15 @@ describe('compiler: element transform', () => {
expect(node).toMatchObject({
tag: `"template"`,
props: createObjectMatcher({
- id: 'foo'
- })
+ id: 'foo',
+ }),
})
})
test('should handle with normal children', () => {
function assert(tag: string) {
const { root, node } = parseWithElementTransform(
- `<${tag} target="#foo"> ${tag}>`
+ `<${tag} target="#foo"> ${tag}>`,
)
expect(root.components.length).toBe(0)
expect(root.helpers).toContain(TELEPORT)
@@ -424,7 +445,7 @@ describe('compiler: element transform', () => {
expect(node).toMatchObject({
tag: TELEPORT,
props: createObjectMatcher({
- target: '#foo'
+ target: '#foo',
}),
children: [
{
@@ -432,10 +453,10 @@ describe('compiler: element transform', () => {
tag: 'span',
codegenNode: {
type: NodeTypes.VNODE_CALL,
- tag: `"span"`
- }
- }
- ]
+ tag: `"span"`,
+ },
+ },
+ ],
})
}
@@ -446,7 +467,7 @@ describe('compiler: element transform', () => {
test('should handle ', () => {
function assert(tag: string, content: string, hasFallback?: boolean) {
const { root, node } = parseWithElementTransform(
- `<${tag}>${content}${tag}>`
+ `<${tag}>${content}${tag}>`,
)
expect(root.components.length).toBe(0)
expect(root.helpers).toContain(SUSPENSE)
@@ -457,19 +478,19 @@ describe('compiler: element transform', () => {
children: hasFallback
? createObjectMatcher({
default: {
- type: NodeTypes.JS_FUNCTION_EXPRESSION
+ type: NodeTypes.JS_FUNCTION_EXPRESSION,
},
fallback: {
- type: NodeTypes.JS_FUNCTION_EXPRESSION
+ type: NodeTypes.JS_FUNCTION_EXPRESSION,
},
- _: `[1 /* STABLE */]`
+ _: `[1 /* STABLE */]`,
})
: createObjectMatcher({
default: {
- type: NodeTypes.JS_FUNCTION_EXPRESSION
+ type: NodeTypes.JS_FUNCTION_EXPRESSION,
},
- _: `[1 /* STABLE */]`
- })
+ _: `[1 /* STABLE */]`,
+ }),
})
}
@@ -478,7 +499,7 @@ describe('compiler: element transform', () => {
assert(
`suspense`,
`foo fallback `,
- true
+ true,
)
})
@@ -486,7 +507,7 @@ describe('compiler: element transform', () => {
function assert(tag: string) {
const root = parse(`<${tag}> ${tag}>
`)
transform(root, {
- nodeTransforms: [transformElement, transformText]
+ nodeTransforms: [transformElement, transformText],
})
expect(root.components.length).toBe(0)
expect(root.helpers).toContain(KEEP_ALIVE)
@@ -499,7 +520,7 @@ describe('compiler: element transform', () => {
// keep-alive should not compile content to slots
children: [{ type: NodeTypes.ELEMENT, tag: 'span' }],
// should get a dynamic slots flag to force updates
- patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS)
+ patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS),
})
}
@@ -510,7 +531,7 @@ describe('compiler: element transform', () => {
test('should handle ', () => {
function assert(tag: string) {
const { root, node } = parseWithElementTransform(
- `<${tag}> ${tag}>`
+ `<${tag}> ${tag}>`,
)
expect(root.components.length).toBe(0)
expect(root.helpers).toContain(BASE_TRANSITION)
@@ -520,10 +541,10 @@ describe('compiler: element transform', () => {
props: undefined,
children: createObjectMatcher({
default: {
- type: NodeTypes.JS_FUNCTION_EXPRESSION
+ type: NodeTypes.JS_FUNCTION_EXPRESSION,
},
- _: `[1 /* STABLE */]`
- })
+ _: `[1 /* STABLE */]`,
+ }),
})
}
@@ -536,8 +557,8 @@ describe('compiler: element transform', () => {
parseWithElementTransform(`
`, { onError })
expect(onError.mock.calls[0]).toMatchObject([
{
- code: ErrorCodes.X_V_BIND_NO_EXPRESSION
- }
+ code: ErrorCodes.X_V_BIND_NO_EXPRESSION,
+ },
])
})
@@ -548,10 +569,10 @@ describe('compiler: element transform', () => {
foo(dir) {
_dir = dir
return {
- props: [createObjectProperty(dir.arg!, dir.exp!)]
+ props: [createObjectProperty(dir.arg!, dir.exp!)],
}
- }
- }
+ },
+ },
})
expect(node.props).toMatchObject({
@@ -560,9 +581,9 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.JS_PROPERTY,
key: _dir!.arg,
- value: _dir!.exp
- }
- ]
+ value: _dir!.exp,
+ },
+ ],
})
// should factor in props returned by custom directive transforms
// in patchFlag analysis
@@ -578,11 +599,11 @@ describe('compiler: element transform', () => {
foo() {
return {
props: [],
- needRuntime: true
+ needRuntime: true,
}
- }
- }
- }
+ },
+ },
+ },
)
expect(root.helpers).toContain(RESOLVE_DIRECTIVE)
expect(root.directives).toContain(`foo`)
@@ -602,18 +623,18 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `hello`,
- isStatic: false
+ isStatic: false,
},
// arg
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `bar`,
- isStatic: true
- }
- ]
- }
- ]
- }
+ isStatic: true,
+ },
+ ],
+ },
+ ],
+ },
})
})
@@ -625,24 +646,24 @@ describe('compiler: element transform', () => {
foo() {
return {
props: [],
- needRuntime: CREATE_VNODE
+ needRuntime: CREATE_VNODE,
}
- }
- }
- }
+ },
+ },
+ },
)
expect(root.helpers).toContain(CREATE_VNODE)
expect(root.helpers).not.toContain(RESOLVE_DIRECTIVE)
expect(root.directives.length).toBe(0)
expect(node.directives!.elements[0].elements[0]).toBe(
- `_${helperNameMap[CREATE_VNODE]}`
+ `_${helperNameMap[CREATE_VNODE]}`,
)
})
test('runtime directives', () => {
const { root, node } = parseWithElementTransform(
- `
`
+ `
`,
)
expect(root.helpers).toContain(RESOLVE_DIRECTIVE)
expect(root.directives).toContain(`foo`)
@@ -655,7 +676,7 @@ describe('compiler: element transform', () => {
elements: [
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
- elements: [`_directive_foo`]
+ elements: [`_directive_foo`],
},
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -664,9 +685,9 @@ describe('compiler: element transform', () => {
// exp
{
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `x`
- }
- ]
+ content: `x`,
+ },
+ ],
},
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -676,13 +697,13 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `y`,
- isStatic: false
+ isStatic: false,
},
// arg
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `arg`,
- isStatic: false
+ isStatic: false,
},
// modifiers
{
@@ -693,33 +714,33 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `mod`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `true`,
- isStatic: false
- }
+ isStatic: false,
+ },
},
{
type: NodeTypes.JS_PROPERTY,
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `mad`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `true`,
- isStatic: false
- }
- }
- ]
- }
- ]
- }
- ]
- }
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
})
})
@@ -728,9 +749,9 @@ describe('compiler: element transform', () => {
`
`,
{
directiveTransforms: {
- on: transformOn
- }
- }
+ on: transformOn,
+ },
+ },
)
expect(node.props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
@@ -740,7 +761,7 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `onClick`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -748,17 +769,17 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `a`,
- isStatic: false
+ isStatic: false,
},
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `b`,
- isStatic: false
- }
- ]
- }
- }
- ]
+ isStatic: false,
+ },
+ ],
+ },
+ },
+ ],
})
})
@@ -768,9 +789,9 @@ describe('compiler: element transform', () => {
{
nodeTransforms: [transformStyle, transformElement],
directiveTransforms: {
- bind: transformBind
- }
- }
+ bind: transformBind,
+ },
+ },
)
expect(root.helpers).toContain(NORMALIZE_STYLE)
expect(node.props).toMatchObject({
@@ -781,7 +802,7 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `style`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -793,19 +814,19 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `{"color":"green"}`,
- isStatic: false
+ isStatic: false,
},
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `{ color: 'red' }`,
- isStatic: false
- }
- ]
- }
- ]
- }
- }
- ]
+ isStatic: false,
+ },
+ ],
+ },
+ ],
+ },
+ },
+ ],
})
})
@@ -815,10 +836,10 @@ describe('compiler: element transform', () => {
{
nodeTransforms: [transformExpression, transformStyle, transformElement],
directiveTransforms: {
- bind: transformBind
+ bind: transformBind,
},
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.helpers).toContain(NORMALIZE_STYLE)
expect(node.props).toMatchObject({
@@ -829,14 +850,14 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `style`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: NORMALIZE_STYLE
- }
- }
- ]
+ callee: NORMALIZE_STYLE,
+ },
+ },
+ ],
})
})
@@ -846,10 +867,10 @@ describe('compiler: element transform', () => {
{
nodeTransforms: [transformExpression, transformStyle, transformElement],
directiveTransforms: {
- bind: transformBind
+ bind: transformBind,
},
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
expect(root.helpers).toContain(NORMALIZE_STYLE)
expect(node.props).toMatchObject({
@@ -860,14 +881,14 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `style`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: NORMALIZE_STYLE
- }
- }
- ]
+ callee: NORMALIZE_STYLE,
+ },
+ },
+ ],
})
})
@@ -876,9 +897,9 @@ describe('compiler: element transform', () => {
`
`,
{
directiveTransforms: {
- bind: transformBind
- }
- }
+ bind: transformBind,
+ },
+ },
)
expect(root.helpers).toContain(NORMALIZE_CLASS)
expect(node.props).toMatchObject({
@@ -889,7 +910,7 @@ describe('compiler: element transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `class`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -901,19 +922,19 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `foo`,
- isStatic: true
+ isStatic: true,
},
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `{ bar: isBar }`,
- isStatic: false
- }
- ]
- }
- ]
- }
- }
- ]
+ isStatic: false,
+ },
+ ],
+ },
+ ],
+ },
+ },
+ ],
})
})
@@ -948,10 +969,10 @@ describe('compiler: element transform', () => {
test('CLASS + STYLE + PROPS', () => {
const { node } = parseWithBind(
- `
`
+ `
`,
)
expect(node.patchFlag).toBe(
- genFlagText([PatchFlags.CLASS, PatchFlags.STYLE, PatchFlags.PROPS])
+ genFlagText([PatchFlags.CLASS, PatchFlags.STYLE, PatchFlags.PROPS]),
)
expect(node.dynamicProps).toBe(`["foo", "baz"]`)
})
@@ -959,7 +980,7 @@ describe('compiler: element transform', () => {
// should treat `class` and `style` as PROPS
test('PROPS on component', () => {
const { node } = parseWithBind(
- ` `
+ ` `,
)
expect(node.patchFlag).toBe(genFlagText(PatchFlags.PROPS))
expect(node.dynamicProps).toBe(`["id", "class", "style"]`)
@@ -977,7 +998,7 @@ describe('compiler: element transform', () => {
test('FULL_PROPS (w/ others)', () => {
const { node } = parseWithBind(
- `
`
+ `
`,
)
expect(node.patchFlag).toBe(genFlagText(PatchFlags.FULL_PROPS))
})
@@ -1000,7 +1021,7 @@ describe('compiler: element transform', () => {
test('NEED_PATCH (vnode hooks)', () => {
const root = baseCompile(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
}).ast
const node = (root as any).children[0].codegenNode
expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH))
@@ -1010,8 +1031,8 @@ describe('compiler: element transform', () => {
const { node } = parseWithElementTransform(` `, {
inline: true,
bindingMetadata: {
- input: BindingTypes.SETUP_REF
- }
+ input: BindingTypes.SETUP_REF,
+ },
})
expect(node.props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
@@ -1020,31 +1041,31 @@ describe('compiler: element transform', () => {
type: NodeTypes.JS_PROPERTY,
key: {
content: 'ref_key',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'input',
- isStatic: true
- }
+ isStatic: true,
+ },
},
{
type: NodeTypes.JS_PROPERTY,
key: {
content: 'ref',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'input',
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
})
test('script setup inline mode template ref (binding does not exist)', () => {
const { node } = parseWithElementTransform(` `, {
- inline: true
+ inline: true,
})
expect(node.props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
@@ -1053,14 +1074,14 @@ describe('compiler: element transform', () => {
type: NodeTypes.JS_PROPERTY,
key: {
content: 'ref',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'input',
- isStatic: true
- }
- }
- ]
+ isStatic: true,
+ },
+ },
+ ],
})
})
@@ -1069,8 +1090,8 @@ describe('compiler: element transform', () => {
inline: true,
bindingMetadata: {
msg: BindingTypes.PROPS,
- ref: BindingTypes.SETUP_CONST
- }
+ ref: BindingTypes.SETUP_CONST,
+ },
})
expect(node.props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
@@ -1079,23 +1100,23 @@ describe('compiler: element transform', () => {
type: NodeTypes.JS_PROPERTY,
key: {
content: 'ref',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'msg',
- isStatic: true
- }
- }
- ]
+ isStatic: true,
+ },
+ },
+ ],
})
})
- test('HYDRATE_EVENTS', () => {
+ test('NEED_HYDRATION for v-on', () => {
// ignore click events (has dedicated fast path)
const { node } = parseWithElementTransform(`
`, {
directiveTransforms: {
- on: transformOn
- }
+ on: transformOn,
+ },
})
// should only have props flag
expect(node.patchFlag).toBe(genFlagText(PatchFlags.PROPS))
@@ -1104,29 +1125,55 @@ describe('compiler: element transform', () => {
`
`,
{
directiveTransforms: {
- on: transformOn
- }
- }
+ on: transformOn,
+ },
+ },
+ )
+ expect(node2.patchFlag).toBe(
+ genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]),
+ )
+ })
+
+ test('NEED_HYDRATION for v-bind.prop', () => {
+ const { node } = parseWithBind(`
`)
+ expect(node.patchFlag).toBe(
+ genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]),
)
+
+ const { node: node2 } = parseWithBind(`
`)
expect(node2.patchFlag).toBe(
- genFlagText([PatchFlags.PROPS, PatchFlags.HYDRATE_EVENTS])
+ genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]),
)
})
// #5870
- test('HYDRATE_EVENTS on dynamic component', () => {
+ test('NEED_HYDRATION on dynamic component', () => {
const { node } = parseWithElementTransform(
` `,
{
directiveTransforms: {
- on: transformOn
- }
- }
+ on: transformOn,
+ },
+ },
)
expect(node.patchFlag).toBe(
- genFlagText([PatchFlags.PROPS, PatchFlags.HYDRATE_EVENTS])
+ genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]),
)
})
+
+ test('should not have PROPS patchflag for constant v-on handlers', () => {
+ const { node } = parseWithElementTransform(`
`, {
+ prefixIdentifiers: true,
+ bindingMetadata: {
+ foo: BindingTypes.SETUP_CONST,
+ },
+ directiveTransforms: {
+ on: transformOn,
+ },
+ })
+ // should only have hydration flag
+ expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_HYDRATION))
+ })
})
describe('dynamic component', () => {
@@ -1141,10 +1188,10 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo',
- isStatic: true
- }
- ]
- }
+ isStatic: true,
+ },
+ ],
+ },
})
})
@@ -1159,10 +1206,10 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo',
- isStatic: true
- }
- ]
- }
+ isStatic: true,
+ },
+ ],
+ },
})
})
@@ -1177,43 +1224,31 @@ describe('compiler: element transform', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo',
- isStatic: false
- }
- ]
- }
+ isStatic: false,
+ },
+ ],
+ },
})
})
- // TODO remove in 3.4
- test('v-is', () => {
- const { node, root } = parseWithBind(`
`)
- expect(root.helpers).toContain(RESOLVE_DYNAMIC_COMPONENT)
+ test('is casting', () => {
+ const { node, root } = parseWithBind(`
`)
+ expect(root.helpers).toContain(RESOLVE_COMPONENT)
expect(node).toMatchObject({
- tag: {
- callee: RESOLVE_DYNAMIC_COMPONENT,
- arguments: [
- {
- type: NodeTypes.SIMPLE_EXPRESSION,
- content: `'foo'`,
- isStatic: false
- }
- ]
- },
- // should skip v-is runtime check
- directives: undefined
+ type: NodeTypes.VNODE_CALL,
+ tag: '_component_foo',
})
- expect('v-is="component-name" has been deprecated').toHaveBeenWarned()
})
// #3934
test('normal component with is prop', () => {
const { node, root } = parseWithBind(` `, {
- isNativeTag: () => false
+ isNativeTag: () => false,
})
expect(root.helpers).toContain(RESOLVE_COMPONENT)
expect(root.helpers).not.toContain(RESOLVE_DYNAMIC_COMPONENT)
expect(node).toMatchObject({
- tag: '_component_custom_input'
+ tag: '_component_custom_input',
})
})
})
@@ -1221,12 +1256,12 @@ describe('compiler: element transform', () => {
test(' should be forced into blocks', () => {
const ast = parse(`
`)
transform(ast, {
- nodeTransforms: [transformElement]
+ nodeTransforms: [transformElement],
})
expect((ast as any).children[0].children[0].codegenNode).toMatchObject({
type: NodeTypes.VNODE_CALL,
tag: `"svg"`,
- isBlock: true
+ isBlock: true,
})
})
@@ -1238,7 +1273,7 @@ describe('compiler: element transform', () => {
test('force block for inline before-update handlers w/ children', () => {
expect(
parseWithElementTransform(`hello
`).node
- .isBlock
+ .isBlock,
).toBe(true)
})
@@ -1246,12 +1281,12 @@ describe('compiler: element transform', () => {
test('element with dynamic keys should be forced into blocks', () => {
const ast = parse(``)
transform(ast, {
- nodeTransforms: [transformElement]
+ nodeTransforms: [transformElement],
})
expect((ast as any).children[0].children[0].codegenNode).toMatchObject({
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
- isBlock: true
+ isBlock: true,
})
})
@@ -1266,23 +1301,23 @@ describe('compiler: element transform', () => {
prop.type === NodeTypes.ATTRIBUTE &&
prop.name === 'id' &&
prop.value &&
- prop.value.content === 'foo'
+ prop.value.content === 'foo',
)
) {
context.replaceNode({
...node,
- tag: 'span'
+ tag: 'span',
})
}
}
const ast = parse(``)
transform(ast, {
- nodeTransforms: [transformElement, transformText, customNodeTransform]
+ nodeTransforms: [transformElement, transformText, customNodeTransform],
})
expect((ast as any).children[0].children[0].codegenNode).toMatchObject({
type: NodeTypes.VNODE_CALL,
tag: '"span"',
- isBlock: false
+ isBlock: false,
})
})
})
diff --git a/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts b/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
index 7614bc0f386..b8207e7d42f 100644
--- a/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
@@ -1,15 +1,14 @@
-import { vi } from 'vitest'
import {
+ BindingTypes,
+ type CompilerOptions,
+ ConstantTypes,
+ type DirectiveNode,
+ type ElementNode,
+ type InterpolationNode,
+ NodeTypes,
+ baseCompile,
baseParse as parse,
transform,
- ElementNode,
- DirectiveNode,
- NodeTypes,
- CompilerOptions,
- InterpolationNode,
- ConstantTypes,
- BindingTypes,
- baseCompile
} from '../../src'
import { transformIf } from '../../src/transforms/vIf'
import { transformExpression } from '../../src/transforms/transformExpression'
@@ -17,13 +16,13 @@ import { PatchFlagNames, PatchFlags } from '../../../shared/src'
function parseWithExpressionTransform(
template: string,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
) {
- const ast = parse(template)
+ const ast = parse(template, options)
transform(ast, {
prefixIdentifiers: true,
nodeTransforms: [transformIf, transformExpression],
- ...options
+ ...options,
})
return ast.children[0]
}
@@ -33,7 +32,7 @@ describe('compiler: expression transform', () => {
const node = parseWithExpressionTransform(`{{ foo }}`) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.foo`
+ content: `_ctx.foo`,
})
})
@@ -41,34 +40,34 @@ describe('compiler: expression transform', () => {
const node = parseWithExpressionTransform(`{{}}`) as InterpolationNode
const node2 = parseWithExpressionTransform(`{{ }}`) as InterpolationNode
const node3 = parseWithExpressionTransform(
- `{{ }}
`
+ `{{ }}
`,
) as ElementNode
const objectToBeMatched = {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: ``
+ content: ``,
}
expect(node.content).toMatchObject(objectToBeMatched)
expect(node2.content).toMatchObject(objectToBeMatched)
expect((node3.children[0] as InterpolationNode).content).toMatchObject(
- objectToBeMatched
+ objectToBeMatched,
)
})
test('interpolation (children)', () => {
const el = parseWithExpressionTransform(
- `{{ foo }}
`
+ `{{ foo }}
`,
) as ElementNode
const node = el.children[0] as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.foo`
+ content: `_ctx.foo`,
})
})
test('interpolation (complex)', () => {
const el = parseWithExpressionTransform(
- `{{ foo + bar(baz.qux) }}
`
+ `{{ foo + bar(baz.qux) }}
`,
) as ElementNode
const node = el.children[0] as InterpolationNode
expect(node.content).toMatchObject({
@@ -81,46 +80,46 @@ describe('compiler: expression transform', () => {
{ content: `_ctx.baz` },
`.`,
{ content: `qux` },
- `)`
- ]
+ `)`,
+ ],
})
})
test('directive value', () => {
const node = parseWithExpressionTransform(
- `
`
+ `
`,
) as ElementNode
const arg = (node.props[0] as DirectiveNode).arg!
expect(arg).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `arg`
+ content: `arg`,
})
const exp = (node.props[0] as DirectiveNode).exp!
expect(exp).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.baz`
+ content: `_ctx.baz`,
})
})
test('dynamic directive arg', () => {
const node = parseWithExpressionTransform(
- `
`
+ `
`,
) as ElementNode
const arg = (node.props[0] as DirectiveNode).arg!
expect(arg).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.arg`
+ content: `_ctx.arg`,
})
const exp = (node.props[0] as DirectiveNode).exp!
expect(exp).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.baz`
+ content: `_ctx.baz`,
})
})
test('should prefix complex expressions', () => {
const node = parseWithExpressionTransform(
- `{{ foo(baz + 1, { key: kuz }) }}`
+ `{{ foo(baz + 1, { key: kuz }) }}`,
) as InterpolationNode
// should parse into compound expression
expect(node.content).toMatchObject({
@@ -129,76 +128,57 @@ describe('compiler: expression transform', () => {
{
content: `_ctx.foo`,
loc: {
- source: `foo`,
- start: {
- offset: 3,
- line: 1,
- column: 4
- },
- end: {
- offset: 6,
- line: 1,
- column: 7
- }
- }
+ start: { offset: 3, line: 1, column: 4 },
+ end: { offset: 6, line: 1, column: 7 },
+ },
},
`(`,
{
content: `_ctx.baz`,
loc: {
- source: `baz`,
- start: {
- offset: 7,
- line: 1,
- column: 8
- },
- end: {
- offset: 10,
- line: 1,
- column: 11
- }
- }
+ start: { offset: 7, line: 1, column: 8 },
+ end: { offset: 10, line: 1, column: 11 },
+ },
},
` + 1, { key: `,
{
content: `_ctx.kuz`,
loc: {
- source: `kuz`,
- start: {
- offset: 23,
- line: 1,
- column: 24
- },
- end: {
- offset: 26,
- line: 1,
- column: 27
- }
- }
+ start: { offset: 23, line: 1, column: 24 },
+ end: { offset: 26, line: 1, column: 27 },
+ },
},
- ` })`
- ]
+ ` })`,
+ ],
})
})
test('should not prefix whitelisted globals', () => {
const node = parseWithExpressionTransform(
- `{{ Math.max(1, 2) }}`
+ `{{ Math.max(1, 2) }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: `Math` }, `.`, { content: `max` }, `(1, 2)`]
+ children: [{ content: `Math` }, `.`, { content: `max` }, `(1, 2)`],
+ })
+
+ expect(
+ (parseWithExpressionTransform(`{{ new Error() }}`) as InterpolationNode)
+ .content,
+ ).toMatchObject({
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: ['new ', { content: 'Error' }, '()'],
})
})
test('should not prefix reserved literals', () => {
function assert(exp: string) {
const node = parseWithExpressionTransform(
- `{{ ${exp} }}`
+ `{{ ${exp} }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: exp
+ content: exp,
})
}
assert(`true`)
@@ -209,7 +189,7 @@ describe('compiler: expression transform', () => {
test('should not prefix id of a function declaration', () => {
const node = parseWithExpressionTransform(
- `{{ function foo() { return bar } }}`
+ `{{ function foo() { return bar } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -218,14 +198,14 @@ describe('compiler: expression transform', () => {
{ content: `foo` },
`() { return `,
{ content: `_ctx.bar` },
- ` }`
- ]
+ ` }`,
+ ],
})
})
test('should not prefix params of a function expression', () => {
const node = parseWithExpressionTransform(
- `{{ foo => foo + bar }}`
+ `{{ foo => foo + bar }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -234,14 +214,14 @@ describe('compiler: expression transform', () => {
` => `,
{ content: `foo` },
` + `,
- { content: `_ctx.bar` }
- ]
+ { content: `_ctx.bar` },
+ ],
})
})
test('should prefix default value of a function expression param', () => {
const node = parseWithExpressionTransform(
- `{{ (foo = baz) => foo + bar }}`
+ `{{ (foo = baz) => foo + bar }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -253,14 +233,14 @@ describe('compiler: expression transform', () => {
`) => `,
{ content: `foo` },
` + `,
- { content: `_ctx.bar` }
- ]
+ { content: `_ctx.bar` },
+ ],
})
})
test('should not prefix function param destructuring', () => {
const node = parseWithExpressionTransform(
- `{{ ({ foo }) => foo + bar }}`
+ `{{ ({ foo }) => foo + bar }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -270,14 +250,14 @@ describe('compiler: expression transform', () => {
` }) => `,
{ content: `foo` },
` + `,
- { content: `_ctx.bar` }
- ]
+ { content: `_ctx.bar` },
+ ],
})
})
test('function params should not affect out of scope identifiers', () => {
const node = parseWithExpressionTransform(
- `{{ { a: foo => foo, b: foo } }}`
+ `{{ { a: foo => foo, b: foo } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -288,14 +268,14 @@ describe('compiler: expression transform', () => {
{ content: `foo` },
`, b: `,
{ content: `_ctx.foo` },
- ` }`
- ]
+ ` }`,
+ ],
})
})
test('should prefix default value of function param destructuring', () => {
const node = parseWithExpressionTransform(
- `{{ ({ foo = bar }) => foo + bar }}`
+ `{{ ({ foo = bar }) => foo + bar }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -307,13 +287,13 @@ describe('compiler: expression transform', () => {
` }) => `,
{ content: `foo` },
` + `,
- { content: `_ctx.bar` }
- ]
+ { content: `_ctx.bar` },
+ ],
})
})
test('should not prefix an object property key', () => {
const node = parseWithExpressionTransform(
- `{{ { foo() { baz() }, value: bar } }}`
+ `{{ { foo() { baz() }, value: bar } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -322,24 +302,24 @@ describe('compiler: expression transform', () => {
{ content: `_ctx.baz` },
`() }, value: `,
{ content: `_ctx.bar` },
- ` }`
- ]
+ ` }`,
+ ],
})
})
test('should not duplicate object key with same name as value', () => {
const node = parseWithExpressionTransform(
- `{{ { foo: foo } }}`
+ `{{ { foo: foo } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ foo: `, { content: `_ctx.foo` }, ` }`]
+ children: [`{ foo: `, { content: `_ctx.foo` }, ` }`],
})
})
test('should prefix a computed object property key', () => {
const node = parseWithExpressionTransform(
- `{{ { [foo]: bar } }}`
+ `{{ { [foo]: bar } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -348,24 +328,24 @@ describe('compiler: expression transform', () => {
{ content: `_ctx.foo` },
`]: `,
{ content: `_ctx.bar` },
- ` }`
- ]
+ ` }`,
+ ],
})
})
test('should prefix object property shorthand value', () => {
const node = parseWithExpressionTransform(
- `{{ { foo } }}`
+ `{{ { foo } }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ foo: `, { content: `_ctx.foo` }, ` }`]
+ children: [`{ foo: `, { content: `_ctx.foo` }, ` }`],
})
})
test('should not prefix id in a member expression', () => {
const node = parseWithExpressionTransform(
- `{{ foo.bar.baz }}`
+ `{{ foo.bar.baz }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -374,14 +354,14 @@ describe('compiler: expression transform', () => {
`.`,
{ content: `bar` },
`.`,
- { content: `baz` }
- ]
+ { content: `baz` },
+ ],
})
})
test('should prefix computed id in a member expression', () => {
const node = parseWithExpressionTransform(
- `{{ foo[bar][baz] }}`
+ `{{ foo[bar][baz] }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -391,8 +371,8 @@ describe('compiler: expression transform', () => {
{ content: `_ctx.bar` },
`][`,
{ content: '_ctx.baz' },
- `]`
- ]
+ `]`,
+ ],
})
})
@@ -400,23 +380,23 @@ describe('compiler: expression transform', () => {
const onError = vi.fn()
parseWithExpressionTransform(`{{ a( }}`, { onError })
expect(onError.mock.calls[0][0].message).toMatch(
- `Error parsing JavaScript expression: Unexpected token`
+ `Error parsing JavaScript expression: Unexpected token`,
)
})
test('should prefix in assignment', () => {
const node = parseWithExpressionTransform(
- `{{ x = 1 }}`
+ `{{ x = 1 }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: `_ctx.x` }, ` = 1`]
+ children: [{ content: `_ctx.x` }, ` = 1`],
})
})
test('should prefix in assignment pattern', () => {
const node = parseWithExpressionTransform(
- `{{ { x, y: [z] } = obj }}`
+ `{{ { x, y: [z] } = obj }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -426,47 +406,47 @@ describe('compiler: expression transform', () => {
`, y: [`,
{ content: `_ctx.z` },
`] } = `,
- { content: `_ctx.obj` }
- ]
+ { content: `_ctx.obj` },
+ ],
})
})
// #8295
test('should treat floating point number literals as constant', () => {
const node = parseWithExpressionTransform(
- `{{ [1, 2.1] }}`
+ `{{ [1, 2.1] }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
- constType: ConstantTypes.CAN_STRINGIFY
+ constType: ConstantTypes.CAN_STRINGIFY,
})
})
describe('ES Proposals support', () => {
test('bigInt', () => {
const node = parseWithExpressionTransform(
- `{{ 13000n }}`
+ `{{ 13000n }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
content: `13000n`,
isStatic: false,
- constType: ConstantTypes.CAN_STRINGIFY
+ constType: ConstantTypes.CAN_STRINGIFY,
})
})
test('nullish coalescing', () => {
const node = parseWithExpressionTransform(
- `{{ a ?? b }}`
+ `{{ a ?? b }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: `_ctx.a` }, ` ?? `, { content: `_ctx.b` }]
+ children: [{ content: `_ctx.a` }, ` ?? `, { content: `_ctx.b` }],
})
})
test('optional chaining', () => {
const node = parseWithExpressionTransform(
- `{{ a?.b?.c }}`
+ `{{ a?.b?.c }}`,
) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -475,8 +455,8 @@ describe('compiler: expression transform', () => {
`?.`,
{ content: `b` },
`?.`,
- { content: `c` }
- ]
+ { content: `c` },
+ ],
})
})
@@ -487,14 +467,18 @@ describe('compiler: expression transform', () => {
[
'pipelineOperator',
{
- proposal: 'minimal'
- }
- ]
- ]
+ proposal: 'minimal',
+ },
+ ],
+ ],
}) as InterpolationNode
expect(node.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: `_ctx.a` }, ` |> `, { content: `_ctx.uppercase` }]
+ children: [
+ { content: `_ctx.a` },
+ ` |> `,
+ { content: `_ctx.uppercase` },
+ ],
})
})
})
@@ -507,53 +491,92 @@ describe('compiler: expression transform', () => {
data: BindingTypes.DATA,
options: BindingTypes.OPTIONS,
reactive: BindingTypes.SETUP_REACTIVE_CONST,
- literal: BindingTypes.LITERAL_CONST
+ literal: BindingTypes.LITERAL_CONST,
+ isNaN: BindingTypes.SETUP_REF,
}
function compileWithBindingMetadata(
template: string,
- options?: CompilerOptions
+ options?: CompilerOptions,
) {
return baseCompile(template, {
prefixIdentifiers: true,
bindingMetadata,
- ...options
+ ...options,
})
}
test('non-inline mode', () => {
const { code } = compileWithBindingMetadata(
- `{{ props }} {{ setup }} {{ data }} {{ options }}
`
+ `{{ props }} {{ setup }} {{ data }} {{ options }} {{ isNaN }}
`,
)
expect(code).toMatch(`$props.props`)
expect(code).toMatch(`$setup.setup`)
+ expect(code).toMatch(`$setup.isNaN`)
expect(code).toMatch(`$data.data`)
expect(code).toMatch(`$options.options`)
expect(code).toMatch(`_ctx, _cache, $props, $setup, $data, $options`)
expect(code).toMatchSnapshot()
})
+ test('should not prefix temp variable of for...in', () => {
+ const { code } = compileWithBindingMetadata(
+ ` {
+ for (const x in list) {
+ log(x)
+ }
+ }"/>`,
+ )
+ expect(code).not.toMatch(`_ctx.x`)
+ expect(code).toMatchSnapshot()
+ })
+
+ test('should not prefix temp variable of for...of', () => {
+ const { code } = compileWithBindingMetadata(
+ `
{
+ for (const x of list) {
+ log(x)
+ }
+ }"/>`,
+ )
+ expect(code).not.toMatch(`_ctx.x`)
+ expect(code).toMatchSnapshot()
+ })
+
+ test('should not prefix temp variable of for loop', () => {
+ const { code } = compileWithBindingMetadata(
+ `
{
+ for (let i = 0; i < list.length; i++) {
+ log(i)
+ }
+ }"/>`,
+ )
+ expect(code).not.toMatch(`_ctx.i`)
+ expect(code).toMatchSnapshot()
+ })
+
test('inline mode', () => {
const { code } = compileWithBindingMetadata(
- `
{{ props }} {{ setup }} {{ setupConst }} {{ data }} {{ options }}
`,
- { inline: true }
+ `
{{ props }} {{ setup }} {{ setupConst }} {{ data }} {{ options }} {{ isNaN }}
`,
+ { inline: true },
)
expect(code).toMatch(`__props.props`)
expect(code).toMatch(`_unref(setup)`)
expect(code).toMatch(`_toDisplayString(setupConst)`)
expect(code).toMatch(`_ctx.data`)
expect(code).toMatch(`_ctx.options`)
+ expect(code).toMatch(`isNaN.value`)
expect(code).toMatchSnapshot()
})
test('literal const handling', () => {
const { code } = compileWithBindingMetadata(`
{{ literal }}
`, {
- inline: true
+ inline: true,
})
expect(code).toMatch(`toDisplayString(literal)`)
// #7973 should skip patch for literal const
expect(code).not.toMatch(
- `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
+ `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`,
)
})
@@ -562,17 +585,17 @@ describe('compiler: expression transform', () => {
expect(code).toMatch(`toDisplayString($setup.literal)`)
// #7973 should skip patch for literal const
expect(code).not.toMatch(
- `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
+ `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`,
)
})
test('reactive const handling', () => {
const { code } = compileWithBindingMetadata(`
{{ reactive }}
`, {
- inline: true
+ inline: true,
})
// #7973 should not skip patch for reactive const
expect(code).toMatch(
- `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
+ `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`,
)
})
})
diff --git a/packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts b/packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
index e3863f1edf9..f8809ab6a7b 100644
--- a/packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
@@ -1,11 +1,10 @@
-import { vi } from 'vitest'
import {
- CompilerOptions,
+ type CompilerOptions,
+ type ElementNode,
+ ErrorCodes,
+ NodeTypes,
baseParse as parse,
transform,
- ElementNode,
- NodeTypes,
- ErrorCodes
} from '../../src'
import { transformElement } from '../../src/transforms/transformElement'
import { transformOn } from '../../src/transforms/vOn'
@@ -20,13 +19,13 @@ function parseWithSlots(template: string, options: CompilerOptions = {}) {
nodeTransforms: [
...(options.prefixIdentifiers ? [transformExpression] : []),
transformSlotOutlet,
- transformElement
+ transformElement,
],
directiveTransforms: {
on: transformOn,
- bind: transformBind
+ bind: transformBind,
},
- ...options
+ ...options,
})
return ast
}
@@ -37,7 +36,7 @@ describe('compiler: transform
outlets', () => {
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: [`$slots`, `"default"`]
+ arguments: [`$slots`, `"default"`],
})
})
@@ -46,7 +45,7 @@ describe('compiler: transform outlets', () => {
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: [`$slots`, `"foo"`]
+ arguments: [`$slots`, `"foo"`],
})
})
@@ -60,15 +59,15 @@ describe('compiler: transform outlets', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `foo`,
- isStatic: false
- }
- ]
+ isStatic: false,
+ },
+ ],
})
})
test('dynamically named slot outlet w/ prefixIdentifiers: true', () => {
const ast = parseWithSlots(` `, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -81,23 +80,23 @@ describe('compiler: transform outlets', () => {
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `_ctx.foo`,
- isStatic: false
+ isStatic: false,
},
` + `,
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: `_ctx.bar`,
- isStatic: false
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ ],
+ },
+ ],
})
})
test('default slot outlet with props', () => {
const ast = parseWithSlots(
- ` `
+ ` `,
)
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -111,36 +110,36 @@ describe('compiler: transform outlets', () => {
{
key: {
content: `foo`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `bar`,
- isStatic: true
- }
+ isStatic: true,
+ },
},
{
key: {
content: `baz`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `qux`,
- isStatic: false
- }
+ isStatic: false,
+ },
},
{
key: {
content: `fooBar`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `foo-bar`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
@@ -159,26 +158,26 @@ describe('compiler: transform outlets', () => {
{
key: {
content: `foo`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `bar`,
- isStatic: true
- }
+ isStatic: true,
+ },
},
{
key: {
content: `baz`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `qux`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
@@ -197,26 +196,26 @@ describe('compiler: transform outlets', () => {
{
key: {
content: `foo`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `bar`,
- isStatic: true
- }
+ isStatic: true,
+ },
},
{
key: {
content: `baz`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `qux`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
@@ -235,11 +234,11 @@ describe('compiler: transform outlets', () => {
returns: [
{
type: NodeTypes.ELEMENT,
- tag: `div`
- }
- ]
- }
- ]
+ tag: `div`,
+ },
+ ],
+ },
+ ],
})
})
@@ -258,11 +257,11 @@ describe('compiler: transform outlets', () => {
returns: [
{
type: NodeTypes.ELEMENT,
- tag: `div`
- }
- ]
- }
- ]
+ tag: `div`,
+ },
+ ],
+ },
+ ],
})
})
@@ -280,14 +279,14 @@ describe('compiler: transform outlets', () => {
{
key: {
content: `foo`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `bar`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
},
{
type: NodeTypes.JS_FUNCTION_EXPRESSION,
@@ -295,11 +294,11 @@ describe('compiler: transform outlets', () => {
returns: [
{
type: NodeTypes.ELEMENT,
- tag: `div`
- }
- ]
- }
- ]
+ tag: `div`,
+ },
+ ],
+ },
+ ],
})
})
@@ -317,14 +316,14 @@ describe('compiler: transform outlets', () => {
{
key: {
content: `foo`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `bar`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
},
{
type: NodeTypes.JS_FUNCTION_EXPRESSION,
@@ -332,11 +331,11 @@ describe('compiler: transform outlets', () => {
returns: [
{
type: NodeTypes.ELEMENT,
- tag: `div`
- }
- ]
- }
- ]
+ tag: `div`,
+ },
+ ],
+ },
+ ],
})
})
@@ -345,11 +344,11 @@ describe('compiler: transform outlets', () => {
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: [`$slots`, `"default"`, `{}`, `undefined`, `true`]
+ arguments: [`$slots`, `"default"`, `{}`, `undefined`, `true`],
})
const fallback = parseWithSlots(`fallback `, {
slotted: false,
- scopeId: 'foo'
+ scopeId: 'foo',
})
const child = {
@@ -358,14 +357,14 @@ describe('compiler: transform outlets', () => {
returns: [
{
type: NodeTypes.TEXT,
- content: `fallback`
- }
- ]
+ content: `fallback`,
+ },
+ ],
}
expect((fallback.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: [`$slots`, `"default"`, `{}`, child, `true`]
+ arguments: [`$slots`, `"default"`, `{}`, child, `true`],
})
})
@@ -377,18 +376,17 @@ describe('compiler: transform outlets', () => {
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET,
loc: {
- source: `v-foo`,
start: {
offset: index,
line: 1,
- column: index + 1
+ column: index + 1,
},
end: {
offset: index + 5,
line: 1,
- column: index + 6
- }
- }
+ column: index + 6,
+ },
+ },
})
})
})
diff --git a/packages/compiler-core/__tests__/transforms/transformText.spec.ts b/packages/compiler-core/__tests__/transforms/transformText.spec.ts
index 6e321d145e5..1a6d6916a73 100644
--- a/packages/compiler-core/__tests__/transforms/transformText.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/transformText.spec.ts
@@ -1,11 +1,11 @@
import {
- CompilerOptions,
- baseParse as parse,
- transform,
+ type CompilerOptions,
+ type ElementNode,
+ type ForNode,
NodeTypes,
generate,
- ForNode,
- ElementNode
+ baseParse as parse,
+ transform,
} from '../../src'
import { transformFor } from '../../src/transforms/vFor'
import { transformText } from '../../src/transforms/transformText'
@@ -22,9 +22,9 @@ function transformWithTextOpt(template: string, options: CompilerOptions = {}) {
transformFor,
...(options.prefixIdentifiers ? [transformExpression] : []),
transformElement,
- transformText
+ transformText,
],
- ...options
+ ...options,
})
return ast
}
@@ -35,8 +35,8 @@ describe('compiler: transform text', () => {
expect(root.children[0]).toMatchObject({
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -51,8 +51,8 @@ describe('compiler: transform text', () => {
` + `,
{ type: NodeTypes.TEXT, content: ` bar ` },
` + `,
- { type: NodeTypes.INTERPOLATION, content: { content: `baz` } }
- ]
+ { type: NodeTypes.INTERPOLATION, content: { content: `baz` } },
+ ],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -75,12 +75,12 @@ describe('compiler: transform text', () => {
` + `,
{ type: NodeTypes.TEXT, content: ` bar ` },
` + `,
- { type: NodeTypes.INTERPOLATION, content: { content: `baz` } }
- ]
+ { type: NodeTypes.INTERPOLATION, content: { content: `baz` } },
+ ],
},
- genFlagText(PatchFlags.TEXT)
- ]
- }
+ genFlagText(PatchFlags.TEXT),
+ ],
+ },
})
expect(root.children[2].type).toBe(NodeTypes.ELEMENT)
expect(generate(root).code).toMatchSnapshot()
@@ -99,11 +99,11 @@ describe('compiler: transform text', () => {
arguments: [
{
type: NodeTypes.TEXT,
- content: `hello`
- }
+ content: `hello`,
+ },
// should have no flag
- ]
- }
+ ],
+ },
})
expect(root.children[2].type).toBe(NodeTypes.ELEMENT)
expect(generate(root).code).toMatchSnapshot()
@@ -111,7 +111,7 @@ describe('compiler: transform text', () => {
test('consecutive text mixed with elements', () => {
const root = transformWithTextOpt(
- `
{{ foo }} bar {{ baz }}
hello
`
+ `
{{ foo }} bar {{ baz }}
hello
`,
)
expect(root.children.length).toBe(5)
expect(root.children[0].type).toBe(NodeTypes.ELEMENT)
@@ -128,12 +128,12 @@ describe('compiler: transform text', () => {
` + `,
{ type: NodeTypes.TEXT, content: ` bar ` },
` + `,
- { type: NodeTypes.INTERPOLATION, content: { content: `baz` } }
- ]
+ { type: NodeTypes.INTERPOLATION, content: { content: `baz` } },
+ ],
},
- genFlagText(PatchFlags.TEXT)
- ]
- }
+ genFlagText(PatchFlags.TEXT),
+ ],
+ },
})
expect(root.children[2].type).toBe(NodeTypes.ELEMENT)
expect(root.children[3]).toMatchObject({
@@ -144,10 +144,10 @@ describe('compiler: transform text', () => {
arguments: [
{
type: NodeTypes.TEXT,
- content: `hello`
- }
- ]
- }
+ content: `hello`,
+ },
+ ],
+ },
})
expect(root.children[4].type).toBe(NodeTypes.ELEMENT)
expect(generate(root).code).toMatchSnapshot()
@@ -155,21 +155,21 @@ describe('compiler: transform text', () => {
test('', () => {
const root = transformWithTextOpt(
- `foo `
+ `foo `,
)
expect(root.children[0].type).toBe(NodeTypes.FOR)
const forNode = root.children[0] as ForNode
// should convert template v-for text children because they are inside
// fragments
expect(forNode.children[0]).toMatchObject({
- type: NodeTypes.TEXT_CALL
+ type: NodeTypes.TEXT_CALL,
})
expect(generate(root).code).toMatchSnapshot()
})
test('with prefixIdentifiers: true', () => {
const root = transformWithTextOpt(`{{ foo }} bar {{ baz + qux }}`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(root.children.length).toBe(1)
expect(root.children[0]).toMatchObject({
@@ -183,15 +183,15 @@ describe('compiler: transform text', () => {
type: NodeTypes.INTERPOLATION,
content: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: `_ctx.baz` }, ` + `, { content: `_ctx.qux` }]
- }
- }
- ]
+ children: [{ content: `_ctx.baz` }, ` + `, { content: `_ctx.qux` }],
+ },
+ },
+ ],
})
expect(
generate(root, {
- prefixIdentifiers: true
- }).code
+ prefixIdentifiers: true,
+ }).code,
).toMatchSnapshot()
})
@@ -210,12 +210,12 @@ describe('compiler: transform text', () => {
type: NodeTypes.INTERPOLATION,
content: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: 'foo'
- }
+ content: 'foo',
+ },
},
- genFlagText(PatchFlags.TEXT)
- ]
- }
+ genFlagText(PatchFlags.TEXT),
+ ],
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
diff --git a/packages/compiler-core/__tests__/transforms/vBind.spec.ts b/packages/compiler-core/__tests__/transforms/vBind.spec.ts
index ea5bdcf3d52..84b9ee8ca47 100644
--- a/packages/compiler-core/__tests__/transforms/vBind.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vBind.spec.ts
@@ -1,38 +1,37 @@
-import { vi } from 'vitest'
import {
- baseParse as parse,
- transform,
- ElementNode,
- ObjectExpression,
- CompilerOptions,
+ type CallExpression,
+ type CompilerOptions,
+ type ElementNode,
ErrorCodes,
- VNodeCall,
NodeTypes,
- CallExpression
+ type ObjectExpression,
+ type VNodeCall,
+ baseParse as parse,
+ transform,
} from '../../src'
import { transformBind } from '../../src/transforms/vBind'
import { transformElement } from '../../src/transforms/transformElement'
import {
CAMELIZE,
+ NORMALIZE_PROPS,
helperNameMap,
- NORMALIZE_PROPS
} from '../../src/runtimeHelpers'
import { transformExpression } from '../../src/transforms/transformExpression'
function parseWithVBind(
template: string,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
): ElementNode {
const ast = parse(template)
transform(ast, {
nodeTransforms: [
...(options.prefixIdentifiers ? [transformExpression] : []),
- transformElement
+ transformElement,
],
directiveTransforms: {
- bind: transformBind
+ bind: transformBind,
},
- ...options
+ ...options,
})
return ast.children[0] as ElementNode
}
@@ -48,13 +47,13 @@ describe('compiler: transform v-bind', () => {
loc: {
start: {
line: 1,
- column: 13
+ column: 13,
},
end: {
line: 1,
- column: 15
- }
- }
+ column: 15,
+ },
+ },
},
value: {
content: `id`,
@@ -62,14 +61,52 @@ describe('compiler: transform v-bind', () => {
loc: {
start: {
line: 1,
- column: 17
+ column: 17,
},
end: {
line: 1,
- column: 19
- }
- }
- }
+ column: 19,
+ },
+ },
+ },
+ })
+ })
+
+ test('no expression', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `id`,
+ isStatic: true,
+ loc: {
+ start: { line: 1, column: 13, offset: 12 },
+ end: { line: 1, column: 15, offset: 14 },
+ },
+ },
+ value: {
+ content: `id`,
+ isStatic: false,
+ loc: {
+ start: { line: 1, column: 13, offset: 12 },
+ end: { line: 1, column: 15, offset: 14 },
+ },
+ },
+ })
+ })
+
+ test('no expression (shorthand)', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `id`,
+ isStatic: true,
+ },
+ value: {
+ content: `id`,
+ isStatic: false,
+ },
})
})
@@ -86,45 +123,45 @@ describe('compiler: transform v-bind', () => {
{
key: {
content: `id || ""`,
- isStatic: false
+ isStatic: false,
},
value: {
content: `id`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
- test('should error if no expression', () => {
+ test('should error if empty expression', () => {
const onError = vi.fn()
- const node = parseWithVBind(`
`, { onError })
+ const node = parseWithVBind(`
`, { onError })
const props = (node.codegenNode as VNodeCall).props as ObjectExpression
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_BIND_NO_EXPRESSION,
loc: {
start: {
line: 1,
- column: 6
+ column: 6,
},
end: {
line: 1,
- column: 16
- }
- }
+ column: 19,
+ },
+ },
})
expect(props.properties[0]).toMatchObject({
key: {
content: `arg`,
- isStatic: true
+ isStatic: true,
},
value: {
content: ``,
- isStatic: true
- }
+ isStatic: true,
+ },
})
})
@@ -134,12 +171,27 @@ describe('compiler: transform v-bind', () => {
expect(props.properties[0]).toMatchObject({
key: {
content: `fooBar`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `id`,
- isStatic: false
- }
+ isStatic: false,
+ },
+ })
+ })
+
+ test('.camel modifier w/ no expression', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `fooBar`,
+ isStatic: true,
+ },
+ value: {
+ content: `fooBar`,
+ isStatic: false,
+ },
})
})
@@ -156,22 +208,22 @@ describe('compiler: transform v-bind', () => {
{
key: {
content: `_${helperNameMap[CAMELIZE]}(foo || "")`,
- isStatic: false
+ isStatic: false,
},
value: {
content: `id`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
test('.camel modifier w/ dynamic arg + prefixIdentifiers', () => {
const node = parseWithVBind(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const props = (node.codegenNode as VNodeCall).props as CallExpression
expect(props).toMatchObject({
@@ -191,17 +243,17 @@ describe('compiler: transform v-bind', () => {
{ content: `_ctx.bar` },
`)`,
`) || ""`,
- `)`
- ]
+ `)`,
+ ],
},
value: {
content: `_ctx.id`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
@@ -211,12 +263,27 @@ describe('compiler: transform v-bind', () => {
expect(props.properties[0]).toMatchObject({
key: {
content: `.fooBar`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `id`,
- isStatic: false
- }
+ isStatic: false,
+ },
+ })
+ })
+
+ test('.prop modifier w/ no expression', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `.fooBar`,
+ isStatic: true,
+ },
+ value: {
+ content: `fooBar`,
+ isStatic: false,
+ },
})
})
@@ -233,22 +300,22 @@ describe('compiler: transform v-bind', () => {
{
key: {
content: '`.${fooBar || ""}`',
- isStatic: false
+ isStatic: false,
},
value: {
content: `id`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
test('.prop modifier w/ dynamic arg + prefixIdentifiers', () => {
const node = parseWithVBind(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const props = (node.codegenNode as VNodeCall).props as CallExpression
expect(props).toMatchObject({
@@ -268,17 +335,17 @@ describe('compiler: transform v-bind', () => {
{ content: `_ctx.bar` },
`)`,
`) || ""`,
- `)`
- ]
+ `)`,
+ ],
},
value: {
content: `_ctx.id`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
})
@@ -288,12 +355,27 @@ describe('compiler: transform v-bind', () => {
expect(props.properties[0]).toMatchObject({
key: {
content: `.fooBar`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `id`,
- isStatic: false
- }
+ isStatic: false,
+ },
+ })
+ })
+
+ test('.prop modifier (shortband) w/ no expression', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `.fooBar`,
+ isStatic: true,
+ },
+ value: {
+ content: `fooBar`,
+ isStatic: false,
+ },
})
})
@@ -303,12 +385,27 @@ describe('compiler: transform v-bind', () => {
expect(props.properties[0]).toMatchObject({
key: {
content: `^foo-bar`,
- isStatic: true
+ isStatic: true,
},
value: {
content: `id`,
- isStatic: false
- }
+ isStatic: false,
+ },
+ })
+ })
+
+ test('.attr modifier w/ no expression', () => {
+ const node = parseWithVBind(`
`)
+ const props = (node.codegenNode as VNodeCall).props as ObjectExpression
+ expect(props.properties[0]).toMatchObject({
+ key: {
+ content: `^foo-bar`,
+ isStatic: true,
+ },
+ value: {
+ content: `fooBar`,
+ isStatic: false,
+ },
})
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vFor.spec.ts b/packages/compiler-core/__tests__/transforms/vFor.spec.ts
index b07272ef72b..fb3d7dc7fb8 100644
--- a/packages/compiler-core/__tests__/transforms/vFor.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vFor.spec.ts
@@ -1,5 +1,4 @@
-import { vi } from 'vitest'
-import { baseParse as parse } from '../../src/parse'
+import { baseParse as parse } from '../../src/parser'
import { transform } from '../../src/transform'
import { transformIf } from '../../src/transforms/vIf'
import { transformFor } from '../../src/transforms/vFor'
@@ -8,23 +7,23 @@ import { transformElement } from '../../src/transforms/transformElement'
import { transformSlotOutlet } from '../../src/transforms/transformSlotOutlet'
import { transformExpression } from '../../src/transforms/transformExpression'
import {
- ForNode,
+ ConstantTypes,
+ type ElementNode,
+ type ForCodegenNode,
+ type ForNode,
+ type InterpolationNode,
NodeTypes,
- SimpleExpressionNode,
- ElementNode,
- InterpolationNode,
- ForCodegenNode,
- ConstantTypes
+ type SimpleExpressionNode,
} from '../../src/ast'
import { ErrorCodes } from '../../src/errors'
-import { CompilerOptions, generate } from '../../src'
+import { type CompilerOptions, generate } from '../../src'
import { FRAGMENT, RENDER_LIST, RENDER_SLOT } from '../../src/runtimeHelpers'
import { PatchFlags } from '@vue/shared'
import { createObjectMatcher, genFlagText } from '../testUtils'
function parseWithForTransform(
template: string,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
) {
const ast = parse(template, options)
transform(ast, {
@@ -33,16 +32,16 @@ function parseWithForTransform(
transformFor,
...(options.prefixIdentifiers ? [transformExpression] : []),
transformSlotOutlet,
- transformElement
+ transformElement,
],
directiveTransforms: {
- bind: transformBind
+ bind: transformBind,
},
- ...options
+ ...options,
})
return {
root: ast,
- node: ast.children[0] as ForNode & { codegenNode: ForCodegenNode }
+ node: ast.children[0] as ForNode & { codegenNode: ForCodegenNode },
}
}
@@ -50,7 +49,7 @@ describe('compiler: v-for', () => {
describe('transform', () => {
test('number expression', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).toBeUndefined()
@@ -60,7 +59,7 @@ describe('compiler: v-for', () => {
test('value', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).toBeUndefined()
@@ -70,31 +69,31 @@ describe('compiler: v-for', () => {
test('object de-structured value', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).toBeUndefined()
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe(
- '{ id, value }'
+ '{ id, value }',
)
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
})
test('array de-structured value', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).toBeUndefined()
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe(
- '[ id, value ]'
+ '[ id, value ]',
)
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
})
test('value and key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).not.toBeUndefined()
expect((forNode.keyAlias as SimpleExpressionNode).content).toBe('key')
@@ -105,13 +104,13 @@ describe('compiler: v-for', () => {
test('value, key and index', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).not.toBeUndefined()
expect((forNode.keyAlias as SimpleExpressionNode).content).toBe('key')
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe('value')
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -119,12 +118,12 @@ describe('compiler: v-for', () => {
test('skipped key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe('value')
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -132,12 +131,12 @@ describe('compiler: v-for', () => {
test('skipped value and key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect(forNode.valueAlias).toBeUndefined()
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -145,7 +144,7 @@ describe('compiler: v-for', () => {
test('unbracketed value', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).toBeUndefined()
@@ -155,7 +154,7 @@ describe('compiler: v-for', () => {
test('unbracketed value and key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).not.toBeUndefined()
expect((forNode.keyAlias as SimpleExpressionNode).content).toBe('key')
@@ -166,13 +165,13 @@ describe('compiler: v-for', () => {
test('unbracketed value, key and index', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).not.toBeUndefined()
expect((forNode.keyAlias as SimpleExpressionNode).content).toBe('key')
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe('value')
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -180,12 +179,12 @@ describe('compiler: v-for', () => {
test('unbracketed skipped key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe('value')
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -193,12 +192,12 @@ describe('compiler: v-for', () => {
test('unbracketed skipped value and key', () => {
const { node: forNode } = parseWithForTransform(
- ' '
+ ' ',
)
expect(forNode.keyAlias).toBeUndefined()
expect(forNode.objectIndexAlias).not.toBeUndefined()
expect((forNode.objectIndexAlias as SimpleExpressionNode).content).toBe(
- 'index'
+ 'index',
)
expect(forNode.valueAlias).toBeUndefined()
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
@@ -213,8 +212,8 @@ describe('compiler: v-for', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_NO_EXPRESSION
- })
+ code: ErrorCodes.X_V_FOR_NO_EXPRESSION,
+ }),
)
})
@@ -225,8 +224,8 @@ describe('compiler: v-for', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -237,8 +236,8 @@ describe('compiler: v-for', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -249,8 +248,8 @@ describe('compiler: v-for', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -261,8 +260,8 @@ describe('compiler: v-for', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -273,14 +272,14 @@ describe('compiler: v-for', () => {
`,
- { onError }
+ { onError },
)
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_FOR_TEMPLATE_KEY_PLACEMENT
- })
+ code: ErrorCodes.X_V_FOR_TEMPLATE_KEY_PLACEMENT,
+ }),
)
// should not warn on nested v-for keys
@@ -289,7 +288,7 @@ describe('compiler: v-for', () => {
`,
- { onError }
+ { onError },
)
expect(onError).toHaveBeenCalledTimes(1)
})
@@ -316,7 +315,7 @@ describe('compiler: v-for', () => {
expect(forNode.source.loc.start.column).toBe(itemsOffset + 1)
expect(forNode.source.loc.end.line).toBe(1)
expect(forNode.source.loc.end.column).toBe(
- itemsOffset + 1 + `items`.length
+ itemsOffset + 1 + `items`.length,
)
})
@@ -340,7 +339,7 @@ describe('compiler: v-for', () => {
expect(forNode.source.loc.start.column).toBe(itemsOffset + 1)
expect(forNode.source.loc.end.line).toBe(1)
expect(forNode.source.loc.end.column).toBe(
- itemsOffset + 1 + `items`.length
+ itemsOffset + 1 + `items`.length,
)
})
@@ -364,7 +363,7 @@ describe('compiler: v-for', () => {
expect(forNode.source.loc.start.column).toBe(itemsOffset + 1)
expect(forNode.source.loc.end.line).toBe(1)
expect(forNode.source.loc.end.column).toBe(
- itemsOffset + 1 + `items`.length
+ itemsOffset + 1 + `items`.length,
)
})
@@ -406,7 +405,7 @@ describe('compiler: v-for', () => {
expect(forNode.source.loc.start.column).toBe(itemsOffset + 1)
expect(forNode.source.loc.end.line).toBe(1)
expect(forNode.source.loc.end.column).toBe(
- itemsOffset + 1 + `items`.length
+ itemsOffset + 1 + `items`.length,
)
})
@@ -439,7 +438,7 @@ describe('compiler: v-for', () => {
expect(forNode.source.loc.start.column).toBe(itemsOffset + 1)
expect(forNode.source.loc.end.line).toBe(1)
expect(forNode.source.loc.end.column).toBe(
- itemsOffset + 1 + `items`.length
+ itemsOffset + 1 + `items`.length,
)
})
})
@@ -447,18 +446,18 @@ describe('compiler: v-for', () => {
describe('prefixIdentifiers: true', () => {
test('should prefix v-for source', () => {
const { node } = parseWithForTransform(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(node.source).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.list`
+ content: `_ctx.list`,
})
})
test('should prefix v-for source w/ complex expression', () => {
const { node } = parseWithForTransform(
`
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(node.source).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -468,31 +467,31 @@ describe('compiler: v-for', () => {
{ content: `concat` },
`([`,
{ content: `_ctx.foo` },
- `])`
- ]
+ `])`,
+ ],
})
})
test('should not prefix v-for alias', () => {
const { node } = parseWithForTransform(
`{{ i }}{{ j }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const div = node.children[0] as ElementNode
expect((div.children[0] as InterpolationNode).content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `i`
+ content: `i`,
})
expect((div.children[1] as InterpolationNode).content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.j`
+ content: `_ctx.j`,
})
})
test('should not prefix v-for aliases (multiple)', () => {
const { node } = parseWithForTransform(
`{{ i + j + k }}{{ l }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const div = node.children[0] as ElementNode
expect((div.children[0] as InterpolationNode).content).toMatchObject({
@@ -502,23 +501,23 @@ describe('compiler: v-for', () => {
` + `,
{ content: `j` },
` + `,
- { content: `k` }
- ]
+ { content: `k` },
+ ],
})
expect((div.children[1] as InterpolationNode).content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.l`
+ content: `_ctx.l`,
})
})
test('should prefix id outside of v-for', () => {
const { node } = parseWithForTransform(
``,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect((node.children[1] as InterpolationNode).content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.i`
+ content: `_ctx.i`,
})
})
@@ -527,7 +526,7 @@ describe('compiler: v-for', () => {
``,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const outerDiv = node.children[0] as ElementNode
const innerFor = outerDiv.children[0] as ForNode
@@ -535,7 +534,7 @@ describe('compiler: v-for', () => {
.children[0] as InterpolationNode
expect(innerExp.content).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [{ content: 'i' }, ` + `, { content: `_ctx.j` }]
+ children: [{ content: 'i' }, ` + `, { content: `_ctx.j` }],
})
// when an inner v-for shadows a variable of an outer v-for and exit,
@@ -543,7 +542,7 @@ describe('compiler: v-for', () => {
const outerExp = outerDiv.children[1] as InterpolationNode
expect(outerExp.content).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `i`
+ content: `i`,
})
})
@@ -552,7 +551,7 @@ describe('compiler: v-for', () => {
`
{{ foo + bar + baz + qux + quux }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(node.valueAlias!).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
@@ -565,8 +564,8 @@ describe('compiler: v-for', () => {
{ content: `qux` },
` = `,
{ content: `_ctx.quux` },
- `] }`
- ]
+ `] }`,
+ ],
})
const div = node.children[0] as ElementNode
expect((div.children[0] as InterpolationNode).content).toMatchObject({
@@ -580,17 +579,17 @@ describe('compiler: v-for', () => {
` + `,
{ content: `qux` },
` + `,
- { content: `_ctx.quux` }
- ]
+ { content: `_ctx.quux` },
+ ],
})
})
test('element v-for key expression prefixing', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
'test
',
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const innerBlock = codegenNode.children.arguments[1].returns
expect(innerBlock).toMatchObject({
@@ -605,20 +604,20 @@ describe('compiler: v-for', () => {
`(`,
// should NOT prefix in scope variables
{ content: `item` },
- `)`
- ]
- }
- })
+ `)`,
+ ],
+ },
+ }),
})
})
// #2085
test('template v-for key expression prefixing', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
'test ',
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const innerBlock = codegenNode.children.arguments[1].returns
expect(innerBlock).toMatchObject({
@@ -633,19 +632,19 @@ describe('compiler: v-for', () => {
`(`,
// should NOT prefix in scope variables
{ content: `item` },
- `)`
- ]
- }
- })
+ `)`,
+ ],
+ },
+ }),
})
})
test('template v-for key no prefixing on attribute key', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
'test ',
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
const innerBlock = codegenNode.children.arguments[1].returns
expect(innerBlock).toMatchObject({
@@ -654,9 +653,9 @@ describe('compiler: v-for', () => {
props: createObjectMatcher({
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: 'key'
- }
- })
+ content: 'key',
+ },
+ }),
})
})
})
@@ -666,7 +665,7 @@ describe('compiler: v-for', () => {
node: ForCodegenNode,
keyed: boolean = false,
customReturn: boolean = false,
- disableTracking: boolean = true
+ disableTracking: boolean = true,
) {
expect(node).toMatchObject({
type: NodeTypes.VNODE_CALL,
@@ -675,8 +674,8 @@ describe('compiler: v-for', () => {
patchFlag: !disableTracking
? genFlagText(PatchFlags.STABLE_FRAGMENT)
: keyed
- ? genFlagText(PatchFlags.KEYED_FRAGMENT)
- : genFlagText(PatchFlags.UNKEYED_FRAGMENT),
+ ? genFlagText(PatchFlags.KEYED_FRAGMENT)
+ : genFlagText(PatchFlags.UNKEYED_FRAGMENT),
children: {
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_LIST,
@@ -688,32 +687,34 @@ describe('compiler: v-for', () => {
? {}
: {
type: NodeTypes.VNODE_CALL,
- isBlock: disableTracking
- }
- }
- ]
- }
+ isBlock: disableTracking,
+ },
+ },
+ ],
+ },
})
const renderListArgs = node.children.arguments
return {
source: renderListArgs[0] as SimpleExpressionNode,
params: (renderListArgs[1] as any).params,
returns: (renderListArgs[1] as any).returns,
- innerVNodeCall: customReturn ? null : (renderListArgs[1] as any).returns
+ innerVNodeCall: customReturn
+ ? null
+ : (renderListArgs[1] as any).returns,
}
}
test('basic v-for', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
params: [{ content: `item` }],
innerVNodeCall: {
- tag: `"span"`
- }
+ tag: `"span"`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -721,11 +722,11 @@ describe('compiler: v-for', () => {
test('value + key + index', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
- params: [{ content: `item` }, { content: `key` }, { content: `index` }]
+ params: [{ content: `item` }, { content: `key` }, { content: `index` }],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -733,11 +734,11 @@ describe('compiler: v-for', () => {
test('skipped value', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
- params: [{ content: `_` }, { content: `key` }, { content: `index` }]
+ params: [{ content: `_` }, { content: `key` }, { content: `index` }],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -745,11 +746,11 @@ describe('compiler: v-for', () => {
test('skipped key', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
- params: [{ content: `item` }, { content: `__` }, { content: `index` }]
+ params: [{ content: `item` }, { content: `__` }, { content: `index` }],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -757,11 +758,11 @@ describe('compiler: v-for', () => {
test('skipped value & key', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
- params: [{ content: `_` }, { content: `__` }, { content: `index` }]
+ params: [{ content: `_` }, { content: `__` }, { content: `index` }],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -769,9 +770,9 @@ describe('compiler: v-for', () => {
test('v-for with constant expression', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform('{{item}}
', {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(
@@ -779,8 +780,8 @@ describe('compiler: v-for', () => {
codegenNode,
false /* keyed */,
false /* customReturn */,
- false /* disableTracking */
- )
+ false /* disableTracking */,
+ ),
).toMatchObject({
source: { content: `10`, constType: ConstantTypes.CAN_STRINGIFY },
params: [{ content: `item` }],
@@ -794,11 +795,11 @@ describe('compiler: v-for', () => {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'item',
isStatic: false,
- constType: ConstantTypes.NOT_CONSTANT
- }
+ constType: ConstantTypes.NOT_CONSTANT,
+ },
},
- patchFlag: genFlagText(PatchFlags.TEXT)
- }
+ patchFlag: genFlagText(PatchFlags.TEXT),
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -806,9 +807,9 @@ describe('compiler: v-for', () => {
test('template v-for', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
- 'hello '
+ 'hello ',
)
expect(assertSharedCodegen(codegenNode)).toMatchObject({
source: { content: `items` },
@@ -819,10 +820,10 @@ describe('compiler: v-for', () => {
isBlock: true,
children: [
{ type: NodeTypes.TEXT, content: `hello` },
- { type: NodeTypes.ELEMENT, tag: `span` }
+ { type: NodeTypes.ELEMENT, tag: `span` },
],
- patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT)
- }
+ patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT),
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -830,19 +831,19 @@ describe('compiler: v-for', () => {
test('template v-for w/ ', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
- ' '
+ ' ',
)
expect(
- assertSharedCodegen(codegenNode, false, true /* custom return */)
+ assertSharedCodegen(codegenNode, false, true /* custom return */),
).toMatchObject({
source: { content: `items` },
params: [{ content: `item` }],
returns: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: RENDER_SLOT
- }
+ callee: RENDER_SLOT,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -851,9 +852,9 @@ describe('compiler: v-for', () => {
test('template v-for key injection with single child', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
- ' '
+ ' ',
)
expect(assertSharedCodegen(codegenNode, true)).toMatchObject({
source: { content: `items` },
@@ -863,9 +864,9 @@ describe('compiler: v-for', () => {
tag: `"span"`,
props: createObjectMatcher({
key: '[item.id]',
- id: '[item.id]'
- })
- }
+ id: '[item.id]',
+ }),
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -873,17 +874,17 @@ describe('compiler: v-for', () => {
test('v-for on ', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(
- assertSharedCodegen(codegenNode, false, true /* custom return */)
+ assertSharedCodegen(codegenNode, false, true /* custom return */),
).toMatchObject({
source: { content: `items` },
params: [{ content: `item` }],
returns: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: RENDER_SLOT
- }
+ callee: RENDER_SLOT,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -891,7 +892,7 @@ describe('compiler: v-for', () => {
test('keyed v-for', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(' ')
expect(assertSharedCodegen(codegenNode, true)).toMatchObject({
source: { content: `items` },
@@ -899,9 +900,9 @@ describe('compiler: v-for', () => {
innerVNodeCall: {
tag: `"span"`,
props: createObjectMatcher({
- key: `[item]`
- })
- }
+ key: `[item]`,
+ }),
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -909,9 +910,9 @@ describe('compiler: v-for', () => {
test('keyed template v-for', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(
- 'hello '
+ 'hello ',
)
expect(assertSharedCodegen(codegenNode, true)).toMatchObject({
source: { content: `items` },
@@ -919,14 +920,14 @@ describe('compiler: v-for', () => {
innerVNodeCall: {
tag: FRAGMENT,
props: createObjectMatcher({
- key: `[item]`
+ key: `[item]`,
}),
children: [
{ type: NodeTypes.TEXT, content: `hello` },
- { type: NodeTypes.ELEMENT, tag: `span` }
+ { type: NodeTypes.ELEMENT, tag: `span` },
],
- patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT)
- }
+ patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT),
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -934,7 +935,7 @@ describe('compiler: v-for', () => {
test('v-if + v-for', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(`
`)
expect(codegenNode).toMatchObject({
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
@@ -942,7 +943,7 @@ describe('compiler: v-for', () => {
consequent: {
type: NodeTypes.VNODE_CALL,
props: createObjectMatcher({
- key: `[0]`
+ key: `[0]`,
}),
isBlock: true,
disableTracking: true,
@@ -958,12 +959,12 @@ describe('compiler: v-for', () => {
returns: {
type: NodeTypes.VNODE_CALL,
tag: `"div"`,
- isBlock: true
- }
- }
- ]
- }
- }
+ isBlock: true,
+ },
+ },
+ ],
+ },
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -972,7 +973,7 @@ describe('compiler: v-for', () => {
test('v-if + v-for on ', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform(` `)
expect(codegenNode).toMatchObject({
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
@@ -980,7 +981,7 @@ describe('compiler: v-for', () => {
consequent: {
type: NodeTypes.VNODE_CALL,
props: createObjectMatcher({
- key: `[0]`
+ key: `[0]`,
}),
isBlock: true,
disableTracking: true,
@@ -996,12 +997,12 @@ describe('compiler: v-for', () => {
returns: {
type: NodeTypes.VNODE_CALL,
tag: FRAGMENT,
- isBlock: true
- }
- }
- ]
- }
- }
+ isBlock: true,
+ },
+ },
+ ],
+ },
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -1009,12 +1010,12 @@ describe('compiler: v-for', () => {
test('v-for on element with custom directive', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithForTransform('
')
const { returns } = assertSharedCodegen(codegenNode, false, true)
expect(returns).toMatchObject({
type: NodeTypes.VNODE_CALL,
- directives: { type: NodeTypes.JS_ARRAY_EXPRESSION }
+ directives: { type: NodeTypes.JS_ARRAY_EXPRESSION },
})
expect(generate(root).code).toMatchSnapshot()
})
diff --git a/packages/compiler-core/__tests__/transforms/vIf.spec.ts b/packages/compiler-core/__tests__/transforms/vIf.spec.ts
index 1b42b20c7b8..2c2fedab0d5 100644
--- a/packages/compiler-core/__tests__/transforms/vIf.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vIf.spec.ts
@@ -1,30 +1,29 @@
-import { vi } from 'vitest'
-import { baseParse as parse } from '../../src/parse'
+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 {
- CommentNode,
- ConditionalExpression,
- ElementNode,
+ type CommentNode,
+ type ConditionalExpression,
+ type ElementNode,
ElementTypes,
- IfBranchNode,
- IfConditionalExpression,
- IfNode,
+ type IfBranchNode,
+ type IfConditionalExpression,
+ type IfNode,
NodeTypes,
- SimpleExpressionNode,
- TextNode,
- VNodeCall
+ type SimpleExpressionNode,
+ type TextNode,
+ type VNodeCall,
} from '../../src/ast'
import { ErrorCodes } from '../../src/errors'
-import { CompilerOptions, generate, TO_HANDLERS } from '../../src'
+import { type CompilerOptions, TO_HANDLERS, generate } from '../../src'
import {
CREATE_COMMENT,
FRAGMENT,
MERGE_PROPS,
NORMALIZE_PROPS,
- RENDER_SLOT
+ RENDER_SLOT,
} from '../../src/runtimeHelpers'
import { createObjectMatcher } from '../testUtils'
@@ -32,12 +31,12 @@ function parseWithIfTransform(
template: string,
options: CompilerOptions = {},
returnIndex: number = 0,
- childrenLen: number = 1
+ childrenLen: number = 1,
) {
const ast = parse(template, options)
transform(ast, {
nodeTransforms: [transformIf, transformSlotOutlet, transformElement],
- ...options
+ ...options,
})
if (!options.onError) {
expect(ast.children.length).toBe(childrenLen)
@@ -49,7 +48,7 @@ function parseWithIfTransform(
root: ast,
node: ast.children[returnIndex] as IfNode & {
codegenNode: IfConditionalExpression
- }
+ },
}
}
@@ -60,7 +59,7 @@ describe('compiler: v-if', () => {
expect(node.type).toBe(NodeTypes.IF)
expect(node.branches.length).toBe(1)
expect((node.branches[0].condition as SimpleExpressionNode).content).toBe(
- `ok`
+ `ok`,
)
expect(node.branches[0].children.length).toBe(1)
expect(node.branches[0].children[0].type).toBe(NodeTypes.ELEMENT)
@@ -69,12 +68,12 @@ describe('compiler: v-if', () => {
test('template v-if', () => {
const { node } = parseWithIfTransform(
- `
hello
`
+ `
hello
`,
)
expect(node.type).toBe(NodeTypes.IF)
expect(node.branches.length).toBe(1)
expect((node.branches[0].condition as SimpleExpressionNode).content).toBe(
- `ok`
+ `ok`,
)
expect(node.branches[0].children.length).toBe(3)
expect(node.branches[0].children[0].type).toBe(NodeTypes.ELEMENT)
@@ -90,16 +89,16 @@ describe('compiler: v-if', () => {
expect(node.type).toBe(NodeTypes.IF)
expect(node.branches.length).toBe(1)
expect((node.branches[0].children[0] as ElementNode).tag).toBe(
- `Component`
+ `Component`,
)
expect((node.branches[0].children[0] as ElementNode).tagType).toBe(
- ElementTypes.COMPONENT
+ ElementTypes.COMPONENT,
)
// #2058 since a component may fail to resolve and fallback to a plain
// element, it still needs to be made a block
expect(
((node.branches[0].children[0] as ElementNode)!
- .codegenNode as VNodeCall)!.isBlock
+ .codegenNode as VNodeCall)!.isBlock,
).toBe(true)
})
@@ -123,7 +122,7 @@ describe('compiler: v-if', () => {
test('v-if + v-else-if', () => {
const { node } = parseWithIfTransform(
- `
`
+ `
`,
)
expect(node.type).toBe(NodeTypes.IF)
expect(node.branches.length).toBe(2)
@@ -143,7 +142,7 @@ describe('compiler: v-if', () => {
test('v-if + v-else-if + v-else', () => {
const { node } = parseWithIfTransform(
- `
fine `
+ `
fine `,
)
expect(node.type).toBe(NodeTypes.IF)
expect(node.branches.length).toBe(3)
@@ -203,11 +202,11 @@ describe('compiler: v-if', () => {
test('should prefix v-if condition', () => {
const { node } = parseWithIfTransform(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(node.branches[0].condition).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `_ctx.ok`
+ content: `_ctx.ok`,
})
})
})
@@ -220,32 +219,32 @@ describe('compiler: v-if', () => {
expect(onError.mock.calls[0]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node1.loc
- }
+ loc: node1.loc,
+ },
])
const { node: node2 } = parseWithIfTransform(
`
`,
{ onError },
- 1
+ 1,
)
expect(onError.mock.calls[1]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node2.loc
- }
+ loc: node2.loc,
+ },
])
const { node: node3 } = parseWithIfTransform(
`
foo
`,
{ onError },
- 2
+ 2,
)
expect(onError.mock.calls[2]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node3.loc
- }
+ loc: node3.loc,
+ },
])
})
@@ -253,52 +252,52 @@ describe('compiler: v-if', () => {
const onError = vi.fn()
const { node: node1 } = parseWithIfTransform(`
`, {
- onError
+ onError,
})
expect(onError.mock.calls[0]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node1.loc
- }
+ loc: node1.loc,
+ },
])
const { node: node2 } = parseWithIfTransform(
`
`,
{ onError },
- 1
+ 1,
)
expect(onError.mock.calls[1]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node2.loc
- }
+ loc: node2.loc,
+ },
])
const { node: node3 } = parseWithIfTransform(
`
foo
`,
{ onError },
- 2
+ 2,
)
expect(onError.mock.calls[2]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: node3.loc
- }
+ loc: node3.loc,
+ },
])
const {
- node: { branches }
+ node: { branches },
} = parseWithIfTransform(
`
`,
{ onError },
- 0
+ 0,
)
expect(onError.mock.calls[3]).toMatchObject([
{
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
- loc: branches[branches.length - 1].loc
- }
+ loc: branches[branches.length - 1].loc,
+ },
])
})
@@ -307,21 +306,21 @@ describe('compiler: v-if', () => {
// dynamic
parseWithIfTransform(
`
`,
- { onError }
+ { onError },
)
expect(onError.mock.calls[0]).toMatchObject([
{
- code: ErrorCodes.X_V_IF_SAME_KEY
- }
+ code: ErrorCodes.X_V_IF_SAME_KEY,
+ },
])
// static
parseWithIfTransform(`
`, {
- onError
+ onError,
})
expect(onError.mock.calls[1]).toMatchObject([
{
- code: ErrorCodes.X_V_IF_SAME_KEY
- }
+ code: ErrorCodes.X_V_IF_SAME_KEY,
+ },
])
})
})
@@ -330,63 +329,63 @@ describe('compiler: v-if', () => {
function assertSharedCodegen(
node: IfConditionalExpression,
depth: number = 0,
- hasElse: boolean = false
+ hasElse: boolean = false,
) {
expect(node).toMatchObject({
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
test: {
- content: `ok`
+ content: `ok`,
},
consequent: {
type: NodeTypes.VNODE_CALL,
- isBlock: true
+ isBlock: true,
},
alternate:
depth < 1
? hasElse
? {
type: NodeTypes.VNODE_CALL,
- isBlock: true
+ isBlock: true,
}
: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: CREATE_COMMENT
+ callee: CREATE_COMMENT,
}
: {
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
test: {
- content: `orNot`
+ content: `orNot`,
},
consequent: {
type: NodeTypes.VNODE_CALL,
- isBlock: true
+ isBlock: true,
},
alternate: hasElse
? {
type: NodeTypes.VNODE_CALL,
- isBlock: true
+ isBlock: true,
}
: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: CREATE_COMMENT
- }
- }
+ callee: CREATE_COMMENT,
+ },
+ },
})
}
test('basic v-if', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
assertSharedCodegen(codegenNode)
expect(codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
expect(codegenNode.alternate).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: CREATE_COMMENT
+ callee: CREATE_COMMENT,
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -394,7 +393,7 @@ describe('compiler: v-if', () => {
test('template v-if', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
hello
`)
assertSharedCodegen(codegenNode)
expect(codegenNode.consequent).toMatchObject({
@@ -403,12 +402,12 @@ describe('compiler: v-if', () => {
children: [
{ type: NodeTypes.ELEMENT, tag: 'div' },
{ type: NodeTypes.TEXT, content: `hello` },
- { type: NodeTypes.ELEMENT, tag: 'p' }
- ]
+ { type: NodeTypes.ELEMENT, tag: 'p' },
+ ],
})
expect(codegenNode.alternate).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: CREATE_COMMENT
+ callee: CREATE_COMMENT,
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -416,12 +415,12 @@ describe('compiler: v-if', () => {
test('template v-if w/ single child', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(` `)
expect(codegenNode.consequent).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
+ arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -429,12 +428,12 @@ describe('compiler: v-if', () => {
test('v-if on ', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(` `)
expect(codegenNode.consequent).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
+ arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -442,16 +441,16 @@ describe('compiler: v-if', () => {
test('v-if + v-else', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
assertSharedCodegen(codegenNode, 0, true)
expect(codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
expect(codegenNode.alternate).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -459,17 +458,17 @@ describe('compiler: v-if', () => {
test('v-if + v-else-if', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
assertSharedCodegen(codegenNode, 1)
expect(codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
const branch2 = codegenNode.alternate as ConditionalExpression
expect(branch2.consequent).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -477,19 +476,19 @@ describe('compiler: v-if', () => {
test('v-if + v-else-if + v-else', () => {
const {
root,
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(
- `
fine `
+ `
fine `,
)
assertSharedCodegen(codegenNode, 1, true)
expect(codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
const branch2 = codegenNode.alternate as ConditionalExpression
expect(branch2.consequent).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
expect(branch2.alternate).toMatchObject({
tag: FRAGMENT,
@@ -497,9 +496,9 @@ describe('compiler: v-if', () => {
children: [
{
type: NodeTypes.TEXT,
- content: `fine`
- }
- ]
+ content: `fine`,
+ },
+ ],
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -509,7 +508,7 @@ describe('compiler: v-if', () => {
`
`,
{},
0 /* returnIndex, just give the default value */,
- 2 /* childrenLen */
+ 2 /* childrenLen */,
)
const ifNode = root.children[0] as IfNode & {
@@ -517,14 +516,14 @@ describe('compiler: v-if', () => {
}
expect(ifNode.codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
const ifNode2 = root.children[1] as IfNode & {
codegenNode: IfConditionalExpression
}
expect(ifNode2.codegenNode.consequent).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -534,41 +533,41 @@ describe('compiler: v-if', () => {
`
`,
{},
0 /* returnIndex, just give the default value */,
- 2 /* childrenLen */
+ 2 /* childrenLen */,
)
const ifNode = root.children[0] as IfNode & {
codegenNode: IfConditionalExpression
}
expect(ifNode.codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
expect(ifNode.codegenNode.alternate).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
const ifNode2 = root.children[1] as IfNode & {
codegenNode: IfConditionalExpression
}
expect(ifNode2.codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[2]` })
+ props: createObjectMatcher({ key: `[2]` }),
})
const branch = ifNode2.codegenNode.alternate as IfConditionalExpression
expect(branch.consequent).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[3]` })
+ props: createObjectMatcher({ key: `[3]` }),
})
expect(branch.alternate).toMatchObject({
tag: `"p"`,
- props: createObjectMatcher({ key: `[4]` })
+ props: createObjectMatcher({ key: `[4]` }),
})
expect(generate(root).code).toMatchSnapshot()
})
test('key injection (only v-bind)', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.props).toMatchObject({
@@ -578,15 +577,18 @@ describe('compiler: v-if', () => {
{
type: NodeTypes.JS_CALL_EXPRESSION,
callee: MERGE_PROPS,
- arguments: [createObjectMatcher({ key: `[0]` }), { content: `obj` }]
- }
- ]
+ arguments: [
+ createObjectMatcher({ key: `[0]` }),
+ { content: `obj` },
+ ],
+ },
+ ],
})
})
test('key injection (before v-bind)', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.props).toMatchObject({
@@ -595,16 +597,16 @@ describe('compiler: v-if', () => {
arguments: [
createObjectMatcher({
key: '[0]',
- id: 'foo'
+ id: 'foo',
}),
- { content: `obj` }
- ]
+ { content: `obj` },
+ ],
})
})
test('key injection (after v-bind)', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.props).toMatchObject({
@@ -614,15 +616,15 @@ describe('compiler: v-if', () => {
createObjectMatcher({ key: `[0]` }),
{ content: `obj` },
createObjectMatcher({
- id: 'foo'
- })
- ]
+ id: 'foo',
+ }),
+ ],
})
})
test('key injection (w/ custom directive)', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.directives).not.toBeUndefined()
@@ -632,7 +634,7 @@ describe('compiler: v-if', () => {
// #6631
test('avoid duplicate keys', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(`
`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.props).toMatchObject({
@@ -640,31 +642,31 @@ describe('compiler: v-if', () => {
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
- key: 'custom_key'
+ key: 'custom_key',
}),
- { content: `obj` }
- ]
+ { content: `obj` },
+ ],
})
})
test('with spaces between branches', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(
- `
`
+ `
`,
)
expect(codegenNode.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[0]` })
+ props: createObjectMatcher({ key: `[0]` }),
})
const branch = codegenNode.alternate as ConditionalExpression
expect(branch.consequent).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[1]` })
+ props: createObjectMatcher({ key: `[1]` }),
})
expect(branch.alternate).toMatchObject({
tag: `"div"`,
- props: createObjectMatcher({ key: `[2]` })
+ props: createObjectMatcher({ key: `[2]` }),
})
})
@@ -730,7 +732,7 @@ describe('compiler: v-if', () => {
`,
- { comments: true }
+ { comments: true },
)
__DEV__ = true
})
@@ -738,21 +740,21 @@ describe('compiler: v-if', () => {
test('v-on with v-if', () => {
const {
- node: { codegenNode }
+ node: { codegenNode },
} = parseWithIfTransform(
- `w/ v-if `
+ `w/ v-if `,
)
expect((codegenNode.consequent as any).props.type).toBe(
- NodeTypes.JS_CALL_EXPRESSION
+ NodeTypes.JS_CALL_EXPRESSION,
)
expect((codegenNode.consequent as any).props.callee).toBe(MERGE_PROPS)
expect(
(codegenNode.consequent as any).props.arguments[0].properties[0].value
- .content
+ .content,
).toBe('0')
expect((codegenNode.consequent as any).props.arguments[1].callee).toBe(
- TO_HANDLERS
+ TO_HANDLERS,
)
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vMemo.spec.ts b/packages/compiler-core/__tests__/transforms/vMemo.spec.ts
index 1b259f7ca68..85769e6e977 100644
--- a/packages/compiler-core/__tests__/transforms/vMemo.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vMemo.spec.ts
@@ -4,7 +4,7 @@ describe('compiler: v-memo transform', () => {
function compile(content: string) {
return baseCompile(`${content}
`, {
mode: 'module',
- prefixIdentifiers: true
+ prefixIdentifiers: true,
}).code
}
@@ -12,8 +12,8 @@ describe('compiler: v-memo transform', () => {
expect(
baseCompile(`
`, {
mode: 'module',
- prefixIdentifiers: true
- }).code
+ prefixIdentifiers: true,
+ }).code,
).toMatchSnapshot()
})
@@ -29,8 +29,8 @@ describe('compiler: v-memo transform', () => {
expect(
compile(
`foo bar
- `
- )
+ `,
+ ),
).toMatchSnapshot()
})
@@ -39,8 +39,8 @@ describe('compiler: v-memo transform', () => {
compile(
`
foobar
-
`
- )
+ `,
+ ),
).toMatchSnapshot()
})
@@ -49,8 +49,8 @@ describe('compiler: v-memo transform', () => {
compile(
`
foobar
- `
- )
+ `,
+ ),
).toMatchSnapshot()
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vModel.spec.ts b/packages/compiler-core/__tests__/transforms/vModel.spec.ts
index df8f6e02416..5d94aca2777 100644
--- a/packages/compiler-core/__tests__/transforms/vModel.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vModel.spec.ts
@@ -1,18 +1,17 @@
-import { vi } from 'vitest'
import {
+ BindingTypes,
+ type CompilerOptions,
+ type ComponentNode,
+ type ElementNode,
+ type ForNode,
+ NORMALIZE_PROPS,
+ NodeTypes,
+ type ObjectExpression,
+ type PlainElementNode,
+ type VNodeCall,
+ generate,
baseParse as parse,
transform,
- generate,
- ElementNode,
- ObjectExpression,
- CompilerOptions,
- ForNode,
- PlainElementNode,
- ComponentNode,
- NodeTypes,
- VNodeCall,
- NORMALIZE_PROPS,
- BindingTypes
} from '../../src'
import { ErrorCodes } from '../../src/errors'
import { transformModel } from '../../src/transforms/vModel'
@@ -20,7 +19,7 @@ import { transformElement } from '../../src/transforms/transformElement'
import { transformExpression } from '../../src/transforms/transformExpression'
import { transformFor } from '../../src/transforms/vFor'
import { trackSlotScopes } from '../../src/transforms/vSlot'
-import { CallExpression } from '@babel/types'
+import type { CallExpression } from '@babel/types'
function parseWithVModel(template: string, options: CompilerOptions = {}) {
const ast = parse(template)
@@ -30,13 +29,13 @@ function parseWithVModel(template: string, options: CompilerOptions = {}) {
transformFor,
transformExpression,
transformElement,
- trackSlotScopes
+ trackSlotScopes,
],
directiveTransforms: {
...options.directiveTransforms,
- model: transformModel
+ model: transformModel,
},
- ...options
+ ...options,
})
return ast
@@ -52,29 +51,29 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'model',
- isStatic: false
- }
+ isStatic: false,
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
'$event => ((',
{
content: 'model',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root).code).toMatchSnapshot()
@@ -82,7 +81,7 @@ describe('compiler: transform v-model', () => {
test('simple expression (with prefixIdentifiers)', () => {
const root = parseWithVModel('
', {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const node = root.children[0] as ElementNode
const props = ((node.codegenNode as VNodeCall).props as ObjectExpression)
@@ -91,29 +90,29 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
content: '_ctx.model',
- isStatic: false
- }
+ isStatic: false,
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
'$event => ((',
{
content: '_ctx.model',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root, { mode: 'module' }).code).toMatchSnapshot()
@@ -129,29 +128,29 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
content: '\n model\n.\nfoo \n',
- isStatic: false
- }
+ isStatic: false,
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
'$event => ((',
{
content: '\n model\n.\nfoo \n',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root).code).toMatchSnapshot()
@@ -166,29 +165,29 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'model[index]',
- isStatic: false
- }
+ isStatic: false,
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
'$event => ((',
{
content: 'model[index]',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root).code).toMatchSnapshot()
@@ -196,7 +195,7 @@ describe('compiler: transform v-model', () => {
test('compound expression (with prefixIdentifiers)', () => {
const root = parseWithVModel('
', {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const node = root.children[0] as ElementNode
const props = ((node.codegenNode as VNodeCall).props as ObjectExpression)
@@ -205,28 +204,28 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
{
content: '_ctx.model',
- isStatic: false
+ isStatic: false,
},
'[',
{
content: '_ctx.index',
- isStatic: false
+ isStatic: false,
},
- ']'
- ]
- }
+ ']',
+ ],
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:modelValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
@@ -235,19 +234,19 @@ describe('compiler: transform v-model', () => {
children: [
{
content: '_ctx.model',
- isStatic: false
+ isStatic: false,
},
'[',
{
content: '_ctx.index',
- isStatic: false
+ isStatic: false,
},
- ']'
- ]
+ ']',
+ ],
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root, { mode: 'module' }).code).toMatchSnapshot()
@@ -261,29 +260,29 @@ describe('compiler: transform v-model', () => {
expect(props[0]).toMatchObject({
key: {
content: 'foo-value',
- isStatic: true
+ isStatic: true,
},
value: {
content: 'model',
- isStatic: false
- }
+ isStatic: false,
+ },
})
expect(props[1]).toMatchObject({
key: {
content: 'onUpdate:fooValue',
- isStatic: true
+ isStatic: true,
},
value: {
children: [
'$event => ((',
{
content: 'model',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
+ ') = $event)',
+ ],
+ },
})
expect(generate(root).code).toMatchSnapshot()
@@ -305,12 +304,12 @@ describe('compiler: transform v-model', () => {
{
key: {
content: 'value',
- isStatic: false
+ isStatic: false,
},
value: {
content: 'model',
- isStatic: false
- }
+ isStatic: false,
+ },
},
{
key: {
@@ -318,24 +317,24 @@ describe('compiler: transform v-model', () => {
'"onUpdate:" + ',
{
content: 'value',
- isStatic: false
- }
- ]
+ isStatic: false,
+ },
+ ],
},
value: {
children: [
'$event => ((',
{
content: 'model',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
- }
- ]
- }
- ]
+ ') = $event)',
+ ],
+ },
+ },
+ ],
+ },
+ ],
})
expect(generate(root).code).toMatchSnapshot()
@@ -343,7 +342,7 @@ describe('compiler: transform v-model', () => {
test('with dynamic argument (with prefixIdentifiers)', () => {
const root = parseWithVModel('
', {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const node = root.children[0] as ElementNode
const props = (node.codegenNode as VNodeCall)
@@ -359,12 +358,12 @@ describe('compiler: transform v-model', () => {
{
key: {
content: '_ctx.value',
- isStatic: false
+ isStatic: false,
},
value: {
content: '_ctx.model',
- isStatic: false
- }
+ isStatic: false,
+ },
},
{
key: {
@@ -372,24 +371,24 @@ describe('compiler: transform v-model', () => {
'"onUpdate:" + ',
{
content: '_ctx.value',
- isStatic: false
- }
- ]
+ isStatic: false,
+ },
+ ],
},
value: {
children: [
'$event => ((',
{
content: '_ctx.model',
- isStatic: false
+ isStatic: false,
},
- ') = $event)'
- ]
- }
- }
- ]
- }
- ]
+ ') = $event)',
+ ],
+ },
+ },
+ ],
+ },
+ ],
})
expect(generate(root, { mode: 'module' }).code).toMatchSnapshot()
@@ -398,7 +397,7 @@ describe('compiler: transform v-model', () => {
test('should cache update handler w/ cacheHandlers: true', () => {
const root = parseWithVModel('
', {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
const codegen = (root.children[0] as PlainElementNode)
@@ -406,7 +405,7 @@ describe('compiler: transform v-model', () => {
// should not list cached prop in dynamicProps
expect(codegen.dynamicProps).toBe(`["modelValue"]`)
expect((codegen.props as ObjectExpression).properties[1].value.type).toBe(
- NodeTypes.JS_CACHE_EXPRESSION
+ NodeTypes.JS_CACHE_EXPRESSION,
)
})
@@ -415,8 +414,8 @@ describe('compiler: transform v-model', () => {
'
',
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).toBe(0)
const codegen = (
@@ -424,14 +423,14 @@ describe('compiler: transform v-model', () => {
).codegenNode as VNodeCall
expect(codegen.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
expect(
- (codegen.props as ObjectExpression).properties[1].value.type
+ (codegen.props as ObjectExpression).properties[1].value.type,
).not.toBe(NodeTypes.JS_CACHE_EXPRESSION)
})
test('should not cache update handler if it inside v-once', () => {
const root = parseWithVModel('
', {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).not.toBe(2)
expect(root.cached).toBe(1)
@@ -441,8 +440,8 @@ describe('compiler: transform v-model', () => {
const root = parseWithVModel(
'
',
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
const codegen = (
(root.children[0] as ComponentNode).children[0] as PlainElementNode
@@ -452,7 +451,7 @@ describe('compiler: transform v-model', () => {
test('should generate modelModifiers for component v-model', () => {
const root = parseWithVModel('
', {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
const vnodeCall = (root.children[0] as ComponentNode)
.codegenNode as VNodeCall
@@ -463,9 +462,12 @@ describe('compiler: transform v-model', () => {
{ key: { content: `onUpdate:modelValue` } },
{
key: { content: 'modelModifiers' },
- value: { content: `{ trim: true, "bar-baz": true }`, isStatic: false }
- }
- ]
+ value: {
+ content: `{ trim: true, "bar-baz": true }`,
+ isStatic: false,
+ },
+ },
+ ],
})
// should NOT include modelModifiers in dynamicPropNames because it's never
// gonna change
@@ -476,8 +478,8 @@ describe('compiler: transform v-model', () => {
const root = parseWithVModel(
'
',
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
const vnodeCall = (root.children[0] as ComponentNode)
.codegenNode as VNodeCall
@@ -488,20 +490,20 @@ describe('compiler: transform v-model', () => {
{ key: { content: `onUpdate:foo` } },
{
key: { content: 'fooModifiers' },
- value: { content: `{ trim: true }`, isStatic: false }
+ value: { content: `{ trim: true }`, isStatic: false },
},
{ key: { content: `bar` } },
{ key: { content: `onUpdate:bar` } },
{
key: { content: 'barModifiers' },
- value: { content: `{ number: true }`, isStatic: false }
- }
- ]
+ value: { content: `{ number: true }`, isStatic: false },
+ },
+ ],
})
// should NOT include modelModifiers in dynamicPropNames because it's never
// gonna change
expect(vnodeCall.dynamicProps).toBe(
- `["foo", "onUpdate:foo", "bar", "onUpdate:bar"]`
+ `["foo", "onUpdate:foo", "bar", "onUpdate:bar"]`,
)
})
@@ -513,8 +515,8 @@ describe('compiler: transform v-model', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_MODEL_NO_EXPRESSION
- })
+ code: ErrorCodes.X_V_MODEL_NO_EXPRESSION,
+ }),
)
})
@@ -525,8 +527,8 @@ describe('compiler: transform v-model', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -537,8 +539,8 @@ describe('compiler: transform v-model', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION
- })
+ code: ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION,
+ }),
)
})
@@ -553,14 +555,14 @@ describe('compiler: transform v-model', () => {
const onError = vi.fn()
parseWithVModel('
', {
onError,
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE
- })
+ code: ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE,
+ }),
)
})
@@ -569,15 +571,15 @@ describe('compiler: transform v-model', () => {
parseWithVModel('
', {
onError,
bindingMetadata: {
- p: BindingTypes.PROPS
- }
+ p: BindingTypes.PROPS,
+ },
})
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: ErrorCodes.X_V_MODEL_ON_PROPS
- })
+ code: ErrorCodes.X_V_MODEL_ON_PROPS,
+ }),
)
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vOn.spec.ts b/packages/compiler-core/__tests__/transforms/vOn.spec.ts
index f61275b2f7f..9f5e0094878 100644
--- a/packages/compiler-core/__tests__/transforms/vOn.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vOn.spec.ts
@@ -1,15 +1,14 @@
-import { vi } from 'vitest'
import {
- baseParse as parse,
- CompilerOptions,
- ElementNode,
+ type CompilerOptions,
+ type ElementNode,
ErrorCodes,
+ NodeTypes,
+ type ObjectExpression,
TO_HANDLER_KEY,
+ type VNodeCall,
helperNameMap,
- NodeTypes,
- ObjectExpression,
+ baseParse as parse,
transform,
- VNodeCall
} from '../../src'
import { transformOn } from '../../src/transforms/vOn'
import { transformElement } from '../../src/transforms/transformElement'
@@ -20,13 +19,13 @@ function parseWithVOn(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformExpression, transformElement],
directiveTransforms: {
- on: transformOn
+ on: transformOn,
},
- ...options
+ ...options,
})
return {
root: ast,
- node: ast.children[0] as ElementNode
+ node: ast.children[0] as ElementNode,
}
}
@@ -42,13 +41,13 @@ describe('compiler: transform v-on', () => {
loc: {
start: {
line: 1,
- column: 11
+ column: 11,
},
end: {
line: 1,
- column: 16
- }
- }
+ column: 16,
+ },
+ },
},
value: {
content: `onClick`,
@@ -56,16 +55,16 @@ describe('compiler: transform v-on', () => {
loc: {
start: {
line: 1,
- column: 18
+ column: 18,
},
end: {
line: 1,
- column: 25
- }
- }
- }
- }
- ]
+ column: 25,
+ },
+ },
+ },
+ },
+ ],
})
})
@@ -79,22 +78,22 @@ describe('compiler: transform v-on', () => {
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: `event` },
- `)`
- ]
+ `)`,
+ ],
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `handler`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
})
test('dynamic arg with prefixing', () => {
const { node } = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -104,22 +103,22 @@ describe('compiler: transform v-on', () => {
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: `_ctx.event` },
- `)`
- ]
+ `)`,
+ ],
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `_ctx.handler`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
})
test('dynamic arg with complex exp prefixing', () => {
const { node } = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -132,16 +131,16 @@ describe('compiler: transform v-on', () => {
`(`,
{ content: `_ctx.foo` },
`)`,
- `)`
- ]
+ `)`,
+ ],
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `_ctx.handler`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
})
@@ -153,10 +152,10 @@ describe('compiler: transform v-on', () => {
key: { content: `onClick` },
value: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`$event => (`, { content: `i++` }, `)`]
- }
- }
- ]
+ children: [`$event => (`, { content: `i++` }, `)`],
+ },
+ },
+ ],
})
})
@@ -171,10 +170,10 @@ describe('compiler: transform v-on', () => {
// should wrap with `{` for multiple statements
// in this case the return value is discarded and the behavior is
// consistent with 2.x
- children: [`$event => {`, { content: `foo();bar()` }, `}`]
- }
- }
- ]
+ children: [`$event => {`, { content: `foo();bar()` }, `}`],
+ },
+ },
+ ],
})
})
@@ -189,16 +188,16 @@ describe('compiler: transform v-on', () => {
// should wrap with `{` for multiple statements
// in this case the return value is discarded and the behavior is
// consistent with 2.x
- children: [`$event => {`, { content: `\nfoo();\nbar()\n` }, `}`]
- }
- }
- ]
+ children: [`$event => {`, { content: `\nfoo();\nbar()\n` }, `}`],
+ },
+ },
+ ],
})
})
test('inline statement w/ prefixIdentifiers: true', () => {
const { node } = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -215,20 +214,20 @@ describe('compiler: transform v-on', () => {
`(`,
// should NOT prefix $event
{ content: `$event` },
- `)`
- ]
+ `)`,
+ ],
},
- `)`
- ]
- }
- }
- ]
+ `)`,
+ ],
+ },
+ },
+ ],
})
})
test('multiple inline statements w/ prefixIdentifiers: true', () => {
const { node } = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -246,14 +245,14 @@ describe('compiler: transform v-on', () => {
{ content: `$event` },
`);`,
{ content: `_ctx.bar` },
- `()`
- ]
+ `()`,
+ ],
},
- `}`
- ]
- }
- }
- ]
+ `}`,
+ ],
+ },
+ },
+ ],
})
})
@@ -265,10 +264,10 @@ describe('compiler: transform v-on', () => {
key: { content: `onClick` },
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `$event => foo($event)`
- }
- }
- ]
+ content: `$event => foo($event)`,
+ },
+ },
+ ],
})
})
@@ -280,10 +279,10 @@ describe('compiler: transform v-on', () => {
key: { content: `onClick` },
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `(e: any): any => foo(e)`
- }
- }
- ]
+ content: `(e: any): any => foo(e)`,
+ },
+ },
+ ],
})
})
@@ -293,7 +292,7 @@ describe('compiler: transform v-on', () => {
$event => {
foo($event)
}
- "/>`
+ "/>`,
)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -305,10 +304,10 @@ describe('compiler: transform v-on', () => {
$event => {
foo($event)
}
- `
- }
- }
- ]
+ `,
+ },
+ },
+ ],
})
})
@@ -318,7 +317,7 @@ describe('compiler: transform v-on', () => {
function($event) {
foo($event)
}
- "/>`
+ "/>`,
)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -330,10 +329,10 @@ describe('compiler: transform v-on', () => {
function($event) {
foo($event)
}
- `
- }
- }
- ]
+ `,
+ },
+ },
+ ],
})
})
@@ -345,16 +344,16 @@ describe('compiler: transform v-on', () => {
key: { content: `onClick` },
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `a['b' + c]`
- }
- }
- ]
+ content: `a['b' + c]`,
+ },
+ },
+ ],
})
})
test('complex member expression w/ prefixIdentifiers: true', () => {
const { node } = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -366,17 +365,17 @@ describe('compiler: transform v-on', () => {
{ content: `_ctx.a` },
`['b' + `,
{ content: `_ctx.c` },
- `]`
- ]
- }
- }
- ]
+ `]`,
+ ],
+ },
+ },
+ ],
})
})
test('function expression w/ prefixIdentifiers: true', () => {
const { node } = parseWithVOn(`
foo(e)"/>`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
@@ -390,11 +389,11 @@ describe('compiler: transform v-on', () => {
{ content: `_ctx.foo` },
`(`,
{ content: `e` },
- `)`
- ]
- }
- }
- ]
+ `)`,
+ ],
+ },
+ },
+ ],
})
})
@@ -406,13 +405,13 @@ describe('compiler: transform v-on', () => {
loc: {
start: {
line: 1,
- column: 6
+ column: 6,
},
end: {
line: 1,
- column: 16
- }
- }
+ column: 16,
+ },
+ },
})
})
@@ -428,57 +427,57 @@ describe('compiler: transform v-on', () => {
properties: [
{
key: {
- content: `onFooBar`
+ content: `onFooBar`,
},
value: {
- content: `onMount`
- }
- }
- ]
+ content: `onMount`,
+ },
+ },
+ ],
})
})
- // TODO remove in 3.4
- test('case conversion for vnode hooks', () => {
- const { node } = parseWithVOn(`
`)
- expect((node.codegenNode as VNodeCall).props).toMatchObject({
- properties: [
- {
- key: {
- content: `onVnodeMounted`
- },
- value: {
- content: `onMount`
- }
- }
- ]
+ test('error for vnode hooks', () => {
+ const onError = vi.fn()
+ parseWithVOn(`
`, { onError })
+ expect(onError.mock.calls[0][0]).toMatchObject({
+ code: ErrorCodes.X_VNODE_HOOKS,
+ loc: {
+ start: {
+ line: 1,
+ column: 11,
+ },
+ end: {
+ line: 1,
+ column: 24,
+ },
+ },
})
- expect('@vnode-* hooks in templates are deprecated').toHaveBeenWarned()
})
test('vue: prefixed events', () => {
const { node } = parseWithVOn(
- `
`
+ `
`,
)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
{
key: {
- content: `onVnodeMounted`
+ content: `onVnodeMounted`,
},
value: {
- content: `onMount`
- }
+ content: `onMount`,
+ },
},
{
key: {
- content: `onVnodeBeforeUpdate`
+ content: `onVnodeBeforeUpdate`,
},
value: {
- content: `onBeforeUpdate`
- }
- }
- ]
+ content: `onBeforeUpdate`,
+ },
+ },
+ ],
})
})
@@ -486,35 +485,35 @@ describe('compiler: transform v-on', () => {
test('empty handler', () => {
const { root, node } = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `() => {}`
- }
+ content: `() => {}`,
+ },
})
})
test('member expression handler', () => {
const { root, node } = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
@@ -523,23 +522,23 @@ describe('compiler: transform v-on', () => {
children: [
`(...args) => (`,
{ content: `_ctx.foo && _ctx.foo(...args)` },
- `)`
- ]
- }
+ `)`,
+ ],
+ },
})
})
test('compound member expression handler', () => {
const { root, node } = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
@@ -556,12 +555,12 @@ describe('compiler: transform v-on', () => {
{ content: `_ctx.foo` },
`.`,
{ content: `bar` },
- `(...args)`
- ]
+ `(...args)`,
+ ],
},
- `)`
- ]
- }
+ `)`,
+ ],
+ },
})
})
@@ -569,7 +568,7 @@ describe('compiler: transform v-on', () => {
const { root } = parseWithVOn(`
`, {
prefixIdentifiers: true,
cacheHandlers: true,
- isNativeTag: tag => tag === 'div'
+ isNativeTag: tag => tag === 'div',
})
expect(root.cached).toBe(0)
})
@@ -579,8 +578,8 @@ describe('compiler: transform v-on', () => {
`
`,
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).not.toBe(2)
expect(root.cached).toBe(1)
@@ -589,21 +588,21 @@ describe('compiler: transform v-on', () => {
test('inline function expression handler', () => {
const { root, node } = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
value: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`() => `, { content: `_ctx.foo` }, `()`]
- }
+ children: [`() => `, { content: `_ctx.foo` }, `()`],
+ },
})
})
@@ -612,22 +611,22 @@ describe('compiler: transform v-on', () => {
`
`,
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
value: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`async () => await `, { content: `_ctx.foo` }, `()`]
- }
+ children: [`async () => await `, { content: `_ctx.foo` }, `()`],
+ },
})
})
@@ -636,15 +635,15 @@ describe('compiler: transform v-on', () => {
`
`,
{
prefixIdentifiers: true,
- cacheHandlers: true
- }
+ cacheHandlers: true,
+ },
)
expect(root.cached).toBe(1)
const vnodeCall = node.codegenNode as VNodeCall
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
@@ -653,16 +652,16 @@ describe('compiler: transform v-on', () => {
children: [
`async function () { await `,
{ content: `_ctx.foo` },
- `() } `
- ]
- }
+ `() } `,
+ ],
+ },
})
})
test('inline statement handler', () => {
const { root, node } = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
expect(root.cached).toBe(1)
@@ -670,7 +669,7 @@ describe('compiler: transform v-on', () => {
// should not treat cached handler as dynamicProp, so no flags
expect(vnodeCall.patchFlag).toBeUndefined()
expect(
- (vnodeCall.props as ObjectExpression).properties[0].value
+ (vnodeCall.props as ObjectExpression).properties[0].value,
).toMatchObject({
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
@@ -679,9 +678,9 @@ describe('compiler: transform v-on', () => {
children: [
`$event => (`,
{ children: [{ content: `_ctx.foo` }, `++`] },
- `)`
- ]
- }
+ `)`,
+ ],
+ },
})
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vOnce.spec.ts b/packages/compiler-core/__tests__/transforms/vOnce.spec.ts
index 553ac1dfac4..30149c62df6 100644
--- a/packages/compiler-core/__tests__/transforms/vOnce.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vOnce.spec.ts
@@ -1,10 +1,10 @@
import {
- baseParse as parse,
- transform,
+ type CompilerOptions,
NodeTypes,
generate,
- CompilerOptions,
- getBaseTransformPreset
+ getBaseTransformPreset,
+ baseParse as parse,
+ transform,
} from '../../src'
import { RENDER_SLOT, SET_BLOCK_TRACKING } from '../../src/runtimeHelpers'
@@ -14,7 +14,7 @@ function transformWithOnce(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms,
directiveTransforms,
- ...options
+ ...options,
})
return ast
}
@@ -29,8 +29,8 @@ describe('compiler: v-once transform', () => {
index: 0,
value: {
type: NodeTypes.VNODE_CALL,
- tag: `"div"`
- }
+ tag: `"div"`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -44,8 +44,8 @@ describe('compiler: v-once transform', () => {
index: 0,
value: {
type: NodeTypes.VNODE_CALL,
- tag: `"div"`
- }
+ tag: `"div"`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -59,8 +59,8 @@ describe('compiler: v-once transform', () => {
index: 0,
value: {
type: NodeTypes.VNODE_CALL,
- tag: `_component_Comp`
- }
+ tag: `_component_Comp`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -74,8 +74,8 @@ describe('compiler: v-once transform', () => {
index: 0,
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: RENDER_SLOT
- }
+ callee: RENDER_SLOT,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -90,7 +90,7 @@ describe('compiler: v-once transform', () => {
// cached nodes should be ignored by hoistStatic transform
test('with hoistStatic: true', () => {
const root = transformWithOnce(`
`, {
- hoistStatic: true
+ hoistStatic: true,
})
expect(root.cached).toBe(1)
expect(root.helpers).toContain(SET_BLOCK_TRACKING)
@@ -100,8 +100,8 @@ describe('compiler: v-once transform', () => {
index: 0,
value: {
type: NodeTypes.VNODE_CALL,
- tag: `"div"`
- }
+ tag: `"div"`,
+ },
})
expect(generate(root).code).toMatchSnapshot()
})
@@ -119,14 +119,14 @@ describe('compiler: v-once transform', () => {
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
consequent: {
type: NodeTypes.VNODE_CALL,
- tag: `"div"`
+ tag: `"div"`,
},
alternate: {
type: NodeTypes.VNODE_CALL,
- tag: `"p"`
- }
- }
- }
+ tag: `"p"`,
+ },
+ },
+ },
})
})
@@ -138,8 +138,8 @@ describe('compiler: v-once transform', () => {
type: NodeTypes.FOR,
// should cache the entire v-for expression, not just a single branch
codegenNode: {
- type: NodeTypes.JS_CACHE_EXPRESSION
- }
+ type: NodeTypes.JS_CACHE_EXPRESSION,
+ },
})
})
})
diff --git a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts
index d111aab6b4f..aa7b600ccbe 100644
--- a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts
@@ -1,19 +1,18 @@
-import { vi } from 'vitest'
import {
- CompilerOptions,
+ 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,
- generate,
- ElementNode,
- NodeTypes,
- ErrorCodes,
- ForNode,
- ComponentNode,
- VNodeCall,
- SlotsExpression,
- ObjectExpression,
- SimpleExpressionNode,
- RenderSlotCall
} from '../../src'
import { transformElement } from '../../src/transforms/transformElement'
import { transformOn } from '../../src/transforms/vOn'
@@ -22,7 +21,7 @@ import { transformExpression } from '../../src/transforms/transformExpression'
import { transformSlotOutlet } from '../../src/transforms/transformSlotOutlet'
import {
trackSlotScopes,
- trackVForSlotScopes
+ trackVForSlotScopes,
} from '../../src/transforms/vSlot'
import { CREATE_SLOTS, RENDER_LIST } from '../../src/runtimeHelpers'
import { createObjectMatcher, genFlagText } from '../testUtils'
@@ -32,7 +31,7 @@ import { transformIf } from '../../src/transforms/vIf'
function parseWithSlots(template: string, options: CompilerOptions = {}) {
const ast = parse(template, {
- whitespace: options.whitespace
+ whitespace: options.whitespace,
})
transform(ast, {
nodeTransforms: [
@@ -43,13 +42,13 @@ function parseWithSlots(template: string, options: CompilerOptions = {}) {
: []),
transformSlotOutlet,
transformElement,
- trackSlotScopes
+ trackSlotScopes,
],
directiveTransforms: {
on: transformOn,
- bind: transformBind
+ bind: transformBind,
},
- ...options
+ ...options,
})
return {
root: ast,
@@ -57,7 +56,7 @@ function parseWithSlots(template: string, options: CompilerOptions = {}) {
ast.children[0].type === NodeTypes.ELEMENT
? ((ast.children[0].codegenNode as VNodeCall)
.children as SlotsExpression)
- : null
+ : null,
}
}
@@ -71,25 +70,25 @@ function createSlotMatcher(obj: Record
, isDynamic = false) {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
isStatic: !/^\[/.test(key),
- content: key.replace(/^\[|\]$/g, '')
+ content: key.replace(/^\[|\]$/g, ''),
},
- value: obj[key]
+ value: obj[key],
} as any
})
.concat({
key: { content: `_` },
value: {
content: isDynamic ? `2 /* DYNAMIC */` : `1 /* STABLE */`,
- isStatic: false
- }
- })
+ isStatic: false,
+ },
+ }),
}
}
describe('compiler: transform component slots', () => {
test('implicit default slot', () => {
const { root, slots } = parseWithSlots(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(slots).toMatchObject(
createSlotMatcher({
@@ -99,11 +98,11 @@ describe('compiler: transform component slots', () => {
returns: [
{
type: NodeTypes.ELEMENT,
- tag: `div`
- }
- ]
- }
- })
+ tag: `div`,
+ },
+ ],
+ },
+ }),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -111,7 +110,7 @@ describe('compiler: transform component slots', () => {
test('on-component default slot', () => {
const { root, slots } = parseWithSlots(
`{{ foo }}{{ bar }} `,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher({
@@ -119,24 +118,24 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
- }
- ]
- }
- })
+ content: `_ctx.bar`,
+ },
+ },
+ ],
+ },
+ }),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -144,7 +143,7 @@ describe('compiler: transform component slots', () => {
test('on component named slot', () => {
const { root, slots } = parseWithSlots(
`{{ foo }}{{ bar }} `,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher({
@@ -152,24 +151,24 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
- }
- ]
- }
- })
+ content: `_ctx.bar`,
+ },
+ },
+ ],
+ },
+ }),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -184,7 +183,7 @@ describe('compiler: transform component slots', () => {
{{ foo }}{{ bar }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher({
@@ -192,45 +191,45 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
- }
- ]
+ content: `_ctx.bar`,
+ },
+ },
+ ],
},
two: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `bar` }, ` }`]
+ children: [`{ `, { content: `bar` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.foo`
- }
+ content: `_ctx.foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `bar`
- }
- }
- ]
- }
- })
+ content: `bar`,
+ },
+ },
+ ],
+ },
+ }),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -238,7 +237,7 @@ describe('compiler: transform component slots', () => {
test('on component dynamically named slot', () => {
const { root, slots } = parseWithSlots(
`{{ foo }}{{ bar }} `,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher(
@@ -247,26 +246,26 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
- }
- ]
- }
+ content: `_ctx.bar`,
+ },
+ },
+ ],
+ },
},
- true
- )
+ true,
+ ),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -275,7 +274,7 @@ describe('compiler: transform component slots', () => {
const { root, slots } = parseWithSlots(
`
foo bar
- `
+ `,
)
expect(slots).toMatchObject(
createSlotMatcher({
@@ -285,9 +284,9 @@ describe('compiler: transform component slots', () => {
returns: [
{
type: NodeTypes.TEXT,
- content: `foo`
- }
- ]
+ content: `foo`,
+ },
+ ],
},
default: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
@@ -295,15 +294,15 @@ describe('compiler: transform component slots', () => {
returns: [
{
type: NodeTypes.TEXT,
- content: `bar`
+ content: `bar`,
},
{
type: NodeTypes.ELEMENT,
- tag: `span`
- }
- ]
- }
- })
+ tag: `span`,
+ },
+ ],
+ },
+ }),
)
expect(generate(root).code).toMatchSnapshot()
})
@@ -318,7 +317,7 @@ describe('compiler: transform component slots', () => {
{{ foo }}{{ bar }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher(
@@ -327,47 +326,47 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
- }
- ]
+ content: `_ctx.bar`,
+ },
+ },
+ ],
},
'[_ctx.two]': {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `bar` }, ` }`]
+ children: [`{ `, { content: `bar` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.foo`
- }
+ content: `_ctx.foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `bar`
- }
- }
- ]
- }
+ content: `bar`,
+ },
+ },
+ ],
+ },
},
- true
- )
+ true,
+ ),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -382,7 +381,7 @@ describe('compiler: transform component slots', () => {
{{ foo }}{{ bar }}{{ baz }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject(
createSlotMatcher({
@@ -390,7 +389,7 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `foo` }, ` }`]
+ children: [`{ `, { content: `foo` }, ` }`],
},
returns: [
{
@@ -405,63 +404,63 @@ describe('compiler: transform component slots', () => {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`{ `, { content: `bar` }, ` }`]
+ children: [`{ `, { content: `bar` }, ` }`],
},
returns: [
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `bar`
- }
+ content: `bar`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.baz`
- }
- }
- ]
- }
+ content: `_ctx.baz`,
+ },
+ },
+ ],
+ },
},
- true
+ true,
),
// nested slot should be forced dynamic, since scope variables
// are not tracked as dependencies of the slot.
- patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS)
- }
+ patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS),
+ },
},
// test scope
{
type: NodeTypes.TEXT,
- content: ` `
+ content: ` `,
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `foo`
- }
+ content: `foo`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.bar`
- }
+ content: `_ctx.bar`,
+ },
},
{
type: NodeTypes.INTERPOLATION,
content: {
- content: `_ctx.baz`
- }
- }
- ]
- }
- })
+ content: `_ctx.baz`,
+ },
+ },
+ ],
+ },
+ }),
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -470,13 +469,13 @@ describe('compiler: transform component slots', () => {
const { root } = parseWithSlots(
`
foo
-
`
+ `,
)
const div = ((root.children[0] as ForNode).children[0] as ElementNode)
.codegenNode as any
const comp = div.children[0]
expect(comp.codegenNode.patchFlag).toBe(
- genFlagText(PatchFlags.DYNAMIC_SLOTS)
+ genFlagText(PatchFlags.DYNAMIC_SLOTS),
)
})
@@ -505,14 +504,14 @@ describe('compiler: transform component slots', () => {
`
foo
`,
- false
+ false,
)
assertDynamicSlots(
`
{{ i }}
`,
- true
+ true,
)
// reference the component's own slot variable should not force dynamic slots
@@ -520,14 +519,14 @@ describe('compiler: transform component slots', () => {
`
{{ bar }}
`,
- false
+ false,
)
assertDynamicSlots(
`
{{ foo }}
`,
- true
+ true,
)
// #2564
@@ -535,14 +534,14 @@ describe('compiler: transform component slots', () => {
`
`,
- true
+ true,
)
assertDynamicSlots(
`
`,
- false
+ false,
)
})
@@ -550,14 +549,14 @@ describe('compiler: transform component slots', () => {
const { root, slots } = parseWithSlots(
`
hello
- `
+ `,
)
expect(slots).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: CREATE_SLOTS,
arguments: [
createObjectMatcher({
- _: `[2 /* DYNAMIC */]`
+ _: `[2 /* DYNAMIC */]`,
}),
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -569,21 +568,21 @@ describe('compiler: transform component slots', () => {
name: `one`,
fn: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
- returns: [{ type: NodeTypes.TEXT, content: `hello` }]
+ returns: [{ type: NodeTypes.TEXT, content: `hello` }],
},
- key: `0`
+ key: `0`,
}),
alternate: {
content: `undefined`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
expect((root as any).children[0].codegenNode.patchFlag).toMatch(
- PatchFlags.DYNAMIC_SLOTS + ''
+ PatchFlags.DYNAMIC_SLOTS + '',
)
expect(generate(root).code).toMatchSnapshot()
})
@@ -593,14 +592,14 @@ describe('compiler: transform component slots', () => {
`
{{ props }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: CREATE_SLOTS,
arguments: [
createObjectMatcher({
- _: `[2 /* DYNAMIC */]`
+ _: `[2 /* DYNAMIC */]`,
}),
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -616,23 +615,23 @@ describe('compiler: transform component slots', () => {
returns: [
{
type: NodeTypes.INTERPOLATION,
- content: { content: `props` }
- }
- ]
+ content: { content: `props` },
+ },
+ ],
},
- key: `0`
+ key: `0`,
}),
alternate: {
content: `undefined`,
- isStatic: false
- }
- }
- ]
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
+ },
+ ],
})
expect((root as any).children[0].codegenNode.patchFlag).toMatch(
- PatchFlags.DYNAMIC_SLOTS + ''
+ PatchFlags.DYNAMIC_SLOTS + '',
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -643,14 +642,14 @@ describe('compiler: transform component slots', () => {
foo
bar
baz
- `
+ `,
)
expect(slots).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: CREATE_SLOTS,
arguments: [
createObjectMatcher({
- _: `[2 /* DYNAMIC */]`
+ _: `[2 /* DYNAMIC */]`,
}),
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -663,9 +662,9 @@ describe('compiler: transform component slots', () => {
fn: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: undefined,
- returns: [{ type: NodeTypes.TEXT, content: `foo` }]
+ returns: [{ type: NodeTypes.TEXT, content: `foo` }],
},
- key: `0`
+ key: `0`,
}),
alternate: {
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
@@ -675,27 +674,27 @@ describe('compiler: transform component slots', () => {
fn: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: { content: `props` },
- returns: [{ type: NodeTypes.TEXT, content: `bar` }]
+ returns: [{ type: NodeTypes.TEXT, content: `bar` }],
},
- key: `1`
+ key: `1`,
}),
alternate: createObjectMatcher({
name: `one`,
fn: {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
params: undefined,
- returns: [{ type: NodeTypes.TEXT, content: `baz` }]
+ returns: [{ type: NodeTypes.TEXT, content: `baz` }],
},
- key: `2`
- })
- }
- }
- ]
- }
- ]
+ key: `2`,
+ }),
+ },
+ },
+ ],
+ },
+ ],
})
expect((root as any).children[0].codegenNode.patchFlag).toMatch(
- PatchFlags.DYNAMIC_SLOTS + ''
+ PatchFlags.DYNAMIC_SLOTS + '',
)
expect(generate(root).code).toMatchSnapshot()
})
@@ -705,14 +704,14 @@ describe('compiler: transform component slots', () => {
`
{{ name }}
`,
- { prefixIdentifiers: true }
+ { prefixIdentifiers: true },
)
expect(slots).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: CREATE_SLOTS,
arguments: [
createObjectMatcher({
- _: `[2 /* DYNAMIC */]`
+ _: `[2 /* DYNAMIC */]`,
}),
{
type: NodeTypes.JS_ARRAY_EXPRESSION,
@@ -732,20 +731,20 @@ describe('compiler: transform component slots', () => {
returns: [
{
type: NodeTypes.INTERPOLATION,
- content: { content: `name`, isStatic: false }
- }
- ]
- }
- })
- }
- ]
- }
- ]
- }
- ]
+ content: { content: `name`, isStatic: false },
+ },
+ ],
+ },
+ }),
+ },
+ ],
+ },
+ ],
+ },
+ ],
})
expect((root as any).children[0].codegenNode.patchFlag).toMatch(
- PatchFlags.DYNAMIC_SLOTS + ''
+ PatchFlags.DYNAMIC_SLOTS + '',
)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -756,13 +755,13 @@ describe('compiler: transform component slots', () => {
properties: [
{
key: { content: `default` },
- value: { type: NodeTypes.JS_FUNCTION_EXPRESSION }
+ value: { type: NodeTypes.JS_FUNCTION_EXPRESSION },
},
{
key: { content: `_` },
- value: { content: `3 /* FORWARDED */` }
- }
- ]
+ value: { content: `3 /* FORWARDED */` },
+ },
+ ],
}
test('
tag only', () => {
const { slots } = parseWithSlots(` `)
@@ -781,7 +780,7 @@ describe('compiler: transform component slots', () => {
test(' tag w/ template', () => {
const { slots } = parseWithSlots(
- ` `
+ ` `,
)
expect(slots).toMatchObject(toMatch)
})
@@ -794,7 +793,7 @@ describe('compiler: transform component slots', () => {
// # fix: #6900
test('consistent behavior of @xxx:modelValue and @xxx:model-value', () => {
const { root: rootUpper } = parseWithSlots(
- `
`
+ `
`,
)
const slotNodeUpper = (rootUpper.codegenNode! as VNodeCall)
.children as ElementNode[]
@@ -806,19 +805,19 @@ describe('compiler: transform component slots', () => {
{
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: 'onFoo:modelValue'
+ content: 'onFoo:modelValue',
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `handler`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
const { root } = parseWithSlots(
- `
`
+ `
`,
)
const slotNode = (root.codegenNode! as VNodeCall)
.children as ElementNode[]
@@ -829,15 +828,15 @@ describe('compiler: transform component slots', () => {
{
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
- content: 'onFoo:modelValue'
+ content: 'onFoo:modelValue',
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `handler`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
})
})
@@ -851,18 +850,17 @@ describe('compiler: transform component slots', () => {
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN,
loc: {
- source: `bar`,
start: {
offset: index,
line: 1,
- column: index + 1
+ column: index + 1,
},
end: {
offset: index + 3,
line: 1,
- column: index + 4
- }
- }
+ column: index + 4,
+ },
+ },
})
})
@@ -874,18 +872,17 @@ describe('compiler: transform component slots', () => {
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES,
loc: {
- source: `#foo`,
start: {
offset: index,
line: 1,
- column: index + 1
+ column: index + 1,
},
end: {
offset: index + 4,
line: 1,
- column: index + 5
- }
- }
+ column: index + 5,
+ },
+ },
})
})
@@ -897,18 +894,17 @@ describe('compiler: transform component slots', () => {
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE,
loc: {
- source: `#foo`,
start: {
offset: index,
line: 1,
- column: index + 1
+ column: index + 1,
},
end: {
offset: index + 4,
line: 1,
- column: index + 5
- }
- }
+ column: index + 5,
+ },
+ },
})
})
@@ -920,18 +916,17 @@ describe('compiler: transform component slots', () => {
expect(onError.mock.calls[0][0]).toMatchObject({
code: ErrorCodes.X_V_SLOT_MISPLACED,
loc: {
- source: `v-slot`,
start: {
offset: index,
line: 1,
- column: index + 1
+ column: index + 1,
},
end: {
offset: index + 6,
line: 1,
- column: index + 7
- }
- }
+ column: index + 7,
+ },
+ },
})
})
})
@@ -945,11 +940,11 @@ describe('compiler: transform component slots', () => {
`
const { root } = parseWithSlots(source, {
- whitespace: 'preserve'
+ whitespace: 'preserve',
})
expect(
- `Extraneous children found when component already has explicitly named default slot.`
+ `Extraneous children found when component already has explicitly named default slot.`,
).not.toHaveBeenWarned()
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -962,11 +957,11 @@ describe('compiler: transform component slots', () => {
`
const { root } = parseWithSlots(source, {
- whitespace: 'preserve'
+ whitespace: 'preserve',
})
expect(
- `Extraneous children found when component already has explicitly named default slot.`
+ `Extraneous children found when component already has explicitly named default slot.`,
).not.toHaveBeenWarned()
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
})
@@ -979,7 +974,7 @@ describe('compiler: transform component slots', () => {
`
const { root } = parseWithSlots(source, {
- whitespace: 'preserve'
+ whitespace: 'preserve',
})
// slots is vnodeCall's children as an ObjectExpression
@@ -989,7 +984,7 @@ describe('compiler: transform component slots', () => {
// should be: header, footer, _ (no default)
expect(slots.length).toBe(3)
expect(
- slots.some(p => (p.key as SimpleExpressionNode).content === 'default')
+ slots.some(p => (p.key as SimpleExpressionNode).content === 'default'),
).toBe(false)
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
diff --git a/packages/compiler-core/__tests__/utils.spec.ts b/packages/compiler-core/__tests__/utils.spec.ts
index 45fa46fea7a..506aa86982e 100644
--- a/packages/compiler-core/__tests__/utils.spec.ts
+++ b/packages/compiler-core/__tests__/utils.spec.ts
@@ -1,11 +1,10 @@
-import { TransformContext } from '../src'
-import { Position } from '../src/ast'
+import type { TransformContext } from '../src'
+import type { Position } from '../src/ast'
import {
- getInnerRange,
advancePositionWithClone,
- isMemberExpressionNode,
isMemberExpressionBrowser,
- toValidAssetId
+ isMemberExpressionNode,
+ toValidAssetId,
} from '../src/utils'
function p(line: number, column: number, offset: number): Position {
@@ -41,32 +40,6 @@ describe('advancePositionWithClone', () => {
})
})
-describe('getInnerRange', () => {
- const loc1 = {
- source: 'foo\nbar\nbaz',
- start: p(1, 1, 0),
- end: p(3, 3, 11)
- }
-
- test('at start', () => {
- const loc2 = getInnerRange(loc1, 0, 4)
- expect(loc2.start).toEqual(loc1.start)
- expect(loc2.end.column).toBe(1)
- expect(loc2.end.line).toBe(2)
- expect(loc2.end.offset).toBe(4)
- })
-
- test('in between', () => {
- const loc2 = getInnerRange(loc1, 4, 3)
- expect(loc2.start.column).toBe(1)
- expect(loc2.start.line).toBe(2)
- expect(loc2.start.offset).toBe(4)
- expect(loc2.end.column).toBe(4)
- expect(loc2.end.line).toBe(2)
- expect(loc2.end.offset).toBe(7)
- })
-})
-
describe('isMemberExpression', () => {
function commonAssertions(fn: (str: string) => boolean) {
// should work
@@ -122,6 +95,10 @@ describe('isMemberExpression', () => {
expect(fn(`123[a]`)).toBe(true)
expect(fn(`foo() as string`)).toBe(false)
expect(fn(`a + b as string`)).toBe(false)
+ // #9865
+ expect(fn('""')).toBe(false)
+ expect(fn('undefined')).toBe(false)
+ expect(fn('null')).toBe(false)
})
})
@@ -131,6 +108,6 @@ test('toValidAssetId', () => {
expect(toValidAssetId('div', 'filter')).toBe('_filter_div')
expect(toValidAssetId('foo-bar', 'component')).toBe('_component_foo_bar')
expect(toValidAssetId('test-测试-1', 'component')).toBe(
- '_component_test_2797935797_1'
+ '_component_test_2797935797_1',
)
})
diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json
index 68daa30ecd2..e794d4ff29e 100644
--- a/packages/compiler-core/package.json
+++ b/packages/compiler-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-core",
- "version": "3.3.4",
+ "version": "3.4.15",
"description": "@vue/compiler-core",
"main": "index.js",
"module": "dist/compiler-core.esm-bundler.js",
@@ -9,6 +9,20 @@
"index.js",
"dist"
],
+ "exports": {
+ ".": {
+ "types": "./dist/compiler-core.d.ts",
+ "node": {
+ "production": "./dist/compiler-core.cjs.prod.js",
+ "development": "./dist/compiler-core.cjs.js",
+ "default": "./index.js"
+ },
+ "module": "./dist/compiler-core.esm-bundler.js",
+ "import": "./dist/compiler-core.esm-bundler.js",
+ "require": "./index.js"
+ },
+ "./*": "./*"
+ },
"buildOptions": {
"name": "VueCompilerCore",
"compat": true,
@@ -32,12 +46,13 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
"dependencies": {
- "@babel/parser": "^7.21.3",
- "@vue/shared": "3.3.4",
+ "@babel/parser": "^7.23.6",
+ "@vue/shared": "workspace:*",
+ "entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.0.2"
},
"devDependencies": {
- "@babel/types": "^7.21.3"
+ "@babel/types": "^7.23.6"
}
}
diff --git a/packages/compiler-core/src/ast.ts b/packages/compiler-core/src/ast.ts
index 515083c336a..3f92a99fcbb 100644
--- a/packages/compiler-core/src/ast.ts
+++ b/packages/compiler-core/src/ast.ts
@@ -1,31 +1,32 @@
import { isString } from '@vue/shared'
-import { ForParseResult } from './transforms/vFor'
import {
- RENDER_SLOT,
- CREATE_SLOTS,
- RENDER_LIST,
+ CREATE_BLOCK,
+ CREATE_ELEMENT_BLOCK,
+ CREATE_ELEMENT_VNODE,
+ type CREATE_SLOTS,
+ CREATE_VNODE,
+ type FRAGMENT,
OPEN_BLOCK,
- FRAGMENT,
+ type RENDER_LIST,
+ type RENDER_SLOT,
WITH_DIRECTIVES,
- WITH_MEMO,
- CREATE_VNODE,
- CREATE_ELEMENT_VNODE,
- CREATE_BLOCK,
- CREATE_ELEMENT_BLOCK
+ type WITH_MEMO,
} from './runtimeHelpers'
-import { PropsExpression } from './transforms/transformElement'
-import { ImportItem, TransformContext } from './transform'
+import type { PropsExpression } from './transforms/transformElement'
+import type { ImportItem, TransformContext } from './transform'
+import type { Node as BabelNode } from '@babel/types'
// Vue template is a platform-agnostic superset of HTML (syntax only).
-// More namespaces like SVG and MathML are declared by platform specific
-// compilers.
+// More namespaces can be declared by platform specific compilers.
export type Namespace = number
-export const enum Namespaces {
- HTML
+export enum Namespaces {
+ HTML,
+ SVG,
+ MATH_ML,
}
-export const enum NodeTypes {
+export enum NodeTypes {
ROOT,
ELEMENT,
TEXT,
@@ -56,14 +57,14 @@ export const enum NodeTypes {
JS_IF_STATEMENT,
JS_ASSIGNMENT_EXPRESSION,
JS_SEQUENCE_EXPRESSION,
- JS_RETURN_STATEMENT
+ JS_RETURN_STATEMENT,
}
-export const enum ElementTypes {
+export enum ElementTypes {
ELEMENT,
COMPONENT,
SLOT,
- TEMPLATE
+ TEMPLATE,
}
export interface Node {
@@ -102,6 +103,7 @@ export type TemplateChildNode =
export interface RootNode extends Node {
type: NodeTypes.ROOT
+ source: string
children: TemplateChildNode[]
helpers: Set
components: string[]
@@ -112,6 +114,7 @@ export interface RootNode extends Node {
temps: number
ssrHelpers?: symbol[]
codegenNode?: TemplateChildNode | JSChildNode | BlockStatement
+ transformed?: boolean
// v2 compat only
filters?: string[]
@@ -128,9 +131,10 @@ export interface BaseElementNode extends Node {
ns: Namespace
tag: string
tagType: ElementTypes
- isSelfClosing: boolean
props: Array
children: TemplateChildNode[]
+ isSelfClosing?: boolean
+ innerLoc?: SourceLocation // only for SFC root level elements
}
export interface PlainElementNode extends BaseElementNode {
@@ -182,19 +186,28 @@ export interface CommentNode extends Node {
export interface AttributeNode extends Node {
type: NodeTypes.ATTRIBUTE
name: string
+ nameLoc: SourceLocation
value: TextNode | undefined
}
export interface DirectiveNode extends Node {
type: NodeTypes.DIRECTIVE
+ /**
+ * the normalized name without prefix or shorthands, e.g. "bind", "on"
+ */
name: string
+ /**
+ * the raw attribute name, preserving shorthand, and including arg & modifiers
+ * this is only used during parse.
+ */
+ rawName?: string
exp: ExpressionNode | undefined
arg: ExpressionNode | undefined
modifiers: string[]
/**
* optional property to cache the expression parse result for v-for
*/
- parseResult?: ForParseResult
+ forParseResult?: ForParseResult
}
/**
@@ -202,11 +215,11 @@ export interface DirectiveNode extends Node {
* Higher levels implies lower levels. e.g. a node that can be stringified
* can always be hoisted and skipped for patch.
*/
-export const enum ConstantTypes {
+export enum ConstantTypes {
NOT_CONSTANT = 0,
CAN_SKIP_PATCH,
CAN_HOIST,
- CAN_STRINGIFY
+ CAN_STRINGIFY,
}
export interface SimpleExpressionNode extends Node {
@@ -214,6 +227,12 @@ export interface SimpleExpressionNode extends Node {
content: string
isStatic: boolean
constType: ConstantTypes
+ /**
+ * - `null` means the expression is a simple identifier that doesn't need
+ * parsing
+ * - `false` means there was a parsing error
+ */
+ ast?: BabelNode | null | false
/**
* Indicates this is an identifier for a hoist vnode call and points to the
* hoisted node.
@@ -234,6 +253,12 @@ export interface InterpolationNode extends Node {
export interface CompoundExpressionNode extends Node {
type: NodeTypes.COMPOUND_EXPRESSION
+ /**
+ * - `null` means the expression is a simple identifier that doesn't need
+ * parsing
+ * - `false` means there was a parsing error
+ */
+ ast?: BabelNode | null | false
children: (
| SimpleExpressionNode
| CompoundExpressionNode
@@ -276,6 +301,14 @@ export interface ForNode extends Node {
codegenNode?: ForCodegenNode
}
+export interface ForParseResult {
+ source: ExpressionNode
+ value: ExpressionNode | undefined
+ key: ExpressionNode | undefined
+ index: ExpressionNode | undefined
+ finalized: boolean
+}
+
export interface TextCallNode extends Node {
type: NodeTypes.TEXT_CALL
content: TextNode | InterpolationNode | CompoundExpressionNode
@@ -462,7 +495,7 @@ export interface RenderSlotCall extends CallExpression {
string,
string | ExpressionNode,
PropsExpression | '{}',
- TemplateChildNode[]
+ TemplateChildNode[],
]
}
@@ -547,17 +580,18 @@ export interface ForIteratorExpression extends FunctionExpression {
// associated with template nodes, so their source locations are just a stub.
// Container types like CompoundExpression also don't need a real location.
export const locStub: SourceLocation = {
- source: '',
start: { line: 1, column: 1, offset: 0 },
- end: { line: 1, column: 1, offset: 0 }
+ end: { line: 1, column: 1, offset: 0 },
+ source: '',
}
export function createRoot(
children: TemplateChildNode[],
- loc = locStub
+ source = '',
): RootNode {
return {
type: NodeTypes.ROOT,
+ source,
children,
helpers: new Set(),
components: [],
@@ -567,7 +601,7 @@ export function createRoot(
cached: 0,
temps: 0,
codegenNode: undefined,
- loc
+ loc: locStub,
}
}
@@ -582,7 +616,7 @@ export function createVNodeCall(
isBlock: VNodeCall['isBlock'] = false,
disableTracking: VNodeCall['disableTracking'] = false,
isComponent: VNodeCall['isComponent'] = false,
- loc = locStub
+ loc = locStub,
): VNodeCall {
if (context) {
if (isBlock) {
@@ -607,41 +641,41 @@ export function createVNodeCall(
isBlock,
disableTracking,
isComponent,
- loc
+ loc,
}
}
export function createArrayExpression(
elements: ArrayExpression['elements'],
- loc: SourceLocation = locStub
+ loc: SourceLocation = locStub,
): ArrayExpression {
return {
type: NodeTypes.JS_ARRAY_EXPRESSION,
loc,
- elements
+ elements,
}
}
export function createObjectExpression(
properties: ObjectExpression['properties'],
- loc: SourceLocation = locStub
+ loc: SourceLocation = locStub,
): ObjectExpression {
return {
type: NodeTypes.JS_OBJECT_EXPRESSION,
loc,
- properties
+ properties,
}
}
export function createObjectProperty(
key: Property['key'] | string,
- value: Property['value']
+ value: Property['value'],
): Property {
return {
type: NodeTypes.JS_PROPERTY,
loc: locStub,
key: isString(key) ? createSimpleExpression(key, true) : key,
- value
+ value,
}
}
@@ -649,38 +683,38 @@ export function createSimpleExpression(
content: SimpleExpressionNode['content'],
isStatic: SimpleExpressionNode['isStatic'] = false,
loc: SourceLocation = locStub,
- constType: ConstantTypes = ConstantTypes.NOT_CONSTANT
+ constType: ConstantTypes = ConstantTypes.NOT_CONSTANT,
): SimpleExpressionNode {
return {
type: NodeTypes.SIMPLE_EXPRESSION,
loc,
content,
isStatic,
- constType: isStatic ? ConstantTypes.CAN_STRINGIFY : constType
+ constType: isStatic ? ConstantTypes.CAN_STRINGIFY : constType,
}
}
export function createInterpolation(
content: InterpolationNode['content'] | string,
- loc: SourceLocation
+ loc: SourceLocation,
): InterpolationNode {
return {
type: NodeTypes.INTERPOLATION,
loc,
content: isString(content)
? createSimpleExpression(content, false, loc)
- : content
+ : content,
}
}
export function createCompoundExpression(
children: CompoundExpressionNode['children'],
- loc: SourceLocation = locStub
+ loc: SourceLocation = locStub,
): CompoundExpressionNode {
return {
type: NodeTypes.COMPOUND_EXPRESSION,
loc,
- children
+ children,
}
}
@@ -691,13 +725,13 @@ type InferCodegenNodeType = T extends typeof RENDER_SLOT
export function createCallExpression(
callee: T,
args: CallExpression['arguments'] = [],
- loc: SourceLocation = locStub
+ loc: SourceLocation = locStub,
): InferCodegenNodeType {
return {
type: NodeTypes.JS_CALL_EXPRESSION,
loc,
callee,
- arguments: args
+ arguments: args,
} as InferCodegenNodeType
}
@@ -706,7 +740,7 @@ export function createFunctionExpression(
returns: FunctionExpression['returns'] = undefined,
newline: boolean = false,
isSlot: boolean = false,
- loc: SourceLocation = locStub
+ loc: SourceLocation = locStub,
): FunctionExpression {
return {
type: NodeTypes.JS_FUNCTION_EXPRESSION,
@@ -714,7 +748,7 @@ export function createFunctionExpression(
returns,
newline,
isSlot,
- loc
+ loc,
}
}
@@ -722,7 +756,7 @@ export function createConditionalExpression(
test: ConditionalExpression['test'],
consequent: ConditionalExpression['consequent'],
alternate: ConditionalExpression['alternate'],
- newline = true
+ newline = true,
): ConditionalExpression {
return {
type: NodeTypes.JS_CONDITIONAL_EXPRESSION,
@@ -730,87 +764,87 @@ export function createConditionalExpression(
consequent,
alternate,
newline,
- loc: locStub
+ loc: locStub,
}
}
export function createCacheExpression(
index: number,
value: JSChildNode,
- isVNode: boolean = false
+ isVNode: boolean = false,
): CacheExpression {
return {
type: NodeTypes.JS_CACHE_EXPRESSION,
index,
value,
isVNode,
- loc: locStub
+ loc: locStub,
}
}
export function createBlockStatement(
- body: BlockStatement['body']
+ body: BlockStatement['body'],
): BlockStatement {
return {
type: NodeTypes.JS_BLOCK_STATEMENT,
body,
- loc: locStub
+ loc: locStub,
}
}
export function createTemplateLiteral(
- elements: TemplateLiteral['elements']
+ elements: TemplateLiteral['elements'],
): TemplateLiteral {
return {
type: NodeTypes.JS_TEMPLATE_LITERAL,
elements,
- loc: locStub
+ loc: locStub,
}
}
export function createIfStatement(
test: IfStatement['test'],
consequent: IfStatement['consequent'],
- alternate?: IfStatement['alternate']
+ alternate?: IfStatement['alternate'],
): IfStatement {
return {
type: NodeTypes.JS_IF_STATEMENT,
test,
consequent,
alternate,
- loc: locStub
+ loc: locStub,
}
}
export function createAssignmentExpression(
left: AssignmentExpression['left'],
- right: AssignmentExpression['right']
+ right: AssignmentExpression['right'],
): AssignmentExpression {
return {
type: NodeTypes.JS_ASSIGNMENT_EXPRESSION,
left,
right,
- loc: locStub
+ loc: locStub,
}
}
export function createSequenceExpression(
- expressions: SequenceExpression['expressions']
+ expressions: SequenceExpression['expressions'],
): SequenceExpression {
return {
type: NodeTypes.JS_SEQUENCE_EXPRESSION,
expressions,
- loc: locStub
+ loc: locStub,
}
}
export function createReturnStatement(
- returns: ReturnStatement['returns']
+ returns: ReturnStatement['returns'],
): ReturnStatement {
return {
type: NodeTypes.JS_RETURN_STATEMENT,
returns,
- loc: locStub
+ loc: locStub,
}
}
@@ -824,7 +858,7 @@ export function getVNodeBlockHelper(ssr: boolean, isComponent: boolean) {
export function convertToBlock(
node: VNodeCall,
- { helper, removeHelper, inSSR }: TransformContext
+ { helper, removeHelper, inSSR }: TransformContext,
) {
if (!node.isBlock) {
node.isBlock = true
diff --git a/packages/compiler-core/src/babelUtils.ts b/packages/compiler-core/src/babelUtils.ts
index 4b8f4182d2c..b12a6d9b47f 100644
--- a/packages/compiler-core/src/babelUtils.ts
+++ b/packages/compiler-core/src/babelUtils.ts
@@ -1,12 +1,12 @@
// should only use types from @babel/types
// do not import runtime methods
import type {
+ BlockStatement,
+ Function,
Identifier,
Node,
- Function,
ObjectProperty,
- BlockStatement,
- Program
+ Program,
} from '@babel/types'
import { walk } from 'estree-walker'
@@ -17,22 +17,22 @@ export function walkIdentifiers(
parent: Node,
parentStack: Node[],
isReference: boolean,
- isLocal: boolean
+ isLocal: boolean,
) => void,
includeAll = false,
parentStack: Node[] = [],
- knownIds: Record = Object.create(null)
+ knownIds: Record = Object.create(null),
) {
if (__BROWSER__) {
return
}
const rootExp =
- root.type === 'Program' &&
- root.body[0].type === 'ExpressionStatement' &&
- root.body[0].expression
+ root.type === 'Program'
+ ? root.body[0].type === 'ExpressionStatement' && root.body[0].expression
+ : root
- ;(walk as any)(root, {
+ walk(root, {
enter(node: Node & { scopeIds?: Set }, parent: Node | undefined) {
parent && parentStack.push(parent)
if (
@@ -50,19 +50,29 @@ export function walkIdentifiers(
}
} else if (
node.type === 'ObjectProperty' &&
- parent!.type === 'ObjectPattern'
+ parent?.type === 'ObjectPattern'
) {
// mark property in destructure pattern
;(node as any).inPattern = true
} else if (isFunctionType(node)) {
- // walk function expressions and add its arguments to known identifiers
- // so that we don't prefix them
- walkFunctionParams(node, id => markScopeIdentifier(node, id, knownIds))
+ if (node.scopeIds) {
+ node.scopeIds.forEach(id => markKnownIds(id, knownIds))
+ } else {
+ // walk function expressions and add its arguments to known identifiers
+ // so that we don't prefix them
+ walkFunctionParams(node, id =>
+ markScopeIdentifier(node, id, knownIds),
+ )
+ }
} else if (node.type === 'BlockStatement') {
- // #3445 record block-level local variables
- walkBlockDeclarations(node, id =>
- markScopeIdentifier(node, id, knownIds)
- )
+ if (node.scopeIds) {
+ node.scopeIds.forEach(id => markKnownIds(id, knownIds))
+ } else {
+ // #3445 record block-level local variables
+ walkBlockDeclarations(node, id =>
+ markScopeIdentifier(node, id, knownIds),
+ )
+ }
}
},
leave(node: Node & { scopeIds?: Set }, parent: Node | undefined) {
@@ -75,14 +85,14 @@ export function walkIdentifiers(
}
}
}
- }
+ },
})
}
export function isReferencedIdentifier(
id: Identifier,
parent: Node | null,
- parentStack: Node[]
+ parentStack: Node[],
) {
if (__BROWSER__) {
return false
@@ -117,7 +127,7 @@ export function isReferencedIdentifier(
export function isInDestructureAssignment(
parent: Node,
- parentStack: Node[]
+ parentStack: Node[],
): boolean {
if (
parent &&
@@ -136,9 +146,22 @@ export function isInDestructureAssignment(
return false
}
+export function isInNewExpression(parentStack: Node[]): boolean {
+ let i = parentStack.length
+ while (i--) {
+ const p = parentStack[i]
+ if (p.type === 'NewExpression') {
+ return true
+ } else if (p.type !== 'MemberExpression') {
+ break
+ }
+ }
+ return false
+}
+
export function walkFunctionParams(
node: Function,
- onIdent: (id: Identifier) => void
+ onIdent: (id: Identifier) => void,
) {
for (const p of node.params) {
for (const id of extractIdentifiers(p)) {
@@ -149,7 +172,7 @@ export function walkFunctionParams(
export function walkBlockDeclarations(
block: BlockStatement | Program,
- onIdent: (node: Identifier) => void
+ onIdent: (node: Identifier) => void,
) {
for (const stmt of block.body) {
if (stmt.type === 'VariableDeclaration') {
@@ -165,13 +188,26 @@ export function walkBlockDeclarations(
) {
if (stmt.declare || !stmt.id) continue
onIdent(stmt.id)
+ } else if (
+ stmt.type === 'ForOfStatement' ||
+ stmt.type === 'ForInStatement' ||
+ stmt.type === 'ForStatement'
+ ) {
+ const variable = stmt.type === 'ForStatement' ? stmt.init : stmt.left
+ if (variable && variable.type === 'VariableDeclaration') {
+ for (const decl of variable.declarations) {
+ for (const id of extractIdentifiers(decl.id)) {
+ onIdent(id)
+ }
+ }
+ }
}
}
}
export function extractIdentifiers(
param: Node,
- nodes: Identifier[] = []
+ nodes: Identifier[] = [],
): Identifier[] {
switch (param.type) {
case 'Identifier':
@@ -214,20 +250,24 @@ export function extractIdentifiers(
return nodes
}
+function markKnownIds(name: string, knownIds: Record) {
+ if (name in knownIds) {
+ knownIds[name]++
+ } else {
+ knownIds[name] = 1
+ }
+}
+
function markScopeIdentifier(
node: Node & { scopeIds?: Set },
child: Identifier,
- knownIds: Record
+ knownIds: Record,
) {
const { name } = child
if (node.scopeIds && node.scopeIds.has(name)) {
return
}
- if (name in knownIds) {
- knownIds[name]++
- } else {
- knownIds[name] = 1
- }
+ markKnownIds(name, knownIds)
;(node.scopeIds || (node.scopeIds = new Set())).add(name)
}
@@ -426,5 +466,13 @@ export const TS_NODE_TYPES = [
'TSTypeAssertion', // (foo)
'TSNonNullExpression', // foo!
'TSInstantiationExpression', // foo
- 'TSSatisfiesExpression' // foo satisfies T
+ 'TSSatisfiesExpression', // foo satisfies T
]
+
+export function unwrapTSNode(node: Node): Node {
+ if (TS_NODE_TYPES.includes(node.type)) {
+ return unwrapTSNode((node as any).expression)
+ } else {
+ return node
+ }
+}
diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts
index 2b88ab0cfbd..4447e67aafa 100644
--- a/packages/compiler-core/src/codegen.ts
+++ b/packages/compiler-core/src/codegen.ts
@@ -1,60 +1,60 @@
-import { CodegenOptions } from './options'
+import type { CodegenOptions } from './options'
import {
- RootNode,
- TemplateChildNode,
- TextNode,
- CommentNode,
- ExpressionNode,
+ type ArrayExpression,
+ type AssignmentExpression,
+ type CacheExpression,
+ type CallExpression,
+ type CommentNode,
+ type CompoundExpressionNode,
+ type ConditionalExpression,
+ type ExpressionNode,
+ type FunctionExpression,
+ type IfStatement,
+ type InterpolationNode,
+ type JSChildNode,
NodeTypes,
- JSChildNode,
- CallExpression,
- ArrayExpression,
- ObjectExpression,
- Position,
- InterpolationNode,
- CompoundExpressionNode,
- SimpleExpressionNode,
- FunctionExpression,
- ConditionalExpression,
- CacheExpression,
- locStub,
- SSRCodegenNode,
- TemplateLiteral,
- IfStatement,
- AssignmentExpression,
- ReturnStatement,
- VNodeCall,
- SequenceExpression,
+ type ObjectExpression,
+ type Position,
+ type ReturnStatement,
+ type RootNode,
+ type SSRCodegenNode,
+ type SequenceExpression,
+ type SimpleExpressionNode,
+ type TemplateChildNode,
+ type TemplateLiteral,
+ type TextNode,
+ type VNodeCall,
getVNodeBlockHelper,
- getVNodeHelper
+ getVNodeHelper,
+ locStub,
} from './ast'
-import { SourceMapGenerator, RawSourceMap } from 'source-map-js'
+import { type RawSourceMap, SourceMapGenerator } from 'source-map-js'
import {
advancePositionWithMutation,
assert,
isSimpleIdentifier,
- toValidAssetId
+ toValidAssetId,
} from './utils'
-import { isString, isArray, isSymbol } from '@vue/shared'
+import { isArray, isString, isSymbol } from '@vue/shared'
import {
- helperNameMap,
- TO_DISPLAY_STRING,
+ CREATE_COMMENT,
+ CREATE_ELEMENT_VNODE,
+ CREATE_STATIC,
+ CREATE_TEXT,
CREATE_VNODE,
+ OPEN_BLOCK,
+ POP_SCOPE_ID,
+ PUSH_SCOPE_ID,
RESOLVE_COMPONENT,
RESOLVE_DIRECTIVE,
+ RESOLVE_FILTER,
SET_BLOCK_TRACKING,
- CREATE_COMMENT,
- CREATE_TEXT,
- PUSH_SCOPE_ID,
- POP_SCOPE_ID,
- WITH_DIRECTIVES,
- CREATE_ELEMENT_VNODE,
- OPEN_BLOCK,
- CREATE_STATIC,
+ TO_DISPLAY_STRING,
WITH_CTX,
- RESOLVE_FILTER
+ WITH_DIRECTIVES,
+ helperNameMap,
} from './runtimeHelpers'
-import { ImportItem } from './transform'
+import type { ImportItem } from './transform'
const PURE_ANNOTATION = `/*#__PURE__*/`
@@ -69,6 +69,13 @@ export interface CodegenResult {
map?: RawSourceMap
}
+enum NewlineType {
+ Start = 0,
+ End = -1,
+ None = -2,
+ Unknown = -3,
+}
+
export interface CodegenContext
extends Omit, 'bindingMetadata' | 'inline'> {
source: string
@@ -80,7 +87,7 @@ export interface CodegenContext
pure: boolean
map?: SourceMapGenerator
helper(key: symbol): string
- push(code: string, node?: CodegenNode): void
+ push(code: string, newlineIndex?: number, node?: CodegenNode): void
indent(): void
deindent(withoutNewLine?: boolean): void
newline(): void
@@ -100,8 +107,8 @@ function createCodegenContext(
ssrRuntimeModuleName = 'vue/server-renderer',
ssr = false,
isTS = false,
- inSSR = false
- }: CodegenOptions
+ inSSR = false,
+ }: CodegenOptions,
): CodegenContext {
const context: CodegenContext = {
mode,
@@ -116,7 +123,7 @@ function createCodegenContext(
ssr,
isTS,
inSSR,
- source: ast.loc.source,
+ source: ast.source,
code: ``,
column: 1,
line: 1,
@@ -127,7 +134,7 @@ function createCodegenContext(
helper(key) {
return `_${helperNameMap[key]}`
},
- push(code, node) {
+ push(code, newlineIndex = NewlineType.None, node) {
context.code += code
if (!__BROWSER__ && context.map) {
if (node) {
@@ -140,7 +147,41 @@ function createCodegenContext(
}
addMapping(node.loc.start, name)
}
- advancePositionWithMutation(context, code)
+ if (newlineIndex === NewlineType.Unknown) {
+ // multiple newlines, full iteration
+ advancePositionWithMutation(context, code)
+ } else {
+ // fast paths
+ context.offset += code.length
+ if (newlineIndex === NewlineType.None) {
+ // no newlines; fast path to avoid newline detection
+ if (__TEST__ && code.includes('\n')) {
+ throw new Error(
+ `CodegenContext.push() called newlineIndex: none, but contains` +
+ `newlines: ${code.replace(/\n/g, '\\n')}`,
+ )
+ }
+ context.column += code.length
+ } else {
+ // single newline at known index
+ if (newlineIndex === NewlineType.End) {
+ newlineIndex = code.length - 1
+ }
+ if (
+ __TEST__ &&
+ (code.charAt(newlineIndex) !== '\n' ||
+ code.slice(0, newlineIndex).includes('\n') ||
+ code.slice(newlineIndex + 1).includes('\n'))
+ ) {
+ throw new Error(
+ `CodegenContext.push() called with newlineIndex: ${newlineIndex} ` +
+ `but does not conform: ${code.replace(/\n/g, '\\n')}`,
+ )
+ }
+ context.line++
+ context.column = code.length - newlineIndex
+ }
+ }
if (node && node.loc !== locStub) {
addMapping(node.loc.end)
}
@@ -158,32 +199,35 @@ function createCodegenContext(
},
newline() {
newline(context.indentLevel)
- }
+ },
}
function newline(n: number) {
- context.push('\n' + ` `.repeat(n))
+ context.push('\n' + ` `.repeat(n), NewlineType.Start)
}
- function addMapping(loc: Position, name?: string) {
- context.map!.addMapping({
+ function addMapping(loc: Position, name: string | null = null) {
+ // we use the private property to directly add the mapping
+ // because the addMapping() implementation in source-map-js has a bunch of
+ // unnecessary arg and validation checks that are pure overhead in our case.
+ const { _names, _mappings } = context.map!
+ if (name !== null && !_names.has(name)) _names.add(name)
+ _mappings.add({
+ originalLine: loc.line,
+ originalColumn: loc.column - 1, // source-map column is 0 based
+ generatedLine: context.line,
+ generatedColumn: context.column - 1,
+ source: filename,
+ // @ts-expect-error it is possible to be null
name,
- source: context.filename,
- original: {
- line: loc.line,
- column: loc.column - 1 // source-map column is 0 based
- },
- generated: {
- line: context.line,
- column: context.column - 1
- }
})
}
if (!__BROWSER__ && sourceMap) {
// lazy require source-map implementation, only in non-browser builds
context.map = new SourceMapGenerator()
- context.map!.setSourceContent(filename, context.source)
+ context.map.setSourceContent(filename, context.source)
+ context.map._sources.add(filename)
}
return context
@@ -193,7 +237,7 @@ export function generate(
ast: RootNode,
options: CodegenOptions & {
onContextCreated?: (context: CodegenContext) => void
- } = {}
+ } = {},
): CodegenResult {
const context = createCodegenContext(ast, options)
if (options.onContextCreated) options.onContextCreated(context)
@@ -205,7 +249,7 @@ export function generate(
deindent,
newline,
scopeId,
- ssr
+ ssr,
} = context
const helpers = Array.from(ast.helpers)
@@ -250,8 +294,10 @@ export function generate(
// function mode const declarations should be inside with block
// also they should be renamed to avoid collision with user properties
if (hasHelpers) {
- push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`)
- push(`\n`)
+ push(
+ `const { ${helpers.map(aliasHelper).join(', ')} } = _Vue\n`,
+ NewlineType.End,
+ )
newline()
}
}
@@ -282,7 +328,7 @@ export function generate(
}
}
if (ast.components.length || ast.directives.length || ast.temps) {
- push(`\n`)
+ push(`\n`, NewlineType.Start)
newline()
}
@@ -308,8 +354,7 @@ export function generate(
ast,
code: context.code,
preamble: isSetupInlined ? preambleContext.code : ``,
- // SourceMapGenerator does have toJSON() method but it's not in the types
- map: context.map ? (context.map as any).toJSON() : undefined
+ map: context.map ? context.map.toJSON() : undefined,
}
}
@@ -321,7 +366,7 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
newline,
runtimeModuleName,
runtimeGlobalName,
- ssrRuntimeModuleName
+ ssrRuntimeModuleName,
} = context
const VueBinding =
!__BROWSER__ && ssr
@@ -334,11 +379,14 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
const helpers = Array.from(ast.helpers)
if (helpers.length > 0) {
if (!__BROWSER__ && prefixIdentifiers) {
- push(`const { ${helpers.map(aliasHelper).join(', ')} } = ${VueBinding}\n`)
+ push(
+ `const { ${helpers.map(aliasHelper).join(', ')} } = ${VueBinding}\n`,
+ NewlineType.End,
+ )
} else {
// "with" mode.
// save Vue in a separate variable to avoid collision
- push(`const _Vue = ${VueBinding}\n`)
+ push(`const _Vue = ${VueBinding}\n`, NewlineType.End)
// in "with" mode, helpers are declared inside the with block to avoid
// has check cost, but hoists are lifted out of the function - we need
// to provide the helper here.
@@ -348,12 +396,12 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
CREATE_ELEMENT_VNODE,
CREATE_COMMENT,
CREATE_TEXT,
- CREATE_STATIC
+ CREATE_STATIC,
]
.filter(helper => helpers.includes(helper))
.map(aliasHelper)
.join(', ')
- push(`const { ${staticHelpers} } = _Vue\n`)
+ push(`const { ${staticHelpers} } = _Vue\n`, NewlineType.End)
}
}
}
@@ -363,7 +411,8 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
push(
`const { ${ast.ssrHelpers
.map(aliasHelper)
- .join(', ')} } = require("${ssrRuntimeModuleName}")\n`
+ .join(', ')} } = require("${ssrRuntimeModuleName}")\n`,
+ NewlineType.End,
)
}
genHoists(ast.hoists, context)
@@ -375,14 +424,14 @@ function genModulePreamble(
ast: RootNode,
context: CodegenContext,
genScopeId: boolean,
- inline?: boolean
+ inline?: boolean,
) {
const {
push,
newline,
optimizeImports,
runtimeModuleName,
- ssrRuntimeModuleName
+ ssrRuntimeModuleName,
} = context
if (genScopeId && ast.hoists.length) {
@@ -402,18 +451,21 @@ function genModulePreamble(
push(
`import { ${helpers
.map(s => helperNameMap[s])
- .join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`
+ .join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`,
+ NewlineType.End,
)
push(
`\n// Binding optimization for webpack code-split\nconst ${helpers
.map(s => `_${helperNameMap[s]} = ${helperNameMap[s]}`)
- .join(', ')}\n`
+ .join(', ')}\n`,
+ NewlineType.End,
)
} else {
push(
`import { ${helpers
.map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
- .join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`
+ .join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`,
+ NewlineType.End,
)
}
}
@@ -422,7 +474,8 @@ function genModulePreamble(
push(
`import { ${ast.ssrHelpers
.map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
- .join(', ')} } from "${ssrRuntimeModuleName}"\n`
+ .join(', ')} } from "${ssrRuntimeModuleName}"\n`,
+ NewlineType.End,
)
}
@@ -442,14 +495,14 @@ function genModulePreamble(
function genAssets(
assets: string[],
type: 'component' | 'directive' | 'filter',
- { helper, push, newline, isTS }: CodegenContext
+ { helper, push, newline, isTS }: CodegenContext,
) {
const resolver = helper(
__COMPAT__ && type === 'filter'
? RESOLVE_FILTER
: type === 'component'
- ? RESOLVE_COMPONENT
- : RESOLVE_DIRECTIVE
+ ? RESOLVE_COMPONENT
+ : RESOLVE_DIRECTIVE,
)
for (let i = 0; i < assets.length; i++) {
let id = assets[i]
@@ -461,7 +514,7 @@ function genAssets(
push(
`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${
maybeSelfReference ? `, true` : ``
- })${isTS ? `!` : ``}`
+ })${isTS ? `!` : ``}`,
)
if (i < assets.length - 1) {
newline()
@@ -482,8 +535,8 @@ function genHoists(hoists: (JSChildNode | null)[], context: CodegenContext) {
if (genScopeId) {
push(
`const _withScopeId = n => (${helper(
- PUSH_SCOPE_ID
- )}("${scopeId}"),n=n(),${helper(POP_SCOPE_ID)}(),n)`
+ PUSH_SCOPE_ID,
+ )}("${scopeId}"),n=n(),${helper(POP_SCOPE_ID)}(),n)`,
)
newline()
}
@@ -495,7 +548,7 @@ function genHoists(hoists: (JSChildNode | null)[], context: CodegenContext) {
push(
`const _hoisted_${i + 1} = ${
needScopeIdWrapper ? `${PURE_ANNOTATION} _withScopeId(() => ` : ``
- }`
+ }`,
)
genNode(exp, context)
if (needScopeIdWrapper) {
@@ -532,7 +585,7 @@ function isText(n: string | CodegenNode) {
function genNodeListAsArray(
nodes: (string | CodegenNode | TemplateChildNode[])[],
- context: CodegenContext
+ context: CodegenContext,
) {
const multilines =
nodes.length > 3 ||
@@ -548,13 +601,13 @@ function genNodeList(
nodes: (string | symbol | CodegenNode | TemplateChildNode[])[],
context: CodegenContext,
multilines: boolean = false,
- comma: boolean = true
+ comma: boolean = true,
) {
const { push, newline } = context
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i]
if (isString(node)) {
- push(node)
+ push(node, NewlineType.Unknown)
} else if (isArray(node)) {
genNodeListAsArray(node, context)
} else {
@@ -573,7 +626,7 @@ function genNodeList(
function genNode(node: CodegenNode | symbol | string, context: CodegenContext) {
if (isString(node)) {
- context.push(node)
+ context.push(node, NewlineType.Unknown)
return
}
if (isSymbol(node)) {
@@ -588,7 +641,7 @@ function genNode(node: CodegenNode | symbol | string, context: CodegenContext) {
assert(
node.codegenNode != null,
`Codegen node is missing for element/if/for node. ` +
- `Apply appropriate transforms first.`
+ `Apply appropriate transforms first.`,
)
genNode(node.codegenNode!, context)
break
@@ -669,14 +722,18 @@ function genNode(node: CodegenNode | symbol | string, context: CodegenContext) {
function genText(
node: TextNode | SimpleExpressionNode,
- context: CodegenContext
+ context: CodegenContext,
) {
- context.push(JSON.stringify(node.content), node)
+ context.push(JSON.stringify(node.content), NewlineType.Unknown, node)
}
function genExpression(node: SimpleExpressionNode, context: CodegenContext) {
const { content, isStatic } = node
- context.push(isStatic ? JSON.stringify(content) : content, node)
+ context.push(
+ isStatic ? JSON.stringify(content) : content,
+ NewlineType.Unknown,
+ node,
+ )
}
function genInterpolation(node: InterpolationNode, context: CodegenContext) {
@@ -689,12 +746,12 @@ function genInterpolation(node: InterpolationNode, context: CodegenContext) {
function genCompoundExpression(
node: CompoundExpressionNode,
- context: CodegenContext
+ context: CodegenContext,
) {
for (let i = 0; i < node.children!.length; i++) {
const child = node.children![i]
if (isString(child)) {
- context.push(child)
+ context.push(child, NewlineType.Unknown)
} else {
genNode(child, context)
}
@@ -703,7 +760,7 @@ function genCompoundExpression(
function genExpressionAsPropertyKey(
node: ExpressionNode,
- context: CodegenContext
+ context: CodegenContext,
) {
const { push } = context
if (node.type === NodeTypes.COMPOUND_EXPRESSION) {
@@ -715,9 +772,9 @@ function genExpressionAsPropertyKey(
const text = isSimpleIdentifier(node.content)
? node.content
: JSON.stringify(node.content)
- push(text, node)
+ push(text, NewlineType.None, node)
} else {
- push(`[${node.content}]`, node)
+ push(`[${node.content}]`, NewlineType.Unknown, node)
}
}
@@ -726,7 +783,11 @@ function genComment(node: CommentNode, context: CodegenContext) {
if (pure) {
push(PURE_ANNOTATION)
}
- push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node)
+ push(
+ `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,
+ NewlineType.Unknown,
+ node,
+ )
}
function genVNodeCall(node: VNodeCall, context: CodegenContext) {
@@ -740,7 +801,7 @@ function genVNodeCall(node: VNodeCall, context: CodegenContext) {
directives,
isBlock,
disableTracking,
- isComponent
+ isComponent,
} = node
if (directives) {
push(helper(WITH_DIRECTIVES) + `(`)
@@ -754,10 +815,10 @@ function genVNodeCall(node: VNodeCall, context: CodegenContext) {
const callHelper: symbol = isBlock
? getVNodeBlockHelper(context.inSSR, isComponent)
: getVNodeHelper(context.inSSR, isComponent)
- push(helper(callHelper) + `(`, node)
+ push(helper(callHelper) + `(`, NewlineType.None, node)
genNodeList(
genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
- context
+ context,
)
push(`)`)
if (isBlock) {
@@ -785,7 +846,7 @@ function genCallExpression(node: CallExpression, context: CodegenContext) {
if (pure) {
push(PURE_ANNOTATION)
}
- push(callee + `(`, node)
+ push(callee + `(`, NewlineType.None, node)
genNodeList(node.arguments, context)
push(`)`)
}
@@ -794,7 +855,7 @@ function genObjectExpression(node: ObjectExpression, context: CodegenContext) {
const { push, indent, deindent, newline } = context
const { properties } = node
if (!properties.length) {
- push(`{}`, node)
+ push(`{}`, NewlineType.None, node)
return
}
const multilines =
@@ -826,7 +887,7 @@ function genArrayExpression(node: ArrayExpression, context: CodegenContext) {
function genFunctionExpression(
node: FunctionExpression,
- context: CodegenContext
+ context: CodegenContext,
) {
const { push, indent, deindent } = context
const { params, returns, body, newline, isSlot } = node
@@ -834,7 +895,7 @@ function genFunctionExpression(
// wrap slot functions with owner context
push(`_${helperNameMap[WITH_CTX]}(`)
}
- push(`(`, node)
+ push(`(`, NewlineType.None, node)
if (isArray(params)) {
genNodeList(params, context)
} else if (params) {
@@ -871,7 +932,7 @@ function genFunctionExpression(
function genConditionalExpression(
node: ConditionalExpression,
- context: CodegenContext
+ context: CodegenContext,
) {
const { test, consequent, alternate, newline: needNewline } = node
const { push, indent, deindent, newline } = context
@@ -934,7 +995,7 @@ function genTemplateLiteral(node: TemplateLiteral, context: CodegenContext) {
for (let i = 0; i < l; i++) {
const e = node.elements[i]
if (isString(e)) {
- push(e.replace(/(`|\$|\\)/g, '\\$1'))
+ push(e.replace(/(`|\$|\\)/g, '\\$1'), NewlineType.Unknown)
} else {
push('${')
if (multilines) indent()
@@ -972,7 +1033,7 @@ function genIfStatement(node: IfStatement, context: CodegenContext) {
function genAssignmentExpression(
node: AssignmentExpression,
- context: CodegenContext
+ context: CodegenContext,
) {
genNode(node.left, context)
context.push(` = `)
@@ -981,7 +1042,7 @@ function genAssignmentExpression(
function genSequenceExpression(
node: SequenceExpression,
- context: CodegenContext
+ context: CodegenContext,
) {
context.push(`(`)
genNodeList(node.expressions, context)
@@ -990,7 +1051,7 @@ function genSequenceExpression(
function genReturnStatement(
{ returns }: ReturnStatement,
- context: CodegenContext
+ context: CodegenContext,
) {
context.push(`return `)
if (isArray(returns)) {
diff --git a/packages/compiler-core/src/compat/compatConfig.ts b/packages/compiler-core/src/compat/compatConfig.ts
index dcb304263b4..bf06f4aae0f 100644
--- a/packages/compiler-core/src/compat/compatConfig.ts
+++ b/packages/compiler-core/src/compat/compatConfig.ts
@@ -1,7 +1,7 @@
-import { SourceLocation } from '../ast'
-import { CompilerError } from '../errors'
-import { ParserContext } from '../parse'
-import { TransformContext } from '../transform'
+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
@@ -13,16 +13,15 @@ export interface CompilerCompatOptions {
compatConfig?: CompilerCompatConfig
}
-export const enum CompilerDeprecationTypes {
+export enum CompilerDeprecationTypes {
COMPILER_IS_ON_ELEMENT = 'COMPILER_IS_ON_ELEMENT',
COMPILER_V_BIND_SYNC = 'COMPILER_V_BIND_SYNC',
- COMPILER_V_BIND_PROP = 'COMPILER_V_BIND_PROP',
COMPILER_V_BIND_OBJECT_ORDER = 'COMPILER_V_BIND_OBJECT_ORDER',
COMPILER_V_ON_NATIVE = 'COMPILER_V_ON_NATIVE',
COMPILER_V_IF_V_FOR_PRECEDENCE = 'COMPILER_V_IF_V_FOR_PRECEDENCE',
COMPILER_NATIVE_TEMPLATE = 'COMPILER_NATIVE_TEMPLATE',
COMPILER_INLINE_TEMPLATE = 'COMPILER_INLINE_TEMPLATE',
- COMPILER_FILTERS = 'COMPILER_FILTER'
+ COMPILER_FILTERS = 'COMPILER_FILTERS',
}
type DeprecationData = {
@@ -36,7 +35,7 @@ const deprecationData: Record = {
`Platform-native elements with "is" prop will no longer be ` +
`treated as components in Vue 3 unless the "is" value is explicitly ` +
`prefixed with "vue:".`,
- link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`
+ link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`,
},
[CompilerDeprecationTypes.COMPILER_V_BIND_SYNC]: {
@@ -44,13 +43,7 @@ const deprecationData: Record = {
`.sync modifier for v-bind has been removed. Use v-model with ` +
`argument instead. \`v-bind:${key}.sync\` should be changed to ` +
`\`v-model:${key}\`.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
- },
-
- [CompilerDeprecationTypes.COMPILER_V_BIND_PROP]: {
- message:
- `.prop modifier for v-bind has been removed and no longer necessary. ` +
- `Vue 3 will automatically set a binding as DOM property when appropriate.`
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`,
},
[CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER]: {
@@ -60,12 +53,12 @@ const deprecationData: Record = {
`that appears before v-bind in the case of conflict. ` +
`To retain 2.x behavior, move v-bind to make it the first attribute. ` +
`You can also suppress this warning if the usage is intended.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`,
},
[CompilerDeprecationTypes.COMPILER_V_ON_NATIVE]: {
message: `.native modifier for v-on has been removed as is no longer necessary.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`,
},
[CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE]: {
@@ -75,18 +68,18 @@ const deprecationData: Record = {
`access to v-for scope variables. It is best to avoid the ambiguity ` +
`with tags or use a computed property that filters v-for ` +
`data source.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`,
},
[CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE]: {
message:
` with no special directives will render as a native template ` +
- `element instead of its inner content in Vue 3.`
+ `element instead of its inner content in Vue 3.`,
},
[CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE]: {
message: `"inline-template" has been removed in Vue 3.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
+ link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`,
},
[CompilerDeprecationTypes.COMPILER_FILTERS]: {
@@ -94,18 +87,15 @@ const deprecationData: Record = {
`filters have been removed in Vue 3. ` +
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
`Use method calls or computed properties instead.`,
- link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
- }
+ link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`,
+ },
}
function getCompatValue(
key: CompilerDeprecationTypes | 'MODE',
- context: ParserContext | TransformContext
+ { compatConfig }: MergedParserOptions | TransformContext,
) {
- const config = (context as ParserContext).options
- ? (context as ParserContext).options.compatConfig
- : (context as TransformContext).compatConfig
- const value = config && config[key]
+ const value = compatConfig && compatConfig[key]
if (key === 'MODE') {
return value || 3 // compiler defaults to v3 behavior
} else {
@@ -115,7 +105,7 @@ function getCompatValue(
export function isCompatEnabled(
key: CompilerDeprecationTypes,
- context: ParserContext | TransformContext
+ context: MergedParserOptions | TransformContext,
) {
const mode = getCompatValue('MODE', context)
const value = getCompatValue(key, context)
@@ -126,7 +116,7 @@ export function isCompatEnabled(
export function checkCompatEnabled(
key: CompilerDeprecationTypes,
- context: ParserContext | TransformContext,
+ context: MergedParserOptions | TransformContext,
loc: SourceLocation | null,
...args: any[]
): boolean {
@@ -139,7 +129,7 @@ export function checkCompatEnabled(
export function warnDeprecation(
key: CompilerDeprecationTypes,
- context: ParserContext | TransformContext,
+ context: MergedParserOptions | TransformContext,
loc: SourceLocation | null,
...args: any[]
) {
diff --git a/packages/compiler-core/src/compat/transformFilter.ts b/packages/compiler-core/src/compat/transformFilter.ts
index 77331db4d80..86d11f52a60 100644
--- a/packages/compiler-core/src/compat/transformFilter.ts
+++ b/packages/compiler-core/src/compat/transformFilter.ts
@@ -1,17 +1,17 @@
import { RESOLVE_FILTER } from '../runtimeHelpers'
import {
- ExpressionNode,
- AttributeNode,
- DirectiveNode,
+ type AttributeNode,
+ type DirectiveNode,
+ type ExpressionNode,
NodeTypes,
- SimpleExpressionNode
+ type SimpleExpressionNode,
} from '../ast'
import {
CompilerDeprecationTypes,
isCompatEnabled,
- warnDeprecation
+ warnDeprecation,
} from './compatConfig'
-import { NodeTransform, TransformContext } from '../transform'
+import type { NodeTransform, TransformContext } from '../transform'
import { toValidAssetId } from '../utils'
const validDivisionCharRE = /[\w).+\-_$\]]/
@@ -162,7 +162,7 @@ function parseFilter(node: SimpleExpressionNode, context: TransformContext) {
warnDeprecation(
CompilerDeprecationTypes.COMPILER_FILTERS,
context,
- node.loc
+ node.loc,
)
for (i = 0; i < filters.length; i++) {
expression = wrapFilter(expression, filters[i], context)
@@ -174,7 +174,7 @@ function parseFilter(node: SimpleExpressionNode, context: TransformContext) {
function wrapFilter(
exp: string,
filter: string,
- context: TransformContext
+ context: TransformContext,
): string {
context.helper(RESOLVE_FILTER)
const i = filter.indexOf('(')
diff --git a/packages/compiler-core/src/compile.ts b/packages/compiler-core/src/compile.ts
index 95e3718964a..854c2bc6d69 100644
--- a/packages/compiler-core/src/compile.ts
+++ b/packages/compiler-core/src/compile.ts
@@ -1,9 +1,13 @@
-import { CompilerOptions } from './options'
-import { baseParse } from './parse'
-import { transform, NodeTransform, DirectiveTransform } from './transform'
-import { generate, CodegenResult } from './codegen'
-import { RootNode } from './ast'
-import { isString, extend } from '@vue/shared'
+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'
import { transformIf } from './transforms/vIf'
import { transformFor } from './transforms/vFor'
import { transformExpression } from './transforms/transformExpression'
@@ -16,16 +20,16 @@ import { transformText } from './transforms/transformText'
import { transformOnce } from './transforms/vOnce'
import { transformModel } from './transforms/vModel'
import { transformFilter } from './compat/transformFilter'
-import { defaultOnError, createCompilerError, ErrorCodes } from './errors'
+import { ErrorCodes, createCompilerError, defaultOnError } from './errors'
import { transformMemo } from './transforms/vMemo'
export type TransformPreset = [
NodeTransform[],
- Record
+ Record,
]
export function getBaseTransformPreset(
- prefixIdentifiers?: boolean
+ prefixIdentifiers?: boolean,
): TransformPreset {
return [
[
@@ -38,29 +42,29 @@ export function getBaseTransformPreset(
? [
// order is important
trackVForSlotScopes,
- transformExpression
+ transformExpression,
]
: __BROWSER__ && __DEV__
- ? [transformExpression]
- : []),
+ ? [transformExpression]
+ : []),
transformSlotOutlet,
transformElement,
trackSlotScopes,
- transformText
+ transformText,
],
{
on: transformOn,
bind: transformBind,
- model: transformModel
- }
+ model: transformModel,
+ },
]
}
// we name it `baseCompile` so that higher order compilers like
// @vue/compiler-dom can export `compile` while re-exporting everything else.
export function baseCompile(
- template: string | RootNode,
- options: CompilerOptions = {}
+ source: string | RootNode,
+ options: CompilerOptions = {},
): CodegenResult {
const onError = options.onError || defaultOnError
const isModuleMode = options.mode === 'module'
@@ -82,7 +86,10 @@ export function baseCompile(
onError(createCompilerError(ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED))
}
- const ast = isString(template) ? baseParse(template, options) : template
+ const resolvedOptions = extend({}, options, {
+ prefixIdentifiers,
+ })
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source
const [nodeTransforms, directiveTransforms] =
getBaseTransformPreset(prefixIdentifiers)
@@ -95,24 +102,18 @@ export function baseCompile(
transform(
ast,
- extend({}, options, {
- prefixIdentifiers,
+ extend({}, resolvedOptions, {
nodeTransforms: [
...nodeTransforms,
- ...(options.nodeTransforms || []) // user transforms
+ ...(options.nodeTransforms || []), // user transforms
],
directiveTransforms: extend(
{},
directiveTransforms,
- options.directiveTransforms || {} // user transforms
- )
- })
+ options.directiveTransforms || {}, // user transforms
+ ),
+ }),
)
- return generate(
- ast,
- extend({}, options, {
- prefixIdentifiers
- })
- )
+ return generate(ast, resolvedOptions)
}
diff --git a/packages/compiler-core/src/errors.ts b/packages/compiler-core/src/errors.ts
index 36ab783edbe..6728a80d44a 100644
--- a/packages/compiler-core/src/errors.ts
+++ b/packages/compiler-core/src/errors.ts
@@ -1,4 +1,4 @@
-import { SourceLocation } from './ast'
+import type { SourceLocation } from './ast'
export interface CompilerError extends SyntaxError {
code: number | string
@@ -25,19 +25,19 @@ export function createCompilerError(
code: T,
loc?: SourceLocation,
messages?: { [code: number]: string },
- additionalMessage?: string
+ additionalMessage?: string,
): InferCompilerError {
const msg =
__DEV__ || !__BROWSER__
? (messages || errorMessages)[code] + (additionalMessage || ``)
- : code
+ : `https://vuejs.org/error-reference/#compiler-${code}`
const error = new SyntaxError(String(msg)) as InferCompilerError
error.code = code
error.loc = loc
return error
}
-export const enum ErrorCodes {
+export enum ErrorCodes {
// parse errors
ABRUPT_CLOSING_OF_EMPTY_COMMENT,
CDATA_IN_HTML_CONTENT,
@@ -96,15 +96,12 @@ export const enum ErrorCodes {
X_MODULE_MODE_NOT_SUPPORTED,
X_CACHE_HANDLER_NOT_SUPPORTED,
X_SCOPE_ID_NOT_SUPPORTED,
-
- // deprecations
- DEPRECATION_VNODE_HOOKS,
- DEPRECATION_V_IS,
+ X_VNODE_HOOKS,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
- __EXTEND_POINT__
+ __EXTEND_POINT__,
}
export const errorMessages: Record = {
@@ -176,6 +173,7 @@ export const errorMessages: Record = {
[ErrorCodes.X_V_MODEL_ON_PROPS]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
[ErrorCodes.X_INVALID_EXPRESSION]: `Error parsing JavaScript expression: `,
[ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN]: ` expects exactly one child component.`,
+ [ErrorCodes.X_VNODE_HOOKS]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
// generic errors
[ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
@@ -183,10 +181,6 @@ export const errorMessages: Record = {
[ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
[ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED]: `"scopeId" option is only supported in module mode.`,
- // deprecations
- [ErrorCodes.DEPRECATION_VNODE_HOOKS]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
- [ErrorCodes.DEPRECATION_V_IS]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
-
// just to fulfill types
- [ErrorCodes.__EXTEND_POINT__]: ``
+ [ErrorCodes.__EXTEND_POINT__]: ``,
}
diff --git a/packages/compiler-core/src/index.ts b/packages/compiler-core/src/index.ts
index 4898a181dfc..ef4e54cf2d7 100644
--- a/packages/compiler-core/src/index.ts
+++ b/packages/compiler-core/src/index.ts
@@ -8,9 +8,9 @@ export {
type CodegenOptions,
type HoistTransform,
type BindingMetadata,
- BindingTypes
+ BindingTypes,
} from './options'
-export { baseParse, TextModes } from './parse'
+export { baseParse } from './parser'
export {
transform,
type TransformContext,
@@ -19,14 +19,15 @@ export {
createStructuralDirectiveTransform,
type NodeTransform,
type StructuralDirectiveTransform,
- type DirectiveTransform
+ type DirectiveTransform,
} from './transform'
export { generate, type CodegenContext, type CodegenResult } from './codegen'
export {
ErrorCodes,
+ errorMessages,
createCompilerError,
type CoreCompilerError,
- type CompilerError
+ type CompilerError,
} from './errors'
export * from './ast'
@@ -44,20 +45,20 @@ export { processFor, createForLoopParams } from './transforms/vFor'
export {
transformExpression,
processExpression,
- stringifyExpression
+ stringifyExpression,
} from './transforms/transformExpression'
export {
buildSlots,
type SlotFnBuilder,
trackVForSlotScopes,
- trackSlotScopes
+ trackSlotScopes,
} from './transforms/vSlot'
export {
transformElement,
resolveComponentType,
buildProps,
buildDirectiveArgs,
- type PropsExpression
+ type PropsExpression,
} from './transforms/transformElement'
export { processSlotOutlet } from './transforms/transformSlotOutlet'
export { getConstantType } from './transforms/hoistStatic'
@@ -67,5 +68,5 @@ export { generateCodeFrame } from '@vue/shared'
export {
checkCompatEnabled,
warnDeprecation,
- CompilerDeprecationTypes
+ CompilerDeprecationTypes,
} from './compat/compatConfig'
diff --git a/packages/compiler-core/src/options.ts b/packages/compiler-core/src/options.ts
index 65bbcb36dd6..8a989a8c659 100644
--- a/packages/compiler-core/src/options.ts
+++ b/packages/compiler-core/src/options.ts
@@ -1,13 +1,18 @@
-import { ElementNode, Namespace, TemplateChildNode, ParentNode } from './ast'
-import { TextModes } from './parse'
-import { CompilerError } from './errors'
-import {
- NodeTransform,
+import type {
+ ElementNode,
+ Namespace,
+ Namespaces,
+ ParentNode,
+ TemplateChildNode,
+} from './ast'
+import type { CompilerError } from './errors'
+import type {
DirectiveTransform,
- TransformContext
+ NodeTransform,
+ TransformContext,
} from './transform'
-import { CompilerCompatOptions } from './compat/compatConfig'
-import { ParserPlugin } from '@babel/parser'
+import type { CompilerCompatOptions } from './compat/compatConfig'
+import type { ParserPlugin } from '@babel/parser'
export interface ErrorHandlingOptions {
onWarn?: (warning: CompilerError) => void
@@ -17,6 +22,24 @@ export interface ErrorHandlingOptions {
export interface ParserOptions
extends ErrorHandlingOptions,
CompilerCompatOptions {
+ /**
+ * Base mode is platform agnostic and only parses HTML-like template syntax,
+ * treating all tags the same way. Specific tag parsing behavior can be
+ * configured by higher-level compilers.
+ *
+ * HTML mode adds additional logic for handling special parsing behavior in
+ * `
+ this.emitCodePoint(cp, consumed),
+ )
+ }
+ }
+
+ public reset(): void {
+ this.state = State.Text
+ this.mode = ParseMode.BASE
+ this.buffer = ''
+ this.sectionStart = 0
+ this.index = 0
+ this.baseState = State.Text
+ this.inRCDATA = false
+ this.currentSequence = undefined!
+ this.newlines.length = 0
+ this.delimiterOpen = defaultDelimitersOpen
+ this.delimiterClose = defaultDelimitersClose
+ }
+
+ /**
+ * Generate Position object with line / column information using recorded
+ * newline positions. We know the index is always going to be an already
+ * processed index, so all the newlines up to this index should have been
+ * recorded.
+ */
+ public getPos(index: number): Position {
+ let line = 1
+ let column = index + 1
+ for (let i = this.newlines.length - 1; i >= 0; i--) {
+ const newlineIndex = this.newlines[i]
+ if (index > newlineIndex) {
+ line = i + 2
+ column = index - newlineIndex
+ break
+ }
+ }
+ return {
+ column,
+ line,
+ offset: index,
+ }
+ }
+
+ private peek() {
+ return this.buffer.charCodeAt(this.index + 1)
+ }
+
+ private stateText(c: number): void {
+ if (c === CharCodes.Lt) {
+ if (this.index > this.sectionStart) {
+ this.cbs.ontext(this.sectionStart, this.index)
+ }
+ this.state = State.BeforeTagName
+ this.sectionStart = this.index
+ } else if (!__BROWSER__ && c === CharCodes.Amp) {
+ this.startEntity()
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
+ this.state = State.InterpolationOpen
+ this.delimiterIndex = 0
+ this.stateInterpolationOpen(c)
+ }
+ }
+
+ public delimiterOpen: Uint8Array = defaultDelimitersOpen
+ public delimiterClose: Uint8Array = defaultDelimitersClose
+ private delimiterIndex = -1
+
+ private stateInterpolationOpen(c: number): void {
+ if (c === this.delimiterOpen[this.delimiterIndex]) {
+ if (this.delimiterIndex === this.delimiterOpen.length - 1) {
+ const start = this.index + 1 - this.delimiterOpen.length
+ if (start > this.sectionStart) {
+ this.cbs.ontext(this.sectionStart, start)
+ }
+ this.state = State.Interpolation
+ this.sectionStart = start
+ } else {
+ this.delimiterIndex++
+ }
+ } else if (this.inRCDATA) {
+ this.state = State.InRCDATA
+ this.stateInRCDATA(c)
+ } else {
+ this.state = State.Text
+ this.stateText(c)
+ }
+ }
+
+ private stateInterpolation(c: number): void {
+ if (c === this.delimiterClose[0]) {
+ this.state = State.InterpolationClose
+ this.delimiterIndex = 0
+ this.stateInterpolationClose(c)
+ }
+ }
+
+ private stateInterpolationClose(c: number) {
+ if (c === this.delimiterClose[this.delimiterIndex]) {
+ if (this.delimiterIndex === this.delimiterClose.length - 1) {
+ this.cbs.oninterpolation(this.sectionStart, this.index + 1)
+ if (this.inRCDATA) {
+ this.state = State.InRCDATA
+ } else {
+ this.state = State.Text
+ }
+ this.sectionStart = this.index + 1
+ } else {
+ this.delimiterIndex++
+ }
+ } else {
+ this.state = State.Interpolation
+ this.stateInterpolation(c)
+ }
+ }
+
+ public currentSequence: Uint8Array = undefined!
+ private sequenceIndex = 0
+ private stateSpecialStartSequence(c: number): void {
+ const isEnd = this.sequenceIndex === this.currentSequence.length
+ const isMatch = isEnd
+ ? // If we are at the end of the sequence, make sure the tag name has ended
+ isEndOfTagSection(c)
+ : // Otherwise, do a case-insensitive comparison
+ (c | 0x20) === this.currentSequence[this.sequenceIndex]
+
+ if (!isMatch) {
+ this.inRCDATA = false
+ } else if (!isEnd) {
+ this.sequenceIndex++
+ return
+ }
+
+ this.sequenceIndex = 0
+ this.state = State.InTagName
+ this.stateInTagName(c)
+ }
+
+ /** Look for an end tag. For and
- `).code
+ `).code,
).toMatchSnapshot()
})
diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap
index 0e842e96e68..aa08c1366a6 100644
--- a/packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap
+++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap
@@ -7,9 +7,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vShow: _vShow, createElementVNode: _createElementVNode, withDirectives: _withDirectives, Transition: _Transition, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = _Vue
- return (_openBlock(), _createBlock(_Transition, { persisted: \\"\\" }, {
+ return (_openBlock(), _createBlock(_Transition, { persisted: "" }, {
default: _withCtx(() => [
- _withDirectives(_createElementVNode(\\"div\\", null, null, 512 /* NEED_PATCH */), [
+ _withDirectives(_createElementVNode("div", null, null, 512 /* NEED_PATCH */), [
[_vShow, ok]
])
]),
@@ -29,15 +29,15 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_Transition, null, {
default: _withCtx(() => [
a
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"hey\\"))
+ ? (_openBlock(), _createElementBlock("div", { key: 0 }, "hey"))
: b
- ? (_openBlock(), _createElementBlock(\\"div\\", { key: 1 }, \\"hey\\"))
- : (_openBlock(), _createElementBlock(\\"div\\", { key: 2 }, [
+ ? (_openBlock(), _createElementBlock("div", { key: 1 }, "hey"))
+ : (_openBlock(), _createElementBlock("div", { key: 2 }, [
c
- ? (_openBlock(), _createElementBlock(\\"p\\", { key: 0 }))
+ ? (_openBlock(), _createElementBlock("p", { key: 0 }))
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
- _createCommentVNode(\\" this should not be ignored \\"),
- _createElementVNode(\\"p\\")
+ _createCommentVNode(" this should not be ignored "),
+ _createElementVNode("p")
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
]))
]),
diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap
index b671d3252e5..33fb37a58f9 100644
--- a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap
+++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap
@@ -3,40 +3,40 @@
exports[`stringify static html > should bail on bindings that are hoisted but not stringifiable 1`] = `
"const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
-const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, [
- /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
- /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
- /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
- /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
- /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
- /*#__PURE__*/_createElementVNode(\\"img\\", { src: _imports_0_ })
+const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", null, [
+ /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
+ /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
+ /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
+ /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
+ /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
+ /*#__PURE__*/_createElementVNode("img", { src: _imports_0_ })
], -1 /* HOISTED */)
const _hoisted_2 = [
_hoisted_1
]
return function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}"
`;
exports[`stringify static html > should work with bindings that are non-static but stringifiable 1`] = `
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"
foo foo foo foo foo \\", 1)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode("
foo foo foo foo foo ", 1)
const _hoisted_2 = [
_hoisted_1
]
return function render(_ctx, _cache) {
- return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
+ return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
}"
`;
exports[`stringify static html > stringify v-html 1`] = `
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"
show-it
1 2
\\", 2)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode("
show-it
1 2
", 2)
return function render(_ctx, _cache) {
return _hoisted_1
@@ -46,7 +46,7 @@ return function render(_ctx, _cache) {
exports[`stringify static html > stringify v-text 1`] = `
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"
<span>show-it </span>
1 2
\\", 2)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode("
<span>show-it </span>
1 2
", 2)
return function render(_ctx, _cache) {
return _hoisted_1
@@ -56,7 +56,7 @@ return function render(_ctx, _cache) {
exports[`stringify static html > stringify v-text with escape 1`] = `
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"
text1
1 2
\\", 2)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode("
text1
1 2
", 2)
return function render(_ctx, _cache) {
return _hoisted_1
diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/vModel.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
index d2c9aaa785f..5b610745e41 100644
--- a/packages/compiler-dom/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
+++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
@@ -7,9 +7,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"my-input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("my-input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelText, model]
])
}
@@ -23,9 +23,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelDynamic: _vModelDynamic, mergeProps: _mergeProps, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", _mergeProps(obj, {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }), null, 16 /* FULL_PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", _mergeProps(obj, {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }), null, 16 /* FULL_PROPS */, ["onUpdate:modelValue"])), [
[_vModelDynamic, model]
])
}
@@ -39,9 +39,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelDynamic: _vModelDynamic, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelDynamic, model]
])
}
@@ -55,9 +55,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[
_vModelText,
model,
@@ -76,9 +76,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[
_vModelText,
model,
@@ -97,9 +97,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[
_vModelText,
model,
@@ -118,9 +118,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelText, model]
])
}
@@ -134,10 +134,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelCheckbox: _vModelCheckbox, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- type: \\"checkbox\\",
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ type: "checkbox",
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelCheckbox, model]
])
}
@@ -151,9 +151,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelDynamic: _vModelDynamic, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelDynamic, model]
])
}
@@ -167,10 +167,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelRadio: _vModelRadio, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- type: \\"radio\\",
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ type: "radio",
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelRadio, model]
])
}
@@ -184,10 +184,10 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
- type: \\"text\\",
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("input", {
+ type: "text",
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelText, model]
])
}
@@ -201,9 +201,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelSelect: _vModelSelect, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"select\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("select", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelSelect, model]
])
}
@@ -217,9 +217,9 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"textarea\\", {
- \\"onUpdate:modelValue\\": $event => ((model) = $event)
- }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
+ return _withDirectives((_openBlock(), _createElementBlock("textarea", {
+ "onUpdate:modelValue": $event => ((model) = $event)
+ }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
[_vModelText, model]
])
}
diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/vShow.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/vShow.spec.ts.snap
index bd9926e5ba7..b0ed8d8d6bd 100644
--- a/packages/compiler-dom/__tests__/transforms/__snapshots__/vShow.spec.ts.snap
+++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/vShow.spec.ts.snap
@@ -7,7 +7,7 @@ return function render(_ctx, _cache) {
with (_ctx) {
const { vShow: _vShow, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
- return _withDirectives((_openBlock(), _createElementBlock(\\"div\\", null, null, 512 /* NEED_PATCH */)), [
+ return _withDirectives((_openBlock(), _createElementBlock("div", null, null, 512 /* NEED_PATCH */)), [
[_vShow, a]
])
}
diff --git a/packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts b/packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts
index 4df6ee297f3..f06b9fd52dd 100644
--- a/packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/ignoreSideEffectTags.spec.ts
@@ -1,4 +1,4 @@
-import { compile, CompilerError } from '../../src'
+import { type CompilerError, compile } from '../../src'
describe('compiler: ignore side effect tags', () => {
it('should ignore script', () => {
@@ -6,7 +6,7 @@ describe('compiler: ignore side effect tags', () => {
const { code } = compile(``, {
onError(e) {
err = e
- }
+ },
})
expect(code).not.toMatch('script')
expect(err).toBeDefined()
@@ -18,7 +18,7 @@ describe('compiler: ignore side effect tags', () => {
const { code } = compile(``, {
onError(e) {
err = e
- }
+ },
})
expect(code).not.toMatch('style')
expect(err).toBeDefined()
diff --git a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
index 85efeafb8c9..b0eb515c254 100644
--- a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
@@ -1,13 +1,13 @@
import {
- compile,
- NodeTypes,
CREATE_STATIC,
+ ConstantTypes,
+ NodeTypes,
+ compile,
createSimpleExpression,
- ConstantTypes
} from '../../src'
import {
+ StringifyThresholds,
stringifyStatic,
- StringifyThresholds
} from '../../src/transforms/stringifyStatic'
describe('stringify static html', () => {
@@ -15,20 +15,17 @@ describe('stringify static html', () => {
return compile(template, {
hoistStatic: true,
prefixIdentifiers: true,
- transformHoist: stringifyStatic
+ transformHoist: stringifyStatic,
})
}
function repeat(code: string, n: number): string {
- return new Array(n)
- .fill(0)
- .map(() => code)
- .join('')
+ return code.repeat(n)
}
test('should bail on non-eligible static trees', () => {
const { ast } = compileWithStringify(
- `
`
+ `
`,
)
// should be a normal vnode call
expect(ast.hoists[0]!.type).toBe(NodeTypes.VNODE_CALL)
@@ -38,8 +35,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`
${repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}
`,
)
// should be optimized now
expect(ast.hoists).toMatchObject([
@@ -50,15 +47,15 @@ describe('stringify static html', () => {
JSON.stringify(
`${repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
),
- '1'
- ]
+ '1',
+ ],
}, // the children array is hoisted as well
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -66,8 +63,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
` `,
- StringifyThresholds.NODE_COUNT
- )}
`
+ StringifyThresholds.NODE_COUNT,
+ )}`,
)
// should be optimized now
expect(ast.hoists).toMatchObject([
@@ -78,16 +75,16 @@ describe('stringify static html', () => {
JSON.stringify(
`${repeat(
` `,
- StringifyThresholds.NODE_COUNT
- )}
`
+ StringifyThresholds.NODE_COUNT,
+ )}`,
),
- '1'
- ]
+ '1',
+ ],
},
// the children array is hoisted as well
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -95,8 +92,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
// should have 6 hoisted nodes (including the entire array),
// but 2~5 should be null because they are merged into 1
@@ -108,19 +105,19 @@ describe('stringify static html', () => {
JSON.stringify(
repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ ),
),
- '5'
- ]
+ '5',
+ ],
},
null,
null,
null,
null,
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -128,8 +125,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
`{{ 1 }} + {{ false }} `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
// should be optimized now
expect(ast.hoists).toMatchObject([
@@ -140,15 +137,15 @@ describe('stringify static html', () => {
JSON.stringify(
`${repeat(
`1 + false `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
),
- '1'
- ]
+ '1',
+ ],
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -157,8 +154,8 @@ describe('stringify static html', () => {
`${repeat(
`{{ 1 }} + {{ '<' }} ` +
`& `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
// should be optimized now
expect(ast.hoists).toMatchObject([
@@ -169,15 +166,15 @@ describe('stringify static html', () => {
JSON.stringify(
`${repeat(
`1 + < ` + `& `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
),
- '1'
- ]
+ '1',
+ ],
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -185,7 +182,7 @@ describe('stringify static html', () => {
const { ast, code } = compile(
`${repeat(
`
foo `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
)}
`,
{
hoistStatic: true,
@@ -198,7 +195,7 @@ describe('stringify static html', () => {
'_imports_0_',
false,
node.loc,
- ConstantTypes.CAN_HOIST
+ ConstantTypes.CAN_HOIST,
)
node.props[0] = {
type: NodeTypes.DIRECTIVE,
@@ -206,23 +203,23 @@ describe('stringify static html', () => {
arg: createSimpleExpression('src', true),
exp,
modifiers: [],
- loc: node.loc
+ loc: node.loc,
}
}
- }
- ]
- }
+ },
+ ],
+ },
)
expect(ast.hoists).toMatchObject([
{
// the expression and the tree are still hoistable
// but should stay NodeTypes.VNODE_CALL
// if it's stringified it will be NodeTypes.JS_CALL_EXPRESSION
- type: NodeTypes.VNODE_CALL
+ type: NodeTypes.VNODE_CALL,
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
expect(code).toMatchSnapshot()
})
@@ -233,7 +230,7 @@ describe('stringify static html', () => {
const { ast, code } = compile(
`${repeat(
`
foo `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
)}
`,
{
hoistStatic: true,
@@ -246,7 +243,7 @@ describe('stringify static html', () => {
'_imports_0_',
false,
node.loc,
- ConstantTypes.CAN_STRINGIFY
+ ConstantTypes.CAN_STRINGIFY,
)
node.props[0] = {
type: NodeTypes.DIRECTIVE,
@@ -254,22 +251,22 @@ describe('stringify static html', () => {
arg: createSimpleExpression('src', true),
exp,
modifiers: [],
- loc: node.loc
+ loc: node.loc,
}
}
- }
- ]
- }
+ },
+ ],
+ },
)
expect(ast.hoists).toMatchObject([
{
// the hoisted node should be NodeTypes.JS_CALL_EXPRESSION
// of `createStaticVNode()` instead of dynamic NodeTypes.VNODE_CALL
- type: NodeTypes.JS_CALL_EXPRESSION
+ type: NodeTypes.JS_CALL_EXPRESSION,
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
expect(code).toMatchSnapshot()
})
@@ -279,31 +276,31 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
``
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
expect(ast.hoists).toMatchObject([
{
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
const { ast: ast2 } = compileWithStringify(
``
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
expect(ast2.hoists).toMatchObject([
{
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -311,31 +308,31 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
``
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )} `,
)
expect(ast.hoists).toMatchObject([
{
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
const { ast: ast2 } = compileWithStringify(
``
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )} `,
)
expect(ast2.hoists).toMatchObject([
{
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -343,16 +340,16 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
`foo `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
expect(ast.hoists).toMatchObject([
{
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
},
{
- type: NodeTypes.JS_ARRAY_EXPRESSION
- }
+ type: NodeTypes.JS_ARRAY_EXPRESSION,
+ },
])
})
@@ -360,30 +357,30 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
`
`,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )} `
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )} `,
)
expect(ast.hoists.length).toBe(
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
)
ast.hoists.forEach(node => {
expect(node).toMatchObject({
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
})
})
const { ast: ast2 } = compileWithStringify(
`${repeat(
`
`,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )} `
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )} `,
)
expect(ast2.hoists.length).toBe(
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
)
ast2.hoists.forEach(node => {
expect(node).toMatchObject({
- type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
+ type: NodeTypes.VNODE_CALL, // not CALL_EXPRESSION
})
})
})
@@ -392,8 +389,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
expect(ast.hoists[0]).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -402,11 +399,11 @@ describe('stringify static html', () => {
JSON.stringify(
`${repeat(
` `,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
),
- '5'
- ]
+ '5',
+ ],
})
})
@@ -415,8 +412,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`enable ${repeat(
`
`,
- StringifyThresholds.NODE_COUNT
- )}`
+ StringifyThresholds.NODE_COUNT,
+ )}`,
)
expect(ast.hoists[0]).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -425,11 +422,11 @@ describe('stringify static html', () => {
JSON.stringify(
`enable ${repeat(
`
`,
- StringifyThresholds.NODE_COUNT
- )}`
+ StringifyThresholds.NODE_COUNT,
+ )}`,
),
- '21'
- ]
+ '21',
+ ],
})
})
@@ -439,8 +436,8 @@ describe('stringify static html', () => {
const { ast } = compileWithStringify(
`${svg}${repeat(
repeated,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}
`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
)
expect(ast.hoists[0]).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
@@ -449,11 +446,11 @@ describe('stringify static html', () => {
JSON.stringify(
`${svg}${repeat(
repeated,
- StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
- )}`
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}`,
),
- '1'
- ]
+ '1',
+ ],
})
})
diff --git a/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts b/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts
index 6eee9f8ba38..51c40c45d98 100644
--- a/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts
@@ -1,10 +1,10 @@
import {
+ type CompilerOptions,
+ type ElementNode,
+ NodeTypes,
+ type VNodeCall,
baseParse as parse,
transform,
- CompilerOptions,
- ElementNode,
- NodeTypes,
- VNodeCall
} from '@vue/compiler-core'
import { transformBind } from '../../../compiler-core/src/transforms/vBind'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
@@ -12,16 +12,16 @@ import { transformStyle } from '../../src/transforms/transformStyle'
function transformWithStyleTransform(
template: string,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
) {
const ast = parse(template)
transform(ast, {
nodeTransforms: [transformStyle],
- ...options
+ ...options,
})
return {
root: ast,
- node: ast.children[0] as ElementNode
+ node: ast.children[0] as ElementNode,
}
}
@@ -34,13 +34,13 @@ describe('compiler: style transform', () => {
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `style`,
- isStatic: true
+ isStatic: true,
},
exp: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `{"color":"red"}`,
- isStatic: false
- }
+ isStatic: false,
+ },
})
})
@@ -48,8 +48,8 @@ describe('compiler: style transform', () => {
const { node } = transformWithStyleTransform(`
`, {
nodeTransforms: [transformStyle, transformElement],
directiveTransforms: {
- bind: transformBind
- }
+ bind: transformBind,
+ },
})
expect((node.codegenNode as VNodeCall).props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
@@ -58,15 +58,15 @@ describe('compiler: style transform', () => {
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `style`,
- isStatic: true
+ isStatic: true,
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `{"color":"red"}`,
- isStatic: false
- }
- }
- ]
+ isStatic: false,
+ },
+ },
+ ],
})
// should not cause the STYLE patchFlag to be attached
expect((node.codegenNode as VNodeCall).patchFlag).toBeUndefined()
diff --git a/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts b/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts
index 29478676857..a59a7a40aaf 100644
--- a/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts
@@ -1,15 +1,14 @@
-import { vi } from 'vitest'
import {
+ type CompilerOptions,
+ type PlainElementNode,
baseParse as parse,
transform,
- PlainElementNode,
- CompilerOptions
} from '@vue/compiler-core'
import { transformVHtml } from '../../src/transforms/vHtml'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import {
createObjectMatcher,
- genFlagText
+ genFlagText,
} from '../../../compiler-core/__tests__/testUtils'
import { PatchFlags } from '@vue/shared'
import { DOMErrorCodes } from '../../src/errors'
@@ -19,9 +18,9 @@ function transformWithVHtml(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformElement],
directiveTransforms: {
- html: transformVHtml
+ html: transformVHtml,
},
- ...options
+ ...options,
})
return ast
}
@@ -32,40 +31,40 @@ describe('compiler: v-html transform', () => {
expect((ast.children[0] as PlainElementNode).codegenNode).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
- innerHTML: `[test]`
+ innerHTML: `[test]`,
}),
children: undefined,
patchFlag: genFlagText(PatchFlags.PROPS),
- dynamicProps: `["innerHTML"]`
+ dynamicProps: `["innerHTML"]`,
})
})
it('should raise error and ignore children when v-html is present', () => {
const onError = vi.fn()
const ast = transformWithVHtml(`hello
`, {
- onError
+ onError,
})
expect(onError.mock.calls).toMatchObject([
- [{ code: DOMErrorCodes.X_V_HTML_WITH_CHILDREN }]
+ [{ code: DOMErrorCodes.X_V_HTML_WITH_CHILDREN }],
])
expect((ast.children[0] as PlainElementNode).codegenNode).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
- innerHTML: `[test]`
+ innerHTML: `[test]`,
}),
children: undefined, // <-- children should have been removed
patchFlag: genFlagText(PatchFlags.PROPS),
- dynamicProps: `["innerHTML"]`
+ dynamicProps: `["innerHTML"]`,
})
})
it('should raise error if has no expression', () => {
const onError = vi.fn()
transformWithVHtml(`
`, {
- onError
+ onError,
})
expect(onError.mock.calls).toMatchObject([
- [{ code: DOMErrorCodes.X_V_HTML_NO_EXPRESSION }]
+ [{ code: DOMErrorCodes.X_V_HTML_NO_EXPRESSION }],
])
})
})
diff --git a/packages/compiler-dom/__tests__/transforms/vModel.spec.ts b/packages/compiler-dom/__tests__/transforms/vModel.spec.ts
index 75750a8ceb5..02d188f01b9 100644
--- a/packages/compiler-dom/__tests__/transforms/vModel.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/vModel.spec.ts
@@ -1,9 +1,8 @@
-import { vi } from 'vitest'
import {
+ type CompilerOptions,
+ generate,
baseParse as parse,
transform,
- CompilerOptions,
- generate
} from '@vue/compiler-core'
import { transformModel } from '../../src/transforms/vModel'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
@@ -13,7 +12,7 @@ import {
V_MODEL_DYNAMIC,
V_MODEL_RADIO,
V_MODEL_SELECT,
- V_MODEL_TEXT
+ V_MODEL_TEXT,
} from '../../src/runtimeHelpers'
function transformWithModel(template: string, options: CompilerOptions = {}) {
@@ -21,9 +20,9 @@ function transformWithModel(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformElement],
directiveTransforms: {
- model: transformModel
+ model: transformModel,
},
- ...options
+ ...options,
})
return ast
}
@@ -71,7 +70,7 @@ describe('compiler: transform v-model', () => {
expect(generate(root).code).toMatchSnapshot()
const root2 = transformWithModel(
- ' '
+ ' ',
)
expect(root2.helpers).toContain(V_MODEL_DYNAMIC)
expect(generate(root2).code).toMatchSnapshot()
@@ -99,8 +98,8 @@ describe('compiler: transform v-model', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT
- })
+ code: DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT,
+ }),
)
})
@@ -111,8 +110,8 @@ describe('compiler: transform v-model', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT
- })
+ code: DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT,
+ }),
)
})
@@ -120,7 +119,7 @@ describe('compiler: transform v-model', () => {
const onError = vi.fn()
const root = transformWithModel(' ', {
onError,
- isCustomElement: tag => tag.startsWith('my-')
+ isCustomElement: tag => tag.startsWith('my-'),
})
expect(root.helpers).toContain(V_MODEL_TEXT)
expect(onError).not.toHaveBeenCalled()
@@ -130,14 +129,35 @@ describe('compiler: transform v-model', () => {
test('should raise error if used file input element', () => {
const onError = vi.fn()
transformWithModel(` `, {
- onError
+ onError,
})
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT
- })
+ code: DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT,
+ }),
)
})
+
+ test('should error on dynamic value binding alongside v-model', () => {
+ const onError = vi.fn()
+ transformWithModel(` `, {
+ onError,
+ })
+ expect(onError).toHaveBeenCalledWith(
+ expect.objectContaining({
+ code: DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE,
+ }),
+ )
+ })
+
+ // #3596
+ test('should NOT error on static value binding alongside v-model', () => {
+ const onError = vi.fn()
+ transformWithModel(` `, {
+ onError,
+ })
+ expect(onError).not.toHaveBeenCalled()
+ })
})
describe('modifiers', () => {
diff --git a/packages/compiler-dom/__tests__/transforms/vOn.spec.ts b/packages/compiler-dom/__tests__/transforms/vOn.spec.ts
index efc7fee374f..2e80729119d 100644
--- a/packages/compiler-dom/__tests__/transforms/vOn.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/vOn.spec.ts
@@ -1,13 +1,14 @@
import {
- baseParse as parse,
- CompilerOptions,
- ElementNode,
+ BindingTypes,
+ type CompilerOptions,
+ type ElementNode,
+ NodeTypes,
+ type ObjectExpression,
TO_HANDLER_KEY,
+ type VNodeCall,
helperNameMap,
- NodeTypes,
- ObjectExpression,
+ baseParse as parse,
transform,
- VNodeCall
} from '@vue/compiler-core'
import { transformOn } from '../../src/transforms/vOn'
import { V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS } from '../../src/runtimeHelpers'
@@ -21,32 +22,31 @@ function parseWithVOn(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformExpression, transformElement],
directiveTransforms: {
- on: transformOn
+ on: transformOn,
},
- ...options
+ ...options,
})
+ const node = (ast.children[0] as ElementNode).codegenNode as VNodeCall
return {
root: ast,
- props: (
- ((ast.children[0] as ElementNode).codegenNode as VNodeCall)
- .props as ObjectExpression
- ).properties
+ node,
+ props: (node.props as ObjectExpression).properties,
}
}
describe('compiler-dom: transform v-on', () => {
it('should support multiple modifiers w/ prefixIdentifiers: true', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: '_ctx.test' }, '["stop","prevent"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["stop","prevent"]'],
+ },
})
})
@@ -54,8 +54,8 @@ describe('compiler-dom: transform v-on', () => {
const { props } = parseWithVOn(
`
`,
{
- prefixIdentifiers: true
- }
+ prefixIdentifiers: true,
+ },
)
const [clickProp, keyUpProp] = props
@@ -64,95 +64,95 @@ describe('compiler-dom: transform v-on', () => {
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: '_ctx.test' }, '["stop"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["stop"]'],
+ },
})
expect(keyUpProp).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_KEYS,
- arguments: [{ content: '_ctx.test' }, '["enter"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["enter"]'],
+ },
})
})
it('should support multiple modifiers and event options w/ prefixIdentifiers: true', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
key: {
- content: `onClickCaptureOnce`
+ content: `onClickCaptureOnce`,
},
value: {
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: '_ctx.test' }, '["stop"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["stop"]'],
+ },
})
})
it('should wrap keys guard for keyboard events or dynamic events', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
key: {
- content: `onKeydownCapture`
+ content: `onKeydownCapture`,
},
value: {
callee: V_ON_WITH_KEYS,
arguments: [
{
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: '_ctx.test' }, '["stop","ctrl"]']
+ arguments: [{ content: '_ctx.test' }, '["stop","ctrl"]'],
},
- '["a"]'
- ]
- }
+ '["a"]',
+ ],
+ },
})
})
it('should not wrap keys guard if no key modifier is present', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: '_ctx.test' }, '["exact"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["exact"]'],
+ },
})
})
it('should wrap keys guard for static key event w/ left/right modifiers', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_KEYS,
- arguments: [{ content: '_ctx.test' }, '["left"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["left"]'],
+ },
})
})
it('should wrap both for dynamic key event w/ left/right modifiers', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
@@ -161,41 +161,41 @@ describe('compiler-dom: transform v-on', () => {
arguments: [
{
callee: V_ON_WITH_MODIFIERS,
- arguments: [{ content: `_ctx.test` }, `["left"]`]
+ arguments: [{ content: `_ctx.test` }, `["left"]`],
},
- '["left"]'
- ]
- }
+ '["left"]',
+ ],
+ },
})
})
it('should not wrap normal guard if there is only keys guard', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
- prefixIdentifiers: true
+ prefixIdentifiers: true,
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: {
callee: V_ON_WITH_KEYS,
- arguments: [{ content: '_ctx.test' }, '["enter"]']
- }
+ arguments: [{ content: '_ctx.test' }, '["enter"]'],
+ },
})
})
test('should transform click.right', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`)
expect(prop.key).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `onContextmenu`
+ content: `onContextmenu`,
})
// dynamic
const {
- props: [prop2]
+ props: [prop2],
} = parseWithVOn(`
`)
// (_toHandlerKey(event)).toLowerCase() === "onclick" ? "onContextmenu" : (_toHandlerKey(event))
expect(prop2.key).toMatchObject({
@@ -206,34 +206,34 @@ describe('compiler-dom: transform v-on', () => {
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: 'event' },
- `)`
- ]
+ `)`,
+ ],
},
`) === "onClick" ? "onContextmenu" : (`,
{
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: 'event' },
- `)`
- ]
+ `)`,
+ ],
},
- `)`
- ]
+ `)`,
+ ],
})
})
test('should transform click.middle', () => {
const {
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`)
expect(prop.key).toMatchObject({
type: NodeTypes.SIMPLE_EXPRESSION,
- content: `onMouseup`
+ content: `onMouseup`,
})
// dynamic
const {
- props: [prop2]
+ props: [prop2],
} = parseWithVOn(`
`)
// (_eventNaming(event)).toLowerCase() === "onclick" ? "onMouseup" : (_eventNaming(event))
expect(prop2.key).toMatchObject({
@@ -244,48 +244,62 @@ describe('compiler-dom: transform v-on', () => {
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: 'event' },
- `)`
- ]
+ `)`,
+ ],
},
`) === "onClick" ? "onMouseup" : (`,
{
children: [
`_${helperNameMap[TO_HANDLER_KEY]}(`,
{ content: 'event' },
- `)`
- ]
+ `)`,
+ ],
},
- `)`
- ]
+ `)`,
+ ],
})
})
test('cache handler w/ modifiers', () => {
const {
root,
- props: [prop]
+ props: [prop],
} = parseWithVOn(`
`, {
prefixIdentifiers: true,
- cacheHandlers: true
+ cacheHandlers: true,
})
expect(root.cached).toBe(1)
// should not treat cached handler as dynamicProp, so it should have no
// dynamicProps flags and only the hydration flag
expect((root as any).children[0].codegenNode.patchFlag).toBe(
- genFlagText(PatchFlags.HYDRATE_EVENTS)
+ genFlagText(PatchFlags.NEED_HYDRATION),
)
expect(prop).toMatchObject({
key: {
- content: `onKeyupCapture`
+ content: `onKeyupCapture`,
},
value: {
type: NodeTypes.JS_CACHE_EXPRESSION,
index: 0,
value: {
type: NodeTypes.JS_CALL_EXPRESSION,
- callee: V_ON_WITH_KEYS
- }
- }
+ callee: V_ON_WITH_KEYS,
+ },
+ },
+ })
+ })
+
+ test('should not have PROPS patchFlag for constant v-on handlers with modifiers', () => {
+ const { node } = parseWithVOn(`
`, {
+ prefixIdentifiers: true,
+ bindingMetadata: {
+ foo: BindingTypes.SETUP_CONST,
+ },
+ directiveTransforms: {
+ on: transformOn,
+ },
})
+ // should only have hydration flag
+ expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_HYDRATION))
})
})
diff --git a/packages/compiler-dom/__tests__/transforms/vShow.spec.ts b/packages/compiler-dom/__tests__/transforms/vShow.spec.ts
index 9fb53974deb..11aa62464d3 100644
--- a/packages/compiler-dom/__tests__/transforms/vShow.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/vShow.spec.ts
@@ -1,9 +1,8 @@
-import { vi } from 'vitest'
import {
+ type CompilerOptions,
+ generate,
baseParse as parse,
transform,
- generate,
- CompilerOptions
} from '@vue/compiler-core'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import { transformShow } from '../../src/transforms/vShow'
@@ -14,9 +13,9 @@ function transformWithShow(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformElement],
directiveTransforms: {
- show: transformShow
+ show: transformShow,
},
- ...options
+ ...options,
})
return ast
}
@@ -35,8 +34,8 @@ describe('compiler: v-show transform', () => {
expect(onError).toHaveBeenCalledTimes(1)
expect(onError).toHaveBeenCalledWith(
expect.objectContaining({
- code: DOMErrorCodes.X_V_SHOW_NO_EXPRESSION
- })
+ code: DOMErrorCodes.X_V_SHOW_NO_EXPRESSION,
+ }),
)
})
})
diff --git a/packages/compiler-dom/__tests__/transforms/vText.spec.ts b/packages/compiler-dom/__tests__/transforms/vText.spec.ts
index 5c500b31f1c..1b717e83398 100644
--- a/packages/compiler-dom/__tests__/transforms/vText.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/vText.spec.ts
@@ -1,15 +1,14 @@
-import { vi } from 'vitest'
import {
+ type CompilerOptions,
+ type PlainElementNode,
baseParse as parse,
transform,
- PlainElementNode,
- CompilerOptions
} from '@vue/compiler-core'
import { transformVText } from '../../src/transforms/vText'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
import {
createObjectMatcher,
- genFlagText
+ genFlagText,
} from '../../../compiler-core/__tests__/testUtils'
import { PatchFlags } from '@vue/shared'
import { DOMErrorCodes } from '../../src/errors'
@@ -19,9 +18,9 @@ function transformWithVText(template: string, options: CompilerOptions = {}) {
transform(ast, {
nodeTransforms: [transformElement],
directiveTransforms: {
- text: transformVText
+ text: transformVText,
},
- ...options
+ ...options,
})
return ast
}
@@ -33,43 +32,43 @@ describe('compiler: v-text transform', () => {
tag: `"div"`,
props: createObjectMatcher({
textContent: {
- arguments: [{ content: 'test' }]
- }
+ arguments: [{ content: 'test' }],
+ },
}),
children: undefined,
patchFlag: genFlagText(PatchFlags.PROPS),
- dynamicProps: `["textContent"]`
+ dynamicProps: `["textContent"]`,
})
})
it('should raise error and ignore children when v-text is present', () => {
const onError = vi.fn()
const ast = transformWithVText(`hello
`, {
- onError
+ onError,
})
expect(onError.mock.calls).toMatchObject([
- [{ code: DOMErrorCodes.X_V_TEXT_WITH_CHILDREN }]
+ [{ code: DOMErrorCodes.X_V_TEXT_WITH_CHILDREN }],
])
expect((ast.children[0] as PlainElementNode).codegenNode).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
textContent: {
- arguments: [{ content: 'test' }]
- }
+ arguments: [{ content: 'test' }],
+ },
}),
children: undefined, // <-- children should have been removed
patchFlag: genFlagText(PatchFlags.PROPS),
- dynamicProps: `["textContent"]`
+ dynamicProps: `["textContent"]`,
})
})
it('should raise error if has no expression', () => {
const onError = vi.fn()
transformWithVText(`
`, {
- onError
+ onError,
})
expect(onError.mock.calls).toMatchObject([
- [{ code: DOMErrorCodes.X_V_TEXT_NO_EXPRESSION }]
+ [{ code: DOMErrorCodes.X_V_TEXT_NO_EXPRESSION }],
])
})
})
diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json
index d21043af9e6..ddc88b5acf1 100644
--- a/packages/compiler-dom/package.json
+++ b/packages/compiler-dom/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-dom",
- "version": "3.3.4",
+ "version": "3.4.15",
"description": "@vue/compiler-dom",
"main": "index.js",
"module": "dist/compiler-dom.esm-bundler.js",
@@ -11,6 +11,20 @@
"index.js",
"dist"
],
+ "exports": {
+ ".": {
+ "types": "./dist/compiler-dom.d.ts",
+ "node": {
+ "production": "./dist/compiler-dom.cjs.prod.js",
+ "development": "./dist/compiler-dom.cjs.js",
+ "default": "./index.js"
+ },
+ "module": "./dist/compiler-dom.esm-bundler.js",
+ "import": "./dist/compiler-dom.esm-bundler.js",
+ "require": "./index.js"
+ },
+ "./*": "./*"
+ },
"sideEffects": false,
"buildOptions": {
"name": "VueCompilerDOM",
@@ -37,7 +51,7 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
"dependencies": {
- "@vue/shared": "3.3.4",
- "@vue/compiler-core": "3.3.4"
+ "@vue/shared": "workspace:*",
+ "@vue/compiler-core": "workspace:*"
}
}
diff --git a/packages/compiler-dom/src/decodeHtml.ts b/packages/compiler-dom/src/decodeHtml.ts
deleted file mode 100644
index 68b0277a434..00000000000
--- a/packages/compiler-dom/src/decodeHtml.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import { ParserOptions } from '@vue/compiler-core'
-import namedCharacterReferences from './namedChars.json'
-
-// lazy compute this to make this file tree-shakable for browser
-let maxCRNameLength: number
-
-export const decodeHtml: ParserOptions['decodeEntities'] = (
- rawText,
- asAttr
-) => {
- let offset = 0
- const end = rawText.length
- let decodedText = ''
-
- function advance(length: number) {
- offset += length
- rawText = rawText.slice(length)
- }
-
- while (offset < end) {
- const head = /&(?:#x?)?/i.exec(rawText)
- if (!head || offset + head.index >= end) {
- const remaining = end - offset
- decodedText += rawText.slice(0, remaining)
- advance(remaining)
- break
- }
-
- // Advance to the "&".
- decodedText += rawText.slice(0, head.index)
- advance(head.index)
-
- if (head[0] === '&') {
- // Named character reference.
- let name = ''
- let value: string | undefined = undefined
- if (/[0-9a-z]/i.test(rawText[1])) {
- if (!maxCRNameLength) {
- maxCRNameLength = Object.keys(namedCharacterReferences).reduce(
- (max, name) => Math.max(max, name.length),
- 0
- )
- }
- for (let length = maxCRNameLength; !value && length > 0; --length) {
- name = rawText.slice(1, 1 + length)
- value = (namedCharacterReferences as Record)[name]
- }
- if (value) {
- const semi = name.endsWith(';')
- if (
- asAttr &&
- !semi &&
- /[=a-z0-9]/i.test(rawText[name.length + 1] || '')
- ) {
- decodedText += '&' + name
- advance(1 + name.length)
- } else {
- decodedText += value
- advance(1 + name.length)
- }
- } else {
- decodedText += '&' + name
- advance(1 + name.length)
- }
- } else {
- decodedText += '&'
- advance(1)
- }
- } else {
- // Numeric character reference.
- const hex = head[0] === ''
- const pattern = hex ? /^([0-9a-f]+);?/i : /^([0-9]+);?/
- const body = pattern.exec(rawText)
- if (!body) {
- decodedText += head[0]
- advance(head[0].length)
- } else {
- // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
- let cp = Number.parseInt(body[1], hex ? 16 : 10)
- if (cp === 0) {
- cp = 0xfffd
- } else if (cp > 0x10ffff) {
- cp = 0xfffd
- } else if (cp >= 0xd800 && cp <= 0xdfff) {
- cp = 0xfffd
- } else if ((cp >= 0xfdd0 && cp <= 0xfdef) || (cp & 0xfffe) === 0xfffe) {
- // noop
- } else if (
- (cp >= 0x01 && cp <= 0x08) ||
- cp === 0x0b ||
- (cp >= 0x0d && cp <= 0x1f) ||
- (cp >= 0x7f && cp <= 0x9f)
- ) {
- cp = CCR_REPLACEMENTS[cp] || cp
- }
- decodedText += String.fromCodePoint(cp)
- advance(body[0].length)
- }
- }
- }
- return decodedText
-}
-
-// https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
-const CCR_REPLACEMENTS: Record = {
- 0x80: 0x20ac,
- 0x82: 0x201a,
- 0x83: 0x0192,
- 0x84: 0x201e,
- 0x85: 0x2026,
- 0x86: 0x2020,
- 0x87: 0x2021,
- 0x88: 0x02c6,
- 0x89: 0x2030,
- 0x8a: 0x0160,
- 0x8b: 0x2039,
- 0x8c: 0x0152,
- 0x8e: 0x017d,
- 0x91: 0x2018,
- 0x92: 0x2019,
- 0x93: 0x201c,
- 0x94: 0x201d,
- 0x95: 0x2022,
- 0x96: 0x2013,
- 0x97: 0x2014,
- 0x98: 0x02dc,
- 0x99: 0x2122,
- 0x9a: 0x0161,
- 0x9b: 0x203a,
- 0x9c: 0x0153,
- 0x9e: 0x017e,
- 0x9f: 0x0178
-}
diff --git a/packages/compiler-dom/src/decodeHtmlBrowser.ts b/packages/compiler-dom/src/decodeHtmlBrowser.ts
index cca3bb12a6e..2e72d0fd1f7 100644
--- a/packages/compiler-dom/src/decodeHtmlBrowser.ts
+++ b/packages/compiler-dom/src/decodeHtmlBrowser.ts
@@ -8,9 +8,9 @@ export function decodeHtmlBrowser(raw: string, asAttr = false): string {
}
if (asAttr) {
decoder.innerHTML = ``
- return decoder.children[0].getAttribute('foo') as string
+ return decoder.children[0].getAttribute('foo')!
} else {
decoder.innerHTML = raw
- return decoder.textContent as string
+ return decoder.textContent!
}
}
diff --git a/packages/compiler-dom/src/errors.ts b/packages/compiler-dom/src/errors.ts
index b519dbdb762..b47624840ab 100644
--- a/packages/compiler-dom/src/errors.ts
+++ b/packages/compiler-dom/src/errors.ts
@@ -1,8 +1,8 @@
import {
- SourceLocation,
- CompilerError,
+ type CompilerError,
+ ErrorCodes,
+ type SourceLocation,
createCompilerError,
- ErrorCodes
} from '@vue/compiler-core'
export interface DOMCompilerError extends CompilerError {
@@ -11,16 +11,16 @@ export interface DOMCompilerError extends CompilerError {
export function createDOMCompilerError(
code: DOMErrorCodes,
- loc?: SourceLocation
+ loc?: SourceLocation,
) {
return createCompilerError(
code,
loc,
- __DEV__ || !__BROWSER__ ? DOMErrorMessages : undefined
+ __DEV__ || !__BROWSER__ ? DOMErrorMessages : undefined,
) as DOMCompilerError
}
-export const enum DOMErrorCodes {
+export enum DOMErrorCodes {
X_V_HTML_NO_EXPRESSION = 53 /* ErrorCodes.__EXTEND_POINT__ */,
X_V_HTML_WITH_CHILDREN,
X_V_TEXT_NO_EXPRESSION,
@@ -32,18 +32,18 @@ export const enum DOMErrorCodes {
X_V_SHOW_NO_EXPRESSION,
X_TRANSITION_INVALID_CHILDREN,
X_IGNORED_SIDE_EFFECT_TAG,
- __EXTEND_POINT__
+ __EXTEND_POINT__,
}
if (__TEST__) {
- // esbuild cannot infer const enum increments if first value is from another
+ // esbuild cannot infer enum increments if first value is from another
// file, so we have to manually keep them in sync. this check ensures it
// errors out if there are collisions.
if (DOMErrorCodes.X_V_HTML_NO_EXPRESSION < ErrorCodes.__EXTEND_POINT__) {
throw new Error(
`DOMErrorCodes need to be updated to ${
ErrorCodes.__EXTEND_POINT__ + 1
- } to match extension point from core ErrorCodes.`
+ } to match extension point from core ErrorCodes.`,
)
}
}
@@ -59,5 +59,5 @@ export const DOMErrorMessages: { [code: number]: string } = {
[DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
[DOMErrorCodes.X_V_SHOW_NO_EXPRESSION]: `v-show is missing expression.`,
[DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN]: `
expects exactly one child element or component.`,
- [DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG]: `Tags with side effect (
- `)
- assertCode(content)
- expect(content).toMatch(`const a = 1;`) // test correct removal
- expect(content).toMatch(`props: ['item'],`)
- expect(content).toMatch(`emits: ['a'],`)
- })
-
- // #6757
- test('defineProps/defineEmits in multi-variable declaration fix #6757 ', () => {
- const { content } = compile(`
-
- `)
- assertCode(content)
- expect(content).toMatch(`const a = 1;`) // test correct removal
- expect(content).toMatch(`props: ['item'],`)
- expect(content).toMatch(`emits: ['a'],`)
- })
-
- // #7422
- test('defineProps/defineEmits in multi-variable declaration fix #7422', () => {
- const { content } = compile(`
-
- `)
- assertCode(content)
- expect(content).toMatch(`props: ['item'],`)
- expect(content).toMatch(`emits: ['foo'],`)
- expect(content).toMatch(`const a = 0,`)
- expect(content).toMatch(`b = 0;`)
- })
-
- test('defineProps/defineEmits in multi-variable declaration (full removal)', () => {
- const { content } = compile(`
-
- `)
- assertCode(content)
- expect(content).toMatch(`props: ['item'],`)
- expect(content).toMatch(`emits: ['a'],`)
- })
-
describe('
+ `)
+ assertCode(content)
+
+ expect(content).toMatch(`console.log('test')`)
+ expect(content).toMatch(`const props = __props;`)
+ expect(content).toMatch(`const emit = __emit;`)
+ expect(content).toMatch(`(function () {})()`)
+ })
+
test('script setup first, named default export', () => {
const { content } = compile(`
`).content
+ `).content,
)
})
@@ -260,7 +220,7 @@ describe('SFC compile
- `).content
+ `).content,
)
})
@@ -272,7 +232,7 @@ describe('SFC compile `).content
+ `).content,
)
})
@@ -280,14 +240,22 @@ describe('SFC compile
+
+
`,
- { reactivityTransform: true }
)
assertCode(content)
- expect(content).toMatch(`import { ref } from 'vue'`)
+ expect(content).toMatch(
+ `import { useCssVars as _useCssVars, unref as _unref } from 'vue'`,
+ )
+ expect(content).toMatch(`import { useCssVars, ref } from 'vue'`)
})
test('import dedupe between
-
-
-
-
- FooBar
-
- `)
- // FooBar: should not be matched by plain text or incorrect case
- // FooBaz: used as PascalCase component
- // FooQux: used as kebab-case component
- // foo: lowercase component
- expect(content).toMatch(
- `return { fooBar, get FooBaz() { return FooBaz }, ` +
- `get FooQux() { return FooQux }, get foo() { return foo } }`
- )
- assertCode(content)
- })
-
- test('directive', () => {
- const { content } = compile(`
-
-
-
-
- `)
- expect(content).toMatch(`return { get vMyDir() { return vMyDir } }`)
- assertCode(content)
- })
-
- // https://github.com/vuejs/core/issues/4599
- test('attribute expressions', () => {
- const { content } = compile(`
-
-
-
-
- `)
- expect(content).toMatch(
- `return { cond, get bar() { return bar }, get baz() { return baz } }`
- )
- assertCode(content)
- })
-
- test('vue interpolations', () => {
- const { content } = compile(`
-
-
- {{ x }} {{ yy }} {{ x$y }}
-
- `)
- // x: used in interpolation
- // y: should not be matched by {{ yy }} or 'y' in binding exps
- // x$y: #4274 should escape special chars when creating Regex
- expect(content).toMatch(
- `return { get x() { return x }, get z() { return z }, get x$y() { return x$y } }`
- )
- assertCode(content)
- })
-
- // #4340 interpolations in template strings
- test('js template string interpolations', () => {
- const { content } = compile(`
-
-
- {{ \`\${VAR}VAR2\${VAR3}\` }}
-
- `)
- // VAR2 should not be matched
- expect(content).toMatch(
- `return { get VAR() { return VAR }, get VAR3() { return VAR3 } }`
- )
- assertCode(content)
- })
-
- // edge case: last tag in template
- test('last tag', () => {
- const { content } = compile(`
-
-
-
-
-
- `)
- expect(content).toMatch(
- `return { get FooBaz() { return FooBaz }, get Last() { return Last } }`
- )
- assertCode(content)
- })
-
- test('TS annotations', () => {
- const { content } = compile(`
-
-
- {{ a as Foo }}
- {{ b() }}
- {{ Baz }}
- {{ data }}
-
-
- `)
- expect(content).toMatch(`return { a, b, get Baz() { return Baz } }`)
- assertCode(content)
- })
-
- // vuejs/vue#12591
- test('v-on inline statement', () => {
- // should not error
- compile(`
-
-
-
-
- `)
- })
- })
-
describe('inlineTemplate mode', () => {
test('should work', () => {
const { content } = compile(
@@ -528,7 +352,7 @@ describe('SFC compile
`,
- { inlineTemplate: true }
+ { inlineTemplate: true },
)
assertCode(content)
expect(content).toMatch(`setup(__props, { expose: __expose })`)
@@ -567,7 +391,7 @@ describe('SFC compile
{{ count }}
@@ -788,20 +613,22 @@ describe('SFC compile
+
+ {{ new Foo() }}
+ {{ new Foo.Bar() }}
+
+ `,
+ { inlineTemplate: true },
+ )
+ expect(content).toMatch(`new (_unref(Foo))()`)
+ expect(content).toMatch(`new (_unref(Foo)).Bar()`)
+ assertCode(content)
+ })
})
describe('with TypeScript', () => {
@@ -839,11 +684,11 @@ describe('SFC compile `
+ `,
)
assertCode(content)
expect(bindings).toStrictEqual({
- Foo: BindingTypes.LITERAL_CONST
+ Foo: BindingTypes.LITERAL_CONST,
})
})
@@ -856,14 +701,14 @@ describe('SFC compile
`
+ `,
)
assertCode(content)
expect(bindings).toStrictEqual({
D: BindingTypes.LITERAL_CONST,
C: BindingTypes.LITERAL_CONST,
B: BindingTypes.LITERAL_CONST,
- Foo: BindingTypes.LITERAL_CONST
+ Foo: BindingTypes.LITERAL_CONST,
})
})
@@ -872,11 +717,11 @@ describe('SFC compile `,
- { hoistStatic: true }
+ { hoistStatic: true },
)
assertCode(content)
expect(bindings).toStrictEqual({
- Foo: BindingTypes.LITERAL_CONST
+ Foo: BindingTypes.LITERAL_CONST,
})
})
@@ -885,18 +730,24 @@ describe('SFC compile `
+ `,
)
expect(content).toMatch(`return { get Baz() { return Baz } }`)
assertCode(content)
})
+
+ test('with generic attribute', () => {
+ const { content } = compile(`
+ `)
+ assertCode(content)
+ })
})
describe('async/await detection', () => {
function assertAwaitDetection(code: string, shouldAsync = true) {
- const { content } = compile(``, {
- reactivityTransform: true
- })
+ const { content } = compile(``)
if (shouldAsync) {
expect(content).toMatch(`let __temp, __restore`)
}
@@ -914,7 +765,7 @@ describe('SFC compile `)
+ compile(``),
).toThrow(``)
+ `),
).toThrow(moduleErrorMsg)
expect(() =>
compile(``)
+ `),
).toThrow(moduleErrorMsg)
expect(() =>
compile(``)
+ `),
).toThrow(moduleErrorMsg)
})
@@ -1047,14 +898,14 @@ describe('SFC compile `)
+ `),
).toThrow(`cannot reference locally declared variables`)
expect(() =>
compile(``)
+ `),
).toThrow(`cannot reference locally declared variables`)
// #4644
@@ -1067,7 +918,7 @@ describe('SFC compile `)
+ `),
).not.toThrow(`cannot reference locally declared variables`)
})
@@ -1083,7 +934,7 @@ describe('SFC compile `).content
+ `).content,
)
})
@@ -1099,9 +950,41 @@ describe('SFC compile `).content
+ `).content,
)
})
+
+ test('defineModel() referencing local var', () => {
+ expect(() =>
+ compile(``),
+ ).toThrow(`cannot reference locally declared variables`)
+
+ // allow const
+ expect(() =>
+ compile(``),
+ ).not.toThrow(`cannot reference locally declared variables`)
+
+ // allow in get/set
+ expect(() =>
+ compile(``),
+ ).not.toThrow(`cannot reference locally declared variables`)
+ })
})
})
@@ -1133,7 +1016,7 @@ describe('SFC analyze
`)
expect(bindings).toStrictEqual({
- foo: BindingTypes.LITERAL_CONST
+ foo: BindingTypes.LITERAL_CONST,
})
})
@@ -1213,7 +1096,7 @@ describe('SFC analyze `,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(`const _sfc_ = {}`)
@@ -1446,8 +1329,8 @@ describe('SFC genDefaultAs', () => {
.foo { color: v-bind(x) }
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).not.toMatch('__default__')
@@ -1464,12 +1347,12 @@ describe('SFC genDefaultAs', () => {
const a = 1
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(
- `const _sfc_ = /*#__PURE__*/Object.assign(__default__`
+ `const _sfc_ = /*#__PURE__*/Object.assign(__default__`,
)
assertCode(content)
})
@@ -1483,12 +1366,12 @@ describe('SFC genDefaultAs', () => {
const a = 1
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(
- `const _sfc_ = /*#__PURE__*/Object.assign(__default__`
+ `const _sfc_ = /*#__PURE__*/Object.assign(__default__`,
)
assertCode(content)
})
@@ -1499,8 +1382,8 @@ describe('SFC genDefaultAs', () => {
const a = 1
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(`const _sfc_ = {\n setup`)
@@ -1513,8 +1396,8 @@ describe('SFC genDefaultAs', () => {
const a = 1
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(`const _sfc_ = /*#__PURE__*/_defineComponent(`)
@@ -1530,12 +1413,12 @@ describe('SFC genDefaultAs', () => {
const a = 1
`,
{
- genDefaultAs: '_sfc_'
- }
+ genDefaultAs: '_sfc_',
+ },
)
expect(content).not.toMatch('export default')
expect(content).toMatch(
- `const _sfc_ = /*#__PURE__*/_defineComponent({\n ...__default__`
+ `const _sfc_ = /*#__PURE__*/_defineComponent({\n ...__default__`,
)
assertCode(content)
})
@@ -1546,12 +1429,46 @@ describe('SFC genDefaultAs', () => {
import { toRef } from 'vue'
const props = defineProps<{foo: string}>()
const foo = toRef(() => props.foo)
- `
+ `,
)
expect(bindings).toStrictEqual({
toRef: BindingTypes.SETUP_CONST,
props: BindingTypes.SETUP_REACTIVE_CONST,
- foo: BindingTypes.SETUP_REF
+ foo: BindingTypes.SETUP_REF,
+ })
+ })
+
+ describe('parser plugins', () => {
+ test('import attributes', () => {
+ const { content } = compile(`
+
+ `)
+ assertCode(content)
+
+ expect(() =>
+ compile(`
+ `),
+ ).toThrow()
+ })
+
+ test('import attributes (user override for deprecated syntax)', () => {
+ const { content } = compile(
+ `
+
+ `,
+ {
+ babelParserPlugins: [
+ ['importAttributes', { deprecatedAssertSyntax: true }],
+ ],
+ },
+ )
+ assertCode(content)
})
})
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineEmits.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineEmits.spec.ts.snap
index a8bd930fbbc..26444fd63d3 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineEmits.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineEmits.spec.ts.snap
@@ -1,12 +1,13 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`defineEmits > basic usage 1`] = `
-"export default {
+"
+export default {
emits: ['foo', 'bar'],
- setup(__props, { expose: __expose, emit: myEmit }) {
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+const myEmit = __emit
return { myEmit }
}
@@ -19,10 +20,10 @@ exports[`defineEmits > w/ runtime options 1`] = `
export default /*#__PURE__*/_defineComponent({
emits: ['a', 'b'],
- setup(__props, { expose: __expose, emit }) {
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+const emit = __emit
return { emit }
}
@@ -35,11 +36,11 @@ exports[`defineEmits > w/ type (exported interface) 1`] = `
export interface Emits { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -52,11 +53,11 @@ exports[`defineEmits > w/ type (exported type alias) 1`] = `
export type Emits = { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -70,10 +71,28 @@ interface Emits { (e: 'foo'): void }
export default /*#__PURE__*/_defineComponent({
emits: ['foo'],
- setup(__props, { expose: __expose, emit }) {
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
+ const emit: Emits = __emit
+return { emit }
+}
+
+})"
+`;
+
+exports[`defineEmits > w/ type (interface w/ extends) 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+interface Base { (e: 'foo'): void }
+ interface Emits extends Base { (e: 'bar'): void }
+
+export default /*#__PURE__*/_defineComponent({
+ emits: ["bar", "foo"],
+ setup(__props, { expose: __expose, emit: __emit }) {
+ __expose();
+
+ const emit = __emit
return { emit }
}
@@ -86,11 +105,11 @@ exports[`defineEmits > w/ type (interface) 1`] = `
interface Emits { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -102,11 +121,11 @@ exports[`defineEmits > w/ type (property syntax string literal) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo:bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo:bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -118,11 +137,11 @@ exports[`defineEmits > w/ type (property syntax) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -135,11 +154,11 @@ exports[`defineEmits > w/ type (referenced exported function type) 1`] = `
export type Emits = (e: 'foo' | 'bar') => void
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -152,11 +171,11 @@ exports[`defineEmits > w/ type (referenced function type) 1`] = `
type Emits = (e: 'foo' | 'bar') => void
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -169,11 +188,11 @@ exports[`defineEmits > w/ type (type alias) 1`] = `
type Emits = { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -185,11 +204,11 @@ exports[`defineEmits > w/ type (type literal w/ call signatures) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\", \\"baz\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar", "baz"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -199,15 +218,15 @@ return { emit }
exports[`defineEmits > w/ type (type references in union) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
-type BaseEmit = \\"change\\"
- type Emit = \\"some\\" | \\"emit\\" | BaseEmit
+type BaseEmit = "change"
+ type Emit = "some" | "emit" | BaseEmit
export default /*#__PURE__*/_defineComponent({
- emits: [\\"some\\", \\"emit\\", \\"change\\", \\"another\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["some", "emit", "change", "another"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit;
return { emit }
}
@@ -219,11 +238,11 @@ exports[`defineEmits > w/ type (union) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\", \\"baz\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar", "baz"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -235,11 +254,11 @@ exports[`defineEmits > w/ type 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
@@ -253,11 +272,11 @@ exports[`defineEmits > w/ type from normal script 1`] = `
export interface Emits { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
- emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }) {
+ emits: ["foo", "bar"],
+ setup(__props, { expose: __expose, emit: __emit }) {
__expose();
-
+ const emit = __emit
return { emit }
}
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineExpose.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineExpose.spec.ts.snap
index d72726460bf..f8754f8a9af 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineExpose.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineExpose.spec.ts.snap
@@ -16,7 +16,8 @@ return { n, get x() { return x } }
`;
exports[`defineExpose() 1`] = `
-"export default {
+"
+export default {
setup(__props, { expose: __expose }) {
__expose({ foo: 123 })
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineModel.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineModel.spec.ts.snap
index fdfd3710efc..b6a93541d36 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineModel.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineModel.spec.ts.snap
@@ -5,56 +5,118 @@ exports[`defineModel() > basic usage 1`] = `
export default {
props: {
- \\"modelValue\\": { required: true },
- \\"count\\": {},
+ "modelValue": { required: true },
+ "modelModifiers": {},
+ "count": {},
+ "countModifiers": {},
+ "toString": { type: Function },
+ "toStringModifiers": {},
},
- emits: [\\"update:modelValue\\", \\"update:count\\"],
+ emits: ["update:modelValue", "update:count", "update:toString"],
setup(__props, { expose: __expose }) {
__expose();
- const modelValue = _useModel(__props, \\"modelValue\\")
- const c = _useModel(__props, \\"count\\")
+ const modelValue = _useModel(__props, "modelValue")
+ const c = _useModel(__props, 'count')
+ const toString = _useModel(__props, 'toString')
-return { modelValue, c }
+return { modelValue, c, toString }
}
}"
`;
-exports[`defineModel() > w/ array props 1`] = `
-"import { useModel as _useModel, mergeModels as _mergeModels } from 'vue'
+exports[`defineModel() > get / set transformers 1`] = `
+"import { useModel as _useModel, defineComponent as _defineComponent } from 'vue'
-export default {
- props: _mergeModels(['foo', 'bar'], {
- \\"count\\": {},
- }),
- emits: [\\"update:count\\"],
+export default /*#__PURE__*/_defineComponent({
+ props: {
+ "modelValue": {
+ required: true
+ },
+ "modelModifiers": {},
+ },
+ emits: ["update:modelValue"],
setup(__props, { expose: __expose }) {
__expose();
+ const modelValue = _useModel(__props, "modelValue", {
+ get(v) { return v - 1 },
+ set: (v) => { return v + 1 },
+ })
- const count = _useModel(__props, \\"count\\")
+return { modelValue }
+}
+
+})"
+`;
+
+exports[`defineModel() > get / set transformers 2`] = `
+"import { useModel as _useModel, defineComponent as _defineComponent } from 'vue'
+
+export default /*#__PURE__*/_defineComponent({
+ props: {
+ "modelValue": {
+ default: 0,
+ required: true,
+ },
+ "modelModifiers": {},
+ },
+ emits: ["update:modelValue"],
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+ const modelValue = _useModel(__props, "modelValue", {
+ get(v) { return v - 1 },
+ set: (v) => { return v + 1 },
+ })
-return { count }
+return { modelValue }
}
-}"
+})"
`;
-exports[`defineModel() > w/ defineProps and defineEmits 1`] = `
+exports[`defineModel() > usage w/ props destructure 1`] = `
+"import { useModel as _useModel, mergeModels as _mergeModels, defineComponent as _defineComponent } from 'vue'
+
+export default /*#__PURE__*/_defineComponent({
+ props: /*#__PURE__*/_mergeModels({
+ x: { type: Number, required: true }
+ }, {
+ "modelValue": {
+ },
+ "modelModifiers": {},
+ }),
+ emits: ["update:modelValue"],
+ setup(__props: any, { expose: __expose }) {
+ __expose();
+
+
+ const modelValue = _useModel(__props, "modelValue", {
+ set: (v) => { return v + __props.x }
+ })
+
+return { modelValue }
+}
+
+})"
+`;
+
+exports[`defineModel() > w/ array props 1`] = `
"import { useModel as _useModel, mergeModels as _mergeModels } from 'vue'
export default {
- props: _mergeModels({ foo: String }, {
- \\"modelValue\\": { default: 0 },
+ props: /*#__PURE__*/_mergeModels(['foo', 'bar'], {
+ "count": {},
+ "countModifiers": {},
}),
- emits: _mergeModels(['change'], [\\"update:modelValue\\"]),
+ emits: ["update:count"],
setup(__props, { expose: __expose }) {
__expose();
-
- const count = _useModel(__props, \\"modelValue\\")
+ const count = _useModel(__props, 'count')
return { count }
}
@@ -62,33 +124,23 @@ return { count }
}"
`;
-exports[`defineModel() > w/ local flag 1`] = `
-"import { useModel as _useModel } from 'vue'
-const local = true
-
+exports[`defineModel() > w/ defineProps and defineEmits 1`] = `
+"import { useModel as _useModel, mergeModels as _mergeModels } from 'vue'
+
export default {
- props: {
- \\"modelValue\\": { local: true, default: 1 },
- \\"bar\\": { [key]: true },
- \\"baz\\": { ...x },
- \\"qux\\": x,
- \\"foo2\\": { local: true, ...x },
- \\"hoist\\": { local },
- },
- emits: [\\"update:modelValue\\", \\"update:bar\\", \\"update:baz\\", \\"update:qux\\", \\"update:foo2\\", \\"update:hoist\\"],
+ props: /*#__PURE__*/_mergeModels({ foo: String }, {
+ "modelValue": { default: 0 },
+ "modelModifiers": {},
+ }),
+ emits: /*#__PURE__*/_mergeModels(['change'], ["update:modelValue"]),
setup(__props, { expose: __expose }) {
__expose();
- const foo = _useModel(__props, \\"modelValue\\", { local: true })
- const bar = _useModel(__props, \\"bar\\", { [key]: true })
- const baz = _useModel(__props, \\"baz\\", { ...x })
- const qux = _useModel(__props, \\"qux\\", x)
-
- const foo2 = _useModel(__props, \\"foo2\\", { local: true })
-
- const hoist = _useModel(__props, \\"hoist\\", { local })
-return { foo, bar, baz, qux, foo2, local, hoist }
+
+ const count = _useModel(__props, "modelValue")
+
+return { count }
}
}"
@@ -99,19 +151,23 @@ exports[`defineModel() > w/ types, basic usage 1`] = `
export default /*#__PURE__*/_defineComponent({
props: {
- \\"modelValue\\": { type: [Boolean, String] },
- \\"count\\": { type: Number },
- \\"disabled\\": { type: Number, ...{ required: false } },
- \\"any\\": { type: Boolean, skipCheck: true },
+ "modelValue": { type: [Boolean, String] },
+ "modelModifiers": {},
+ "count": { type: Number },
+ "countModifiers": {},
+ "disabled": { type: Number, ...{ required: false } },
+ "disabledModifiers": {},
+ "any": { type: Boolean, skipCheck: true },
+ "anyModifiers": {},
},
- emits: [\\"update:modelValue\\", \\"update:count\\", \\"update:disabled\\", \\"update:any\\"],
+ emits: ["update:modelValue", "update:count", "update:disabled", "update:any"],
setup(__props, { expose: __expose }) {
__expose();
- const modelValue = _useModel(__props, \\"modelValue\\")
- const count = _useModel(__props, \\"count\\")
- const disabled = _useModel(__props, \\"disabled\\")
- const any = _useModel(__props, \\"any\\")
+ const modelValue = _useModel(__props, "modelValue")
+ const count = _useModel(__props, 'count')
+ const disabled = _useModel(__props, 'disabled')
+ const any = _useModel(__props, 'any')
return { modelValue, count, disabled, any }
}
@@ -124,21 +180,26 @@ exports[`defineModel() > w/ types, production mode 1`] = `
export default /*#__PURE__*/_defineComponent({
props: {
- \\"modelValue\\": { type: Boolean },
- \\"fn\\": {},
- \\"fnWithDefault\\": { type: Function, ...{ default: () => null } },
- \\"str\\": {},
- \\"optional\\": { required: false },
+ "modelValue": { type: Boolean },
+ "modelModifiers": {},
+ "fn": {},
+ "fnModifiers": {},
+ "fnWithDefault": { type: Function, ...{ default: () => null } },
+ "fnWithDefaultModifiers": {},
+ "str": {},
+ "strModifiers": {},
+ "optional": { required: false },
+ "optionalModifiers": {},
},
- emits: [\\"update:modelValue\\", \\"update:fn\\", \\"update:fnWithDefault\\", \\"update:str\\", \\"update:optional\\"],
+ emits: ["update:modelValue", "update:fn", "update:fnWithDefault", "update:str", "update:optional"],
setup(__props, { expose: __expose }) {
__expose();
- const modelValue = _useModel(__props, \\"modelValue\\")
- const fn = _useModel(__props, \\"fn\\")
- const fnWithDefault = _useModel(__props, \\"fnWithDefault\\")
- const str = _useModel(__props, \\"str\\")
- const optional = _useModel(__props, \\"optional\\")
+ const modelValue = _useModel(__props, "modelValue")
+ const fn = _useModel<() => void>(__props, 'fn')
+ const fnWithDefault = _useModel<() => void>(__props, 'fnWithDefault')
+ const str = _useModel(__props, 'str')
+ const optional = _useModel(__props, 'optional')
return { modelValue, fn, fnWithDefault, str, optional }
}
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineOptions.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineOptions.spec.ts.snap
index 47f3cef0ae1..9cb168be161 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineOptions.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineOptions.spec.ts.snap
@@ -1,7 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`defineOptions() > basic usage 1`] = `
-"export default /*#__PURE__*/Object.assign({ name: 'FooApp' }, {
+"
+export default /*#__PURE__*/Object.assign({ name: 'FooApp' }, {
setup(__props, { expose: __expose }) {
__expose();
@@ -14,7 +15,8 @@ return { }
`;
exports[`defineOptions() > empty argument 1`] = `
-"export default {
+"
+export default {
setup(__props, { expose: __expose }) {
__expose();
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineProps.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineProps.spec.ts.snap
index 62d9bef5d27..ce5eaed18fd 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineProps.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineProps.spec.ts.snap
@@ -10,9 +10,7 @@ export default {
setup(__props, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+const props = __props
return { props, bar }
}
@@ -20,6 +18,47 @@ return { props, bar }
}"
`;
+exports[`defineProps > custom element retains the props type & default value & production mode 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+interface Props {
+ foo?: number;
+ }
+
+export default /*#__PURE__*/_defineComponent({
+ __name: 'app.ce',
+ props: {
+ foo: { default: 5.5, type: Number }
+ },
+ setup(__props: any, { expose: __expose }) {
+ __expose();
+
+ const props = __props;
+
+return { props }
+}
+
+})"
+`;
+
+exports[`defineProps > custom element retains the props type & production mode 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+
+export default /*#__PURE__*/_defineComponent({
+ __name: 'app.ce',
+ props: {
+ foo: {type: Number}
+ },
+ setup(__props: any, { expose: __expose }) {
+ __expose();
+
+ const props = __props
+
+return { props }
+}
+
+})"
+`;
+
exports[`defineProps > defineProps w/ runtime options 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
@@ -28,9 +67,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+const props = __props
return { props }
}
@@ -48,10 +85,53 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const { foo } = __props;
-
-
+ const { foo } = __props
+return { }
+}
+
+})"
+`;
+
+exports[`defineProps > should escape names w/ special symbols 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+
+export default /*#__PURE__*/_defineComponent({
+ props: {
+ "spa ce": { type: null, required: true },
+ "exclamation!mark": { type: null, required: true },
+ "double\\"quote": { type: null, required: true },
+ "hash#tag": { type: null, required: true },
+ "dollar$sign": { type: null, required: true },
+ "percentage%sign": { type: null, required: true },
+ "amper&sand": { type: null, required: true },
+ "single'quote": { type: null, required: true },
+ "round(brack)ets": { type: null, required: true },
+ "aste*risk": { type: null, required: true },
+ "pl+us": { type: null, required: true },
+ "com,ma": { type: null, required: true },
+ "do.t": { type: null, required: true },
+ "sla/sh": { type: null, required: true },
+ "co:lon": { type: null, required: true },
+ "semi;colon": { type: null, required: true },
+ "angleets": { type: null, required: true },
+ "equal=sign": { type: null, required: true },
+ "question?mark": { type: null, required: true },
+ "at@sign": { type: null, required: true },
+ "square[brack]ets": { type: null, required: true },
+ "back\\\\slash": { type: null, required: true },
+ "ca^ret": { type: null, required: true },
+ "back\`tick": { type: null, required: true },
+ "curly{bra}ces": { type: null, required: true },
+ "pi|pe": { type: null, required: true },
+ "til~de": { type: null, required: true },
+ "da-sh": { type: null, required: true }
+ },
+ setup(__props: any, { expose: __expose }) {
+ __expose();
+
+
+
return { }
}
@@ -167,9 +247,7 @@ export default {
setup(__props, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props, get propsModel() { return propsModel } }
}
@@ -203,9 +281,7 @@ export default {
props: {},
setup(__props, { expose: __expose }) {
__expose();
-
-const props = __props;
-
+const props = __props
return { props, get x() { return x } }
}
@@ -242,6 +318,7 @@ export default /*#__PURE__*/_defineComponent({
alias: { type: Array, required: true },
method: { type: Function, required: true },
symbol: { type: Symbol, required: true },
+ error: { type: Error, required: true },
extract: { type: Number, required: true },
exclude: { type: [Number, Boolean], required: true },
uppercase: { type: String, required: true },
@@ -296,7 +373,7 @@ exports[`defineProps > withDefaults (dynamic) 1`] = `
import { defaults } from './foo'
export default /*#__PURE__*/_defineComponent({
- props: _mergeDefaults({
+ props: /*#__PURE__*/_mergeDefaults({
foo: { type: String, required: false },
bar: { type: Number, required: false },
baz: { type: Boolean, required: true }
@@ -304,9 +381,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props, get defaults() { return defaults } }
}
@@ -319,7 +394,7 @@ exports[`defineProps > withDefaults (dynamic) w/ production mode 1`] = `
import { defaults } from './foo'
export default /*#__PURE__*/_defineComponent({
- props: _mergeDefaults({
+ props: /*#__PURE__*/_mergeDefaults({
foo: { type: Function },
bar: { type: Boolean },
baz: { type: [Boolean, Function] },
@@ -328,9 +403,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props, get defaults() { return defaults } }
}
@@ -343,7 +416,7 @@ exports[`defineProps > withDefaults (reference) 1`] = `
import { defaults } from './foo'
export default /*#__PURE__*/_defineComponent({
- props: _mergeDefaults({
+ props: /*#__PURE__*/_mergeDefaults({
foo: { type: String, required: false },
bar: { type: Number, required: false },
baz: { type: Boolean, required: true }
@@ -351,9 +424,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props, get defaults() { return defaults } }
}
@@ -370,14 +441,12 @@ exports[`defineProps > withDefaults (static) + normal script 1`] = `
export default /*#__PURE__*/_defineComponent({
props: {
- a: { type: String, required: false, default: \\"a\\" }
+ a: { type: String, required: false, default: "a" }
},
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props;
return { props }
}
@@ -401,9 +470,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props }
}
@@ -424,9 +491,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props }
}
@@ -438,7 +503,7 @@ exports[`defineProps > withDefaults w/ dynamic object method 1`] = `
"import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
- props: _mergeDefaults({
+ props: /*#__PURE__*/_mergeDefaults({
foo: { type: Function, required: false }
}, {
['fo' + 'o']() { return 'foo' }
@@ -446,9 +511,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose: __expose }) {
__expose();
-const props = __props;
-
-
+ const props = __props
return { props }
}
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap
index 721ef7eaa54..8b5325cc3c5 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`sfc reactive props destructure > aliasing 1`] = `
-"import { toDisplayString as _toDisplayString } from \\"vue\\"
+"import { toDisplayString as _toDisplayString } from "vue"
export default {
@@ -21,7 +21,7 @@ return (_ctx, _cache) => {
`;
exports[`sfc reactive props destructure > basic usage 1`] = `
-"import { toDisplayString as _toDisplayString } from \\"vue\\"
+"import { toDisplayString as _toDisplayString } from "vue"
export default {
@@ -40,7 +40,7 @@ return (_ctx, _cache) => {
`;
exports[`sfc reactive props destructure > computed static key 1`] = `
-"import { toDisplayString as _toDisplayString } from \\"vue\\"
+"import { toDisplayString as _toDisplayString } from "vue"
export default {
@@ -62,7 +62,7 @@ exports[`sfc reactive props destructure > default values w/ array runtime declar
"import { mergeDefaults as _mergeDefaults } from 'vue'
export default {
- props: _mergeDefaults(['foo', 'bar', 'baz'], {
+ props: /*#__PURE__*/_mergeDefaults(['foo', 'bar', 'baz'], {
foo: 1,
bar: () => ({}),
func: () => {}, __skip_func: true
@@ -81,7 +81,7 @@ exports[`sfc reactive props destructure > default values w/ object runtime decla
"import { mergeDefaults as _mergeDefaults } from 'vue'
export default {
- props: _mergeDefaults({ foo: Number, bar: Object, func: Function, ext: null }, {
+ props: /*#__PURE__*/_mergeDefaults({ foo: Number, bar: Object, func: Function, ext: null }, {
foo: 1,
bar: () => ({}),
func: () => {}, __skip_func: true,
@@ -101,9 +101,9 @@ exports[`sfc reactive props destructure > default values w/ runtime declaration
"import { mergeDefaults as _mergeDefaults } from 'vue'
export default {
- props: _mergeDefaults(['foo', 'foo:bar'], {
+ props: /*#__PURE__*/_mergeDefaults(['foo', 'foo:bar'], {
foo: 1,
- \\"foo:bar\\": 'foo-bar'
+ "foo:bar": 'foo-bar'
}),
setup(__props) {
@@ -122,8 +122,8 @@ export default /*#__PURE__*/_defineComponent({
props: {
foo: { type: Number, required: true, default: 1 },
bar: { type: Number, required: true, default: 2 },
- \\"foo:bar\\": { type: String, required: true, default: 'foo-bar' },
- \\"onUpdate:modelValue\\": { type: Function, required: true }
+ "foo:bar": { type: String, required: true, default: 'foo-bar' },
+ "onUpdate:modelValue": { type: Function, required: true }
},
setup(__props: any) {
@@ -176,8 +176,67 @@ return () => {}
})"
`;
+exports[`sfc reactive props destructure > defineProps/defineEmits in multi-variable declaration (full removal) 1`] = `
+"
+export default {
+ props: ['item'],
+ emits: ['a'],
+ setup(__props, { emit: __emit }) {
+
+ const props = __props,
+ emit = __emit;
+
+return () => {}
+}
+
+}"
+`;
+
+exports[`sfc reactive props destructure > multi-variable declaration 1`] = `
+"
+export default {
+ props: ['item'],
+ setup(__props) {
+
+ const a = 1;
+
+return () => {}
+}
+
+}"
+`;
+
+exports[`sfc reactive props destructure > multi-variable declaration fix #6757 1`] = `
+"
+export default {
+ props: ['item'],
+ setup(__props) {
+
+ const a = 1;
+
+return () => {}
+}
+
+}"
+`;
+
+exports[`sfc reactive props destructure > multi-variable declaration fix #7422 1`] = `
+"
+export default {
+ props: ['item'],
+ setup(__props) {
+
+ const a = 0,
+ b = 0;
+
+return () => {}
+}
+
+}"
+`;
+
exports[`sfc reactive props destructure > multiple variable declarations 1`] = `
-"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from \\"vue\\"
+"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
export default {
@@ -187,7 +246,7 @@ export default {
const bar = 'fish', hello = 'world'
return (_ctx, _cache) => {
- return (_openBlock(), _createElementBlock(\\"div\\", null, _toDisplayString(__props.foo) + \\" \\" + _toDisplayString(hello) + \\" \\" + _toDisplayString(bar), 1 /* TEXT */))
+ return (_openBlock(), _createElementBlock("div", null, _toDisplayString(__props.foo) + " " + _toDisplayString(hello) + " " + _toDisplayString(bar), 1 /* TEXT */))
}
}
@@ -195,7 +254,8 @@ return (_ctx, _cache) => {
`;
exports[`sfc reactive props destructure > nested scope 1`] = `
-"export default {
+"
+export default {
props: ['foo', 'bar'],
setup(__props) {
@@ -212,7 +272,7 @@ return () => {}
`;
exports[`sfc reactive props destructure > non-identifier prop names 1`] = `
-"import { toDisplayString as _toDisplayString } from \\"vue\\"
+"import { toDisplayString as _toDisplayString } from "vue"
export default {
@@ -220,10 +280,10 @@ export default {
setup(__props) {
- let x = __props[\\"foo.bar\\"]
+ let x = __props["foo.bar"]
return (_ctx, _cache) => {
- return _toDisplayString(__props[\\"foo.bar\\"])
+ return _toDisplayString(__props["foo.bar"])
}
}
@@ -237,9 +297,7 @@ export default {
props: ['foo', 'bar', 'baz'],
setup(__props) {
-const rest = _createPropsRestProxy(__props, [\\"foo\\",\\"bar\\"]);
-
-
+ const rest = _createPropsRestProxy(__props, ["foo","bar"])
return () => {}
}
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/hoistStatic.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/hoistStatic.spec.ts.snap
index 307b3e212fe..5ab70d9b6c6 100644
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/hoistStatic.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/hoistStatic.spec.ts.snap
@@ -1,7 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`sfc hoist static > should enable when only script setup 1`] = `
-"const foo = 'bar'
+"
+ const foo = 'bar'
export default {
setup(__props) {
@@ -91,7 +92,8 @@ return () => {}
`;
exports[`sfc hoist static > should not hoist a function or class 1`] = `
-"export default {
+"
+export default {
setup(__props) {
const fn = () => {}
@@ -105,7 +107,8 @@ return () => {}
`;
exports[`sfc hoist static > should not hoist a object or array 1`] = `
-"export default {
+"
+export default {
setup(__props) {
const obj = { foo: 'bar' }
@@ -118,7 +121,8 @@ return () => {}
`;
exports[`sfc hoist static > should not hoist a variable 1`] = `
-"export default {
+"
+export default {
setup(__props) {
let KEY1 = 'default value'
@@ -133,7 +137,8 @@ return () => {}
`;
exports[`sfc hoist static > should not hoist when disabled 1`] = `
-"export default {
+"
+export default {
setup(__props) {
const foo = 'bar'
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/importUsageCheck.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/importUsageCheck.spec.ts.snap
new file mode 100644
index 00000000000..cfdbf5f45c2
--- /dev/null
+++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/importUsageCheck.spec.ts.snap
@@ -0,0 +1,215 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`TS annotations 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { Foo, Bar, Baz, Qux, Fred } from './x'
+ const a = 1
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+ function b() {}
+
+return { a, b, get Baz() { return Baz } }
+}
+
+})"
+`;
+
+exports[`attribute expressions 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { bar, baz } from './x'
+ const cond = true
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { cond, get bar() { return bar }, get baz() { return baz } }
+}
+
+})"
+`;
+
+exports[`components 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { FooBar, FooBaz, FooQux, foo } from './x'
+ const fooBar: FooBar = 1
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { fooBar, get FooBaz() { return FooBaz }, get FooQux() { return FooQux }, get foo() { return foo } }
+}
+
+})"
+`;
+
+exports[`directive 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { vMyDir } from './x'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get vMyDir() { return vMyDir } }
+}
+
+})"
+`;
+
+exports[`dynamic arguments 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { FooBar, foo, bar, unused, baz } from './x'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get FooBar() { return FooBar }, get foo() { return foo }, get bar() { return bar }, get baz() { return baz } }
+}
+
+})"
+`;
+
+exports[`import namespace 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import * as Foo from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get Foo() { return Foo } }
+}
+
+})"
+`;
+
+exports[`js template string interpolations 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { VAR, VAR2, VAR3 } from './x'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get VAR() { return VAR }, get VAR3() { return VAR3 } }
+}
+
+})"
+`;
+
+exports[`last tag 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { FooBaz, Last } from './x'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get FooBaz() { return FooBaz }, get Last() { return Last } }
+}
+
+})"
+`;
+
+exports[`namespace / dot component usage 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import * as Foo from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get Foo() { return Foo } }
+}
+
+})"
+`;
+
+exports[`property access (whitespace) 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { Foo, Bar, Baz } from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get Foo() { return Foo } }
+}
+
+})"
+`;
+
+exports[`property access 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { Foo, Bar, Baz } from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get Foo() { return Foo } }
+}
+
+})"
+`;
+
+exports[`spread operator 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { Foo, Bar, Baz } from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get Foo() { return Foo } }
+}
+
+})"
+`;
+
+exports[`template ref 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { foo, bar, Baz } from './foo'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get foo() { return foo }, get bar() { return bar }, get Baz() { return Baz } }
+}
+
+})"
+`;
+
+exports[`vue interpolations 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+import { x, y, z, x$y } from './x'
+
+export default /*#__PURE__*/_defineComponent({
+ setup(__props, { expose: __expose }) {
+ __expose();
+
+
+return { get x() { return x }, get z() { return z }, get x$y() { return x$y } }
+}
+
+})"
+`;
diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/reactivityTransform.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/reactivityTransform.spec.ts.snap
deleted file mode 100644
index e20640d8abb..00000000000
--- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/reactivityTransform.spec.ts.snap
+++ /dev/null
@@ -1,113 +0,0 @@
-// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-
-exports[`sfc ref transform > $ unwrapping 1`] = `
-"import { ref, shallowRef } from 'vue'
-
-export default {
- setup(__props, { expose: __expose }) {
- __expose();
-
- let foo = (ref())
- let a = (ref(1))
- let b = (shallowRef({
- count: 0
- }))
- let c = () => {}
- let d
-
-return { foo, a, b, get c() { return c }, set c(v) { c = v }, get d() { return d }, set d(v) { d = v }, ref, shallowRef }
-}
-
-}"
-`;
-
-exports[`sfc ref transform > $ref & $shallowRef declarations 1`] = `
-"import { ref as _ref, shallowRef as _shallowRef } from 'vue'
-
-export default {
- setup(__props, { expose: __expose }) {
- __expose();
-
- let foo = _ref()
- let a = _ref(1)
- let b = _shallowRef({
- count: 0
- })
- let c = () => {}
- let d
-
-return { foo, a, b, get c() { return c }, set c(v) { c = v }, get d() { return d }, set d(v) { d = v } }
-}
-
-}"
-`;
-
-exports[`sfc ref transform > usage /w typescript 1`] = `
-"import { ref as _ref, defineComponent as _defineComponent } from 'vue'
-
-export default /*#__PURE__*/_defineComponent({
- setup(__props, { expose: __expose }) {
- __expose();
-
- let msg = _ref('foo');
- let bar = _ref ('bar');
-
-return { msg, bar }
-}
-
-})"
-`;
-
-exports[`sfc ref transform > usage in normal
+ `)
+ assertCode(content)
+ expect(content).toMatch(`emits: ["bar", "foo"]`)
+ })
+
test('w/ type (exported interface)', () => {
const { content } = compile(`
`)
+ `),
).toThrow(
- `defineEmits() type cannot mixed call signature and property syntax.`
+ `defineEmits() type cannot mixed call signature and property syntax.`,
)
})
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts
index 8ddd28a89e6..7b2a9f7cbe4 100644
--- a/packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/defineExpose.spec.ts
@@ -1,4 +1,4 @@
-import { compileSFCScript as compile, assertCode } from '../utils'
+import { assertCode, compileSFCScript as compile } from '../utils'
test('defineExpose()', () => {
const { content } = compile(`
diff --git a/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts
index 61a9adcbe0d..304258615a8 100644
--- a/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts
@@ -1,5 +1,5 @@
import { BindingTypes } from '@vue/compiler-core'
-import { compileSFCScript as compile, assertCode } from '../utils'
+import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineModel()', () => {
test('basic usage', () => {
@@ -8,26 +8,31 @@ describe('defineModel()', () => {
`,
- { defineModel: true }
)
assertCode(content)
expect(content).toMatch('props: {')
expect(content).toMatch('"modelValue": { required: true },')
expect(content).toMatch('"count": {},')
- expect(content).toMatch('emits: ["update:modelValue", "update:count"],')
+ expect(content).toMatch('"toString": { type: Function },')
expect(content).toMatch(
- `const modelValue = _useModel(__props, "modelValue")`
+ 'emits: ["update:modelValue", "update:count", "update:toString"],',
)
- expect(content).toMatch(`const c = _useModel(__props, "count")`)
- expect(content).toMatch(`return { modelValue, c }`)
+ expect(content).toMatch(
+ `const modelValue = _useModel(__props, "modelValue")`,
+ )
+ expect(content).toMatch(`const c = _useModel(__props, 'count')`)
+ expect(content).toMatch(`const toString = _useModel(__props, 'toString')`)
+ expect(content).toMatch(`return { modelValue, c, toString }`)
expect(content).not.toMatch('defineModel')
expect(bindings).toStrictEqual({
modelValue: BindingTypes.SETUP_REF,
count: BindingTypes.PROPS,
- c: BindingTypes.SETUP_REF
+ c: BindingTypes.SETUP_REF,
+ toString: BindingTypes.SETUP_REF,
})
})
@@ -40,17 +45,16 @@ describe('defineModel()', () => {
const count = defineModel({ default: 0 })
`,
- { defineModel: true }
)
assertCode(content)
- expect(content).toMatch(`props: _mergeModels({ foo: String }`)
+ expect(content).toMatch(`props: /*#__PURE__*/_mergeModels({ foo: String }`)
expect(content).toMatch(`"modelValue": { default: 0 }`)
expect(content).toMatch(`const count = _useModel(__props, "modelValue")`)
expect(content).not.toMatch('defineModel')
expect(bindings).toStrictEqual({
count: BindingTypes.SETUP_REF,
foo: BindingTypes.PROPS,
- modelValue: BindingTypes.PROPS
+ modelValue: BindingTypes.PROPS,
})
})
@@ -62,45 +66,21 @@ describe('defineModel()', () => {
const count = defineModel('count')
`,
- { defineModel: true }
)
assertCode(content)
- expect(content).toMatch(`props: _mergeModels(['foo', 'bar'], {
+ expect(content).toMatch(`props: /*#__PURE__*/_mergeModels(['foo', 'bar'], {
"count": {},
+ "countModifiers": {},
})`)
- expect(content).toMatch(`const count = _useModel(__props, "count")`)
+ expect(content).toMatch(`const count = _useModel(__props, 'count')`)
expect(content).not.toMatch('defineModel')
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
bar: BindingTypes.PROPS,
- count: BindingTypes.SETUP_REF
+ count: BindingTypes.SETUP_REF,
})
})
- test('w/ local flag', () => {
- const { content } = compile(
- ``,
- { defineModel: true }
- )
- assertCode(content)
- expect(content).toMatch(`_useModel(__props, "modelValue", { local: true })`)
- expect(content).toMatch(`_useModel(__props, "bar", { [key]: true })`)
- expect(content).toMatch(`_useModel(__props, "baz", { ...x })`)
- expect(content).toMatch(`_useModel(__props, "qux", x)`)
- expect(content).toMatch(`_useModel(__props, "foo2", { local: true })`)
- expect(content).toMatch(`_useModel(__props, "hoist", { local })`)
- })
-
test('w/ types, basic usage', () => {
const { content, bindings } = compile(
`
@@ -111,31 +91,35 @@ describe('defineModel()', () => {
const any = defineModel('any')
`,
- { defineModel: true }
)
assertCode(content)
expect(content).toMatch('"modelValue": { type: [Boolean, String] }')
+ expect(content).toMatch('"modelModifiers": {}')
expect(content).toMatch('"count": { type: Number }')
expect(content).toMatch(
- '"disabled": { type: Number, ...{ required: false } }'
+ '"disabled": { type: Number, ...{ required: false } }',
)
expect(content).toMatch('"any": { type: Boolean, skipCheck: true }')
expect(content).toMatch(
- 'emits: ["update:modelValue", "update:count", "update:disabled", "update:any"]'
+ 'emits: ["update:modelValue", "update:count", "update:disabled", "update:any"]',
)
expect(content).toMatch(
- `const modelValue = _useModel(__props, "modelValue")`
+ `const modelValue = _useModel(__props, "modelValue")`,
+ )
+ expect(content).toMatch(`const count = _useModel(__props, 'count')`)
+ expect(content).toMatch(
+ `const disabled = _useModel(__props, 'disabled')`,
+ )
+ expect(content).toMatch(
+ `const any = _useModel(__props, 'any')`,
)
- expect(content).toMatch(`const count = _useModel(__props, "count")`)
- expect(content).toMatch(`const disabled = _useModel(__props, "disabled")`)
- expect(content).toMatch(`const any = _useModel(__props, "any")`)
expect(bindings).toStrictEqual({
modelValue: BindingTypes.SETUP_REF,
count: BindingTypes.SETUP_REF,
disabled: BindingTypes.SETUP_REF,
- any: BindingTypes.SETUP_REF
+ any: BindingTypes.SETUP_REF,
})
})
@@ -150,30 +134,91 @@ describe('defineModel()', () => {
const optional = defineModel('optional', { required: false })
`,
- { defineModel: true, isProd: true }
+ { isProd: true },
)
assertCode(content)
expect(content).toMatch('"modelValue": { type: Boolean }')
expect(content).toMatch('"fn": {}')
expect(content).toMatch(
- '"fnWithDefault": { type: Function, ...{ default: () => null } },'
+ '"fnWithDefault": { type: Function, ...{ default: () => null } },',
)
expect(content).toMatch('"str": {}')
expect(content).toMatch('"optional": { required: false }')
expect(content).toMatch(
- 'emits: ["update:modelValue", "update:fn", "update:fnWithDefault", "update:str", "update:optional"]'
+ 'emits: ["update:modelValue", "update:fn", "update:fnWithDefault", "update:str", "update:optional"]',
)
expect(content).toMatch(
- `const modelValue = _useModel(__props, "modelValue")`
+ `const modelValue = _useModel(__props, "modelValue")`,
)
- expect(content).toMatch(`const fn = _useModel(__props, "fn")`)
- expect(content).toMatch(`const str = _useModel(__props, "str")`)
+ expect(content).toMatch(`const fn = _useModel<() => void>(__props, 'fn')`)
+ expect(content).toMatch(`const str = _useModel(__props, 'str')`)
expect(bindings).toStrictEqual({
modelValue: BindingTypes.SETUP_REF,
fn: BindingTypes.SETUP_REF,
fnWithDefault: BindingTypes.SETUP_REF,
str: BindingTypes.SETUP_REF,
- optional: BindingTypes.SETUP_REF
+ optional: BindingTypes.SETUP_REF,
})
})
+
+ test('get / set transformers', () => {
+ const { content } = compile(
+ `
+
+ `,
+ )
+ assertCode(content)
+ expect(content).toMatch(/"modelValue": {\s+required: true,?\s+}/m)
+ expect(content).toMatch(
+ `_useModel(__props, "modelValue", {
+ get(v) { return v - 1 },
+ set: (v) => { return v + 1 },
+ })`,
+ )
+
+ const { content: content2 } = compile(
+ `
+
+ `,
+ )
+ assertCode(content2)
+ expect(content2).toMatch(
+ /"modelValue": {\s+default: 0,\s+required: true,?\s+}/m,
+ )
+ expect(content2).toMatch(
+ `_useModel(__props, "modelValue", {
+ get(v) { return v - 1 },
+ set: (v) => { return v + 1 },
+ })`,
+ )
+ })
+
+ test('usage w/ props destructure', () => {
+ const { content } = compile(
+ `
+
+ `,
+ { propsDestructure: true },
+ )
+ assertCode(content)
+ expect(content).toMatch(`set: (v) => { return v + __props.x }`)
+ })
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts
index e4f50be38f7..dac9ef64188 100644
--- a/packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts
@@ -1,4 +1,4 @@
-import { compileSFCScript as compile, assertCode } from '../utils'
+import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineOptions()', () => {
test('basic usage', () => {
@@ -12,7 +12,7 @@ describe('defineOptions()', () => {
expect(content).not.toMatch('defineOptions')
// should include context options in default export
expect(content).toMatch(
- `export default /*#__PURE__*/Object.assign({ name: 'FooApp' }, `
+ `export default /*#__PURE__*/Object.assign({ name: 'FooApp' }, `,
)
})
@@ -35,7 +35,7 @@ describe('defineOptions()', () => {
defineOptions({ name: 'FooApp' })
defineOptions({ name: 'BarApp' })
- `)
+ `),
).toThrowError('[@vue/compiler-sfc] duplicate defineOptions() call')
})
@@ -45,9 +45,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead.'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead.',
)
expect(() =>
@@ -55,9 +55,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare emits. Use defineEmits() instead.'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare emits. Use defineEmits() instead.',
)
expect(() =>
@@ -65,9 +65,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare expose. Use defineExpose() instead.'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare expose. Use defineExpose() instead.',
)
expect(() =>
@@ -75,9 +75,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare slots. Use defineSlots() instead.'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare slots. Use defineSlots() instead.',
)
})
@@ -87,9 +87,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot accept type arguments'
+ '[@vue/compiler-sfc] defineOptions() cannot accept type arguments',
)
})
@@ -99,9 +99,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead.'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead.',
)
})
@@ -111,9 +111,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead',
)
expect(() =>
@@ -121,9 +121,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare emits. Use defineEmits() instead'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare emits. Use defineEmits() instead',
)
expect(() =>
@@ -131,9 +131,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare expose. Use defineExpose() instead'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare expose. Use defineExpose() instead',
)
expect(() =>
@@ -141,9 +141,9 @@ describe('defineOptions()', () => {
- `)
+ `),
).toThrowError(
- '[@vue/compiler-sfc] defineOptions() cannot be used to declare slots. Use defineSlots() instead'
+ '[@vue/compiler-sfc] defineOptions() cannot be used to declare slots. Use defineSlots() instead',
)
})
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts
index 43f54b0aa1e..c139a3d7b73 100644
--- a/packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts
@@ -1,5 +1,5 @@
import { BindingTypes } from '@vue/compiler-core'
-import { compileSFCScript as compile, assertCode } from '../utils'
+import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineProps', () => {
test('basic usage', () => {
@@ -17,7 +17,7 @@ const bar = 1
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
bar: BindingTypes.LITERAL_CONST,
- props: BindingTypes.SETUP_REACTIVE_CONST
+ props: BindingTypes.SETUP_REACTIVE_CONST,
})
// should remove defineOptions import and call
@@ -97,6 +97,7 @@ const props = defineProps({ foo: String })
alias: Alias
method(): void
symbol: symbol
+ error: Error
extract: Extract<1 | 2 | boolean, 2>
exclude: Exclude<1 | 2 | boolean, 2>
uppercase: Uppercase<'foo'>
@@ -143,12 +144,13 @@ const props = defineProps({ foo: String })
expect(content).toMatch(`alias: { type: Array, required: true }`)
expect(content).toMatch(`method: { type: Function, required: true }`)
expect(content).toMatch(`symbol: { type: Symbol, required: true }`)
+ expect(content).toMatch(`error: { type: Error, required: true }`)
expect(content).toMatch(
- `objectOrFn: { type: [Function, Object], required: true },`
+ `objectOrFn: { type: [Function, Object], required: true },`,
)
expect(content).toMatch(`extract: { type: Number, required: true }`)
expect(content).toMatch(
- `exclude: { type: [Number, Boolean], required: true }`
+ `exclude: { type: [Number, Boolean], required: true }`,
)
expect(content).toMatch(`uppercase: { type: String, required: true }`)
expect(content).toMatch(`params: { type: Array, required: true }`)
@@ -156,10 +158,10 @@ const props = defineProps({ foo: String })
expect(content).toMatch(`union: { type: [String, Number], required: true }`)
expect(content).toMatch(`literalUnion: { type: String, required: true }`)
expect(content).toMatch(
- `literalUnionNumber: { type: Number, required: true }`
+ `literalUnionNumber: { type: Number, required: true }`,
)
expect(content).toMatch(
- `literalUnionMixed: { type: [String, Number, Boolean], required: true }`
+ `literalUnionMixed: { type: [String, Number, Boolean], required: true }`,
)
expect(content).toMatch(`intersection: { type: Object, required: true }`)
expect(content).toMatch(`intersection2: { type: String, required: true }`)
@@ -169,13 +171,13 @@ const props = defineProps({ foo: String })
expect(content).toMatch(`unknownUnion: { type: null, required: true }`)
// intersection containing unknown type: narrow to the known types
expect(content).toMatch(
- `unknownIntersection: { type: Object, required: true },`
+ `unknownIntersection: { type: Object, required: true },`,
)
expect(content).toMatch(
- `unknownUnionWithBoolean: { type: Boolean, required: true, skipCheck: true },`
+ `unknownUnionWithBoolean: { type: Boolean, required: true, skipCheck: true },`,
)
expect(content).toMatch(
- `unknownUnionWithFunction: { type: Function, required: true, skipCheck: true }`
+ `unknownUnionWithFunction: { type: Function, required: true, skipCheck: true }`,
)
expect(bindings).toStrictEqual({
string: BindingTypes.PROPS,
@@ -198,6 +200,7 @@ const props = defineProps({ foo: String })
alias: BindingTypes.PROPS,
method: BindingTypes.PROPS,
symbol: BindingTypes.PROPS,
+ error: BindingTypes.PROPS,
objectOrFn: BindingTypes.PROPS,
extract: BindingTypes.PROPS,
exclude: BindingTypes.PROPS,
@@ -215,7 +218,7 @@ const props = defineProps({ foo: String })
unknownUnion: BindingTypes.PROPS,
unknownIntersection: BindingTypes.PROPS,
unknownUnionWithBoolean: BindingTypes.PROPS,
- unknownUnionWithFunction: BindingTypes.PROPS
+ unknownUnionWithFunction: BindingTypes.PROPS,
})
})
@@ -229,7 +232,7 @@ const props = defineProps({ foo: String })
assertCode(content)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
- x: BindingTypes.PROPS
+ x: BindingTypes.PROPS,
})
})
@@ -254,7 +257,7 @@ const props = defineProps({ foo: String })
expect(bindings).toStrictEqual({
x: BindingTypes.PROPS,
y: BindingTypes.PROPS,
- z: BindingTypes.PROPS
+ z: BindingTypes.PROPS,
})
})
@@ -268,7 +271,7 @@ const props = defineProps({ foo: String })
assertCode(content)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
- x: BindingTypes.PROPS
+ x: BindingTypes.PROPS,
})
})
@@ -284,7 +287,7 @@ const props = defineProps({ foo: String })
assertCode(content)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
- x: BindingTypes.PROPS
+ x: BindingTypes.PROPS,
})
})
@@ -298,7 +301,7 @@ const props = defineProps({ foo: String })
assertCode(content)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
- x: BindingTypes.PROPS
+ x: BindingTypes.PROPS,
})
})
@@ -312,7 +315,7 @@ const props = defineProps({ foo: String })
assertCode(content)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
- x: BindingTypes.PROPS
+ x: BindingTypes.PROPS,
})
})
@@ -325,7 +328,7 @@ const props = defineProps({ foo: String })
expect(content).toMatch(`props: ['foo']`)
assertCode(content)
expect(bindings).toStrictEqual({
- foo: BindingTypes.PROPS
+ foo: BindingTypes.PROPS,
})
})
@@ -351,21 +354,21 @@ const props = defineProps({ foo: String })
`)
assertCode(content)
expect(content).toMatch(
- `foo: { type: String, required: false, default: 'hi' }`
+ `foo: { type: String, required: false, default: 'hi' }`,
)
expect(content).toMatch(`bar: { type: Number, required: false }`)
expect(content).toMatch(`baz: { type: Boolean, required: true }`)
expect(content).toMatch(
- `qux: { type: Function, required: false, default() { return 1 } }`
+ `qux: { type: Function, required: false, default() { return 1 } }`,
)
expect(content).toMatch(
- `quux: { type: Function, required: false, default() { } }`
+ `quux: { type: Function, required: false, default() { } }`,
)
expect(content).toMatch(
- `quuxx: { type: Promise, required: false, async default() { return await Promise.resolve('hi') } }`
+ `quuxx: { type: Promise, required: false, async default() { return await Promise.resolve('hi') } }`,
)
expect(content).toMatch(
- `fred: { type: String, required: false, get default() { return 'fred' } }`
+ `fred: { type: String, required: false, get default() { return 'fred' } }`,
)
expect(content).toMatch(`const props = __props`)
expect(bindings).toStrictEqual({
@@ -376,7 +379,7 @@ const props = defineProps({ foo: String })
quux: BindingTypes.PROPS,
quuxx: BindingTypes.PROPS,
fred: BindingTypes.PROPS,
- props: BindingTypes.SETUP_CONST
+ props: BindingTypes.SETUP_CONST,
})
})
@@ -412,7 +415,7 @@ const props = defineProps({ foo: String })
})
`,
- { isProd: true }
+ { isProd: true },
)
assertCode(content)
expect(content).toMatch(`const props = __props`)
@@ -443,7 +446,7 @@ const props = defineProps({ foo: String })
foo: { type: String, required: false },
bar: { type: Number, required: false },
baz: { type: Boolean, required: true }
- }, { ...defaults })`.trim()
+ }, { ...defaults })`.trim(),
)
})
@@ -466,7 +469,7 @@ const props = defineProps({ foo: String })
foo: { type: String, required: false },
bar: { type: Number, required: false },
baz: { type: Boolean, required: true }
- }, defaults)`.trim()
+ }, defaults)`.trim(),
)
})
@@ -484,7 +487,7 @@ const props = defineProps({ foo: String })
}>(), { ...defaults })
`,
- { isProd: true }
+ { isProd: true },
)
assertCode(content)
expect(content).toMatch(`import { mergeDefaults as _mergeDefaults`)
@@ -495,7 +498,7 @@ const props = defineProps({ foo: String })
bar: { type: Boolean },
baz: { type: [Boolean, Function] },
qux: {}
- }, { ...defaults })`.trim()
+ }, { ...defaults })`.trim(),
)
})
@@ -517,7 +520,7 @@ const props = defineProps({ foo: String })
foo: { type: Function, required: false }
}, {
['fo' + 'o']() { return 'foo' }
- })`.trim()
+ })`.trim(),
)
})
@@ -530,8 +533,8 @@ const props = defineProps({ foo: String })
foo: Foo
}>()
`,
- { hoistStatic: true }
- ).content
+ { hoistStatic: true },
+ ).content,
).toMatch(`foo: { type: Number`)
expect(
@@ -542,8 +545,8 @@ const props = defineProps({ foo: String })
foo: Foo
}>()
`,
- { hoistStatic: true }
- ).content
+ { hoistStatic: true },
+ ).content,
).toMatch(`foo: { type: String`)
expect(
@@ -554,8 +557,8 @@ const props = defineProps({ foo: String })
foo: Foo
}>()
`,
- { hoistStatic: true }
- ).content
+ { hoistStatic: true },
+ ).content,
).toMatch(`foo: { type: [String, Number]`)
expect(
@@ -566,8 +569,8 @@ const props = defineProps({ foo: String })
foo: Foo
}>()
`,
- { hoistStatic: true }
- ).content
+ { hoistStatic: true },
+ ).content,
).toMatch(`foo: { type: Number`)
})
@@ -582,7 +585,7 @@ const props = defineProps({ foo: String })
`)
expect(bindings).toStrictEqual({
bar: BindingTypes.SETUP_REF,
- computed: BindingTypes.SETUP_CONST
+ computed: BindingTypes.SETUP_CONST,
})
})
@@ -593,7 +596,7 @@ const props = defineProps({ foo: String })
const { foo } = defineProps<{
foo: Foo
}>()
- `
+ `,
)
expect(content).toMatch(`const { foo } = __props`)
assertCode(content)
@@ -608,4 +611,134 @@ const props = defineProps({ foo: String })
}).toThrow(`cannot accept both type and non-type arguments`)
})
})
+
+ test('should escape names w/ special symbols', () => {
+ const { content, bindings } = compile(`
+ `)
+ assertCode(content)
+ expect(content).toMatch(`"spa ce": { type: null, required: true }`)
+ expect(content).toMatch(
+ `"exclamation!mark": { type: null, required: true }`,
+ )
+ expect(content).toMatch(`"double\\"quote": { type: null, required: true }`)
+ expect(content).toMatch(`"hash#tag": { type: null, required: true }`)
+ expect(content).toMatch(`"dollar$sign": { type: null, required: true }`)
+ expect(content).toMatch(`"percentage%sign": { type: null, required: true }`)
+ expect(content).toMatch(`"amper&sand": { type: null, required: true }`)
+ expect(content).toMatch(`"single'quote": { type: null, required: true }`)
+ expect(content).toMatch(`"round(brack)ets": { type: null, required: true }`)
+ expect(content).toMatch(`"aste*risk": { type: null, required: true }`)
+ expect(content).toMatch(`"pl+us": { type: null, required: true }`)
+ expect(content).toMatch(`"com,ma": { type: null, required: true }`)
+ expect(content).toMatch(`"do.t": { type: null, required: true }`)
+ expect(content).toMatch(`"sla/sh": { type: null, required: true }`)
+ expect(content).toMatch(`"co:lon": { type: null, required: true }`)
+ expect(content).toMatch(`"semi;colon": { type: null, required: true }`)
+ expect(content).toMatch(`"angleets": { type: null, required: true }`)
+ expect(content).toMatch(`"equal=sign": { type: null, required: true }`)
+ expect(content).toMatch(`"question?mark": { type: null, required: true }`)
+ expect(content).toMatch(`"at@sign": { type: null, required: true }`)
+ expect(content).toMatch(
+ `"square[brack]ets": { type: null, required: true }`,
+ )
+ expect(content).toMatch(`"back\\\\slash": { type: null, required: true }`)
+ expect(content).toMatch(`"ca^ret": { type: null, required: true }`)
+ expect(content).toMatch(`"back\`tick": { type: null, required: true }`)
+ expect(content).toMatch(`"curly{bra}ces": { type: null, required: true }`)
+ expect(content).toMatch(`"pi|pe": { type: null, required: true }`)
+ expect(content).toMatch(`"til~de": { type: null, required: true }`)
+ expect(content).toMatch(`"da-sh": { type: null, required: true }`)
+ expect(bindings).toStrictEqual({
+ 'spa ce': BindingTypes.PROPS,
+ 'exclamation!mark': BindingTypes.PROPS,
+ 'double"quote': BindingTypes.PROPS,
+ 'hash#tag': BindingTypes.PROPS,
+ dollar$sign: BindingTypes.PROPS,
+ 'percentage%sign': BindingTypes.PROPS,
+ 'amper&sand': BindingTypes.PROPS,
+ "single'quote": BindingTypes.PROPS,
+ 'round(brack)ets': BindingTypes.PROPS,
+ 'aste*risk': BindingTypes.PROPS,
+ 'pl+us': BindingTypes.PROPS,
+ 'com,ma': BindingTypes.PROPS,
+ 'do.t': BindingTypes.PROPS,
+ 'sla/sh': BindingTypes.PROPS,
+ 'co:lon': BindingTypes.PROPS,
+ 'semi;colon': BindingTypes.PROPS,
+ 'angleets': BindingTypes.PROPS,
+ 'equal=sign': BindingTypes.PROPS,
+ 'question?mark': BindingTypes.PROPS,
+ 'at@sign': BindingTypes.PROPS,
+ 'square[brack]ets': BindingTypes.PROPS,
+ 'back\\slash': BindingTypes.PROPS,
+ 'ca^ret': BindingTypes.PROPS,
+ 'back`tick': BindingTypes.PROPS,
+ 'curly{bra}ces': BindingTypes.PROPS,
+ 'pi|pe': BindingTypes.PROPS,
+ 'til~de': BindingTypes.PROPS,
+ 'da-sh': BindingTypes.PROPS,
+ })
+ })
+
+ // #8989
+ test('custom element retains the props type & production mode', () => {
+ const { content } = compile(
+ ``,
+ { isProd: true, customElement: filename => /\.ce\.vue$/.test(filename) },
+ { filename: 'app.ce.vue' },
+ )
+
+ expect(content).toMatch(`foo: {type: Number}`)
+ assertCode(content)
+ })
+
+ test('custom element retains the props type & default value & production mode', () => {
+ const { content } = compile(
+ ``,
+ { isProd: true, customElement: filename => /\.ce\.vue$/.test(filename) },
+ { filename: 'app.ce.vue' },
+ )
+ expect(content).toMatch(`foo: { default: 5.5, type: Number }`)
+ assertCode(content)
+ })
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts b/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts
index a2941872fd2..3843ef92190 100644
--- a/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts
@@ -1,13 +1,13 @@
import { BindingTypes } from '@vue/compiler-core'
-import { SFCScriptCompileOptions } from '../../src'
-import { compileSFCScript, assertCode } from '../utils'
+import type { SFCScriptCompileOptions } from '../../src'
+import { assertCode, compileSFCScript } from '../utils'
describe('sfc reactive props destructure', () => {
function compile(src: string, options?: Partial) {
return compileSFCScript(src, {
inlineTemplate: true,
propsDestructure: true,
- ...options
+ ...options,
})
}
@@ -24,7 +24,7 @@ describe('sfc reactive props destructure', () => {
expect(content).toMatch(`_toDisplayString(__props.foo)`)
assertCode(content)
expect(bindings).toStrictEqual({
- foo: BindingTypes.PROPS
+ foo: BindingTypes.PROPS,
})
})
@@ -44,7 +44,7 @@ describe('sfc reactive props destructure', () => {
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
bar: BindingTypes.LITERAL_CONST,
- hello: BindingTypes.LITERAL_CONST
+ hello: BindingTypes.LITERAL_CONST,
})
})
@@ -65,7 +65,7 @@ describe('sfc reactive props destructure', () => {
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
bar: BindingTypes.PROPS,
- test: BindingTypes.SETUP_CONST
+ test: BindingTypes.SETUP_CONST,
})
})
@@ -78,7 +78,8 @@ describe('sfc reactive props destructure', () => {
// literals can be used as-is, non-literals are always returned from a
// function
// functions need to be marked with a skip marker
- expect(content).toMatch(`props: _mergeDefaults(['foo', 'bar', 'baz'], {
+ expect(content)
+ .toMatch(`props: /*#__PURE__*/_mergeDefaults(['foo', 'bar', 'baz'], {
foo: 1,
bar: () => ({}),
func: () => {}, __skip_func: true
@@ -98,7 +99,7 @@ describe('sfc reactive props destructure', () => {
// safely infer whether runtime type is Function (e.g. if the runtime decl
// is imported, or spreads another object)
expect(content)
- .toMatch(`props: _mergeDefaults({ foo: Number, bar: Object, func: Function, ext: null }, {
+ .toMatch(`props: /*#__PURE__*/_mergeDefaults({ foo: Number, bar: Object, func: Function, ext: null }, {
foo: 1,
bar: () => ({}),
func: () => {}, __skip_func: true,
@@ -114,15 +115,15 @@ describe('sfc reactive props destructure', () => {
`)
expect(bindings).toStrictEqual({
__propsAliases: {
- fooBar: 'foo:bar'
+ fooBar: 'foo:bar',
},
foo: BindingTypes.PROPS,
'foo:bar': BindingTypes.PROPS,
- fooBar: BindingTypes.PROPS_ALIASED
+ fooBar: BindingTypes.PROPS_ALIASED,
})
expect(content).toMatch(`
- props: _mergeDefaults(['foo', 'foo:bar'], {
+ props: /*#__PURE__*/_mergeDefaults(['foo', 'foo:bar'], {
foo: 1,
"foo:bar": 'foo-bar'
}),`)
@@ -158,13 +159,13 @@ describe('sfc reactive props destructure', () => {
`)
expect(bindings).toStrictEqual({
__propsAliases: {
- fooBar: 'foo:bar'
+ fooBar: 'foo:bar',
},
foo: BindingTypes.PROPS,
bar: BindingTypes.PROPS,
'foo:bar': BindingTypes.PROPS,
fooBar: BindingTypes.PROPS_ALIASED,
- 'onUpdate:modelValue': BindingTypes.PROPS
+ 'onUpdate:modelValue': BindingTypes.PROPS,
})
expect(content).toMatch(`
props: {
@@ -183,7 +184,7 @@ describe('sfc reactive props destructure', () => {
const { foo = 1, bar = {}, func = () => {} } = defineProps<{ foo?: number, bar?: object, baz?: any, boola?: boolean, boolb?: boolean | number, func?: Function }>()
`,
- { isProd: true }
+ { isProd: true },
)
assertCode(content)
// literals can be used as-is, non-literals are always returned from a
@@ -219,8 +220,8 @@ describe('sfc reactive props destructure', () => {
foo: BindingTypes.PROPS,
bar: BindingTypes.PROPS_ALIASED,
__propsAliases: {
- bar: 'foo'
- }
+ bar: 'foo',
+ },
})
})
@@ -241,8 +242,8 @@ describe('sfc reactive props destructure', () => {
'foo.bar': BindingTypes.PROPS,
fooBar: BindingTypes.PROPS_ALIASED,
__propsAliases: {
- fooBar: 'foo.bar'
- }
+ fooBar: 'foo.bar',
+ },
})
})
@@ -253,14 +254,14 @@ describe('sfc reactive props destructure', () => {
`)
expect(content).toMatch(
- `const rest = _createPropsRestProxy(__props, ["foo","bar"])`
+ `const rest = _createPropsRestProxy(__props, ["foo","bar"])`,
)
assertCode(content)
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
bar: BindingTypes.PROPS,
baz: BindingTypes.PROPS,
- rest: BindingTypes.SETUP_REACTIVE_CONST
+ rest: BindingTypes.SETUP_REACTIVE_CONST,
})
})
@@ -278,30 +279,82 @@ describe('sfc reactive props destructure', () => {
expect(content).toMatch(`_toDisplayString(__props.foo)`)
assertCode(content)
expect(bindings).toStrictEqual({
- foo: BindingTypes.PROPS
+ foo: BindingTypes.PROPS,
})
})
+ test('multi-variable declaration', () => {
+ const { content } = compile(`
+
+ `)
+ assertCode(content)
+ expect(content).toMatch(`const a = 1;`)
+ expect(content).toMatch(`props: ['item'],`)
+ })
+
+ // #6757
+ test('multi-variable declaration fix #6757 ', () => {
+ const { content } = compile(`
+
+ `)
+ assertCode(content)
+ expect(content).toMatch(`const a = 1;`)
+ expect(content).toMatch(`props: ['item'],`)
+ })
+
+ // #7422
+ test('multi-variable declaration fix #7422', () => {
+ const { content } = compile(`
+
+ `)
+ assertCode(content)
+ expect(content).toMatch(`const a = 0,`)
+ expect(content).toMatch(`b = 0;`)
+ expect(content).toMatch(`props: ['item'],`)
+ })
+
+ test('defineProps/defineEmits in multi-variable declaration (full removal)', () => {
+ const { content } = compile(`
+
+ `)
+ assertCode(content)
+ expect(content).toMatch(`props: ['item'],`)
+ expect(content).toMatch(`emits: ['a'],`)
+ })
+
describe('errors', () => {
test('should error on deep destructure', () => {
expect(() =>
compile(
- ``
- )
+ ``,
+ ),
).toThrow(`destructure does not support nested patterns`)
expect(() =>
compile(
- ``
- )
+ ``,
+ ),
).toThrow(`destructure does not support nested patterns`)
})
test('should error on computed key', () => {
expect(() =>
compile(
- ``
- )
+ ``,
+ ),
).toThrow(`destructure cannot use computed key`)
})
@@ -310,8 +363,8 @@ describe('sfc reactive props destructure', () => {
compile(
``
- )
+ `,
+ ),
).toThrow(`withDefaults() is unnecessary when using destructure`)
})
@@ -323,8 +376,8 @@ describe('sfc reactive props destructure', () => {
const {
foo = () => x
} = defineProps(['foo'])
- `
- )
+ `,
+ ),
).toThrow(`cannot reference locally declared variables`)
})
@@ -334,8 +387,8 @@ describe('sfc reactive props destructure', () => {
``
- )
+ `,
+ ),
).toThrow(`Cannot assign to destructured props`)
expect(() =>
@@ -343,8 +396,8 @@ describe('sfc reactive props destructure', () => {
``
- )
+ `,
+ ),
).toThrow(`Cannot assign to destructured props`)
})
@@ -355,10 +408,10 @@ describe('sfc reactive props destructure', () => {
import { watch } from 'vue'
const { foo } = defineProps(['foo'])
watch(foo, () => {})
- `
- )
+ `,
+ ),
).toThrow(
- `"foo" is a destructured prop and should not be passed directly to watch().`
+ `"foo" is a destructured prop and should not be passed directly to watch().`,
)
expect(() =>
@@ -367,10 +420,10 @@ describe('sfc reactive props destructure', () => {
import { watch as w } from 'vue'
const { foo } = defineProps(['foo'])
w(foo, () => {})
- `
- )
+ `,
+ ),
).toThrow(
- `"foo" is a destructured prop and should not be passed directly to watch().`
+ `"foo" is a destructured prop and should not be passed directly to watch().`,
)
expect(() =>
@@ -379,10 +432,10 @@ describe('sfc reactive props destructure', () => {
import { toRef } from 'vue'
const { foo } = defineProps(['foo'])
toRef(foo)
- `
- )
+ `,
+ ),
).toThrow(
- `"foo" is a destructured prop and should not be passed directly to toRef().`
+ `"foo" is a destructured prop and should not be passed directly to toRef().`,
)
expect(() =>
@@ -391,10 +444,10 @@ describe('sfc reactive props destructure', () => {
import { toRef as r } from 'vue'
const { foo } = defineProps(['foo'])
r(foo)
- `
- )
+ `,
+ ),
).toThrow(
- `"foo" is a destructured prop and should not be passed directly to toRef().`
+ `"foo" is a destructured prop and should not be passed directly to toRef().`,
)
})
@@ -404,8 +457,8 @@ describe('sfc reactive props destructure', () => {
compile(
``
- )
+ `,
+ ),
).toThrow(`Default value of prop "foo" does not match declared type.`)
})
@@ -419,8 +472,8 @@ describe('sfc reactive props destructure', () => {
const { error: e, info } = useRequest();
watch(e, () => {});
watch(info, () => {});
- `
- )
+ `,
+ ),
).not.toThrowError()
})
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts
index c7becacc02a..357709afdf3 100644
--- a/packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/defineSlots.spec.ts
@@ -1,4 +1,4 @@
-import { compileSFCScript as compile, assertCode } from '../utils'
+import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineSlots()', () => {
test('basic usage', () => {
diff --git a/packages/compiler-sfc/__tests__/compileScript/hoistStatic.spec.ts b/packages/compiler-sfc/__tests__/compileScript/hoistStatic.spec.ts
index d2c76c9a2cc..ce6191777cc 100644
--- a/packages/compiler-sfc/__tests__/compileScript/hoistStatic.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/hoistStatic.spec.ts
@@ -1,13 +1,13 @@
import { BindingTypes } from '@vue/compiler-core'
-import { SFCScriptCompileOptions } from '../../src'
-import { compileSFCScript, assertCode } from '../utils'
+import type { SFCScriptCompileOptions } from '../../src'
+import { assertCode, compileSFCScript } from '../utils'
describe('sfc hoist static', () => {
function compile(src: string, options?: Partial) {
return compileSFCScript(src, {
inlineTemplate: true,
hoistStatic: true,
- ...options
+ ...options,
})
}
@@ -34,7 +34,7 @@ describe('sfc hoist static', () => {
boolean: BindingTypes.LITERAL_CONST,
nil: BindingTypes.LITERAL_CONST,
bigint: BindingTypes.LITERAL_CONST,
- template: BindingTypes.LITERAL_CONST
+ template: BindingTypes.LITERAL_CONST,
})
assertCode(content)
})
@@ -57,7 +57,7 @@ describe('sfc hoist static', () => {
binary: BindingTypes.LITERAL_CONST,
conditional: BindingTypes.LITERAL_CONST,
unary: BindingTypes.LITERAL_CONST,
- sequence: BindingTypes.LITERAL_CONST
+ sequence: BindingTypes.LITERAL_CONST,
})
assertCode(content)
})
@@ -79,7 +79,7 @@ describe('sfc hoist static', () => {
expect(content.startsWith(hoistCode)).toBe(true)
expect(bindings).toStrictEqual({
foo: BindingTypes.PROPS,
- defaultValue: BindingTypes.LITERAL_CONST
+ defaultValue: BindingTypes.LITERAL_CONST,
})
assertCode(content)
})
@@ -100,7 +100,7 @@ describe('sfc hoist static', () => {
KEY1: BindingTypes.SETUP_LET,
KEY2: BindingTypes.SETUP_LET,
regex: BindingTypes.SETUP_CONST,
- undef: BindingTypes.SETUP_MAYBE_REF
+ undef: BindingTypes.SETUP_MAYBE_REF,
})
expect(content).toMatch(`setup(__props) {\n\n ${code}`)
assertCode(content)
@@ -131,7 +131,7 @@ describe('sfc hoist static', () => {
KEY4: BindingTypes.SETUP_CONST,
KEY5: BindingTypes.SETUP_CONST,
KEY6: BindingTypes.SETUP_CONST,
- i: BindingTypes.SETUP_LET
+ i: BindingTypes.SETUP_LET,
})
expect(content).toMatch(`setup(__props) {\n\n ${code}`)
assertCode(content)
@@ -149,7 +149,7 @@ describe('sfc hoist static', () => {
`)
expect(bindings).toStrictEqual({
arr: BindingTypes.SETUP_CONST,
- obj: BindingTypes.SETUP_CONST
+ obj: BindingTypes.SETUP_CONST,
})
expect(content).toMatch(`setup(__props) {\n\n ${code}`)
assertCode(content)
@@ -169,7 +169,7 @@ describe('sfc hoist static', () => {
expect(bindings).toStrictEqual({
Foo: BindingTypes.SETUP_CONST,
fn: BindingTypes.SETUP_CONST,
- fn2: BindingTypes.SETUP_CONST
+ fn2: BindingTypes.SETUP_CONST,
})
expect(content).toMatch(`setup(__props) {\n\n ${code}`)
assertCode(content)
@@ -185,7 +185,7 @@ describe('sfc hoist static', () => {
`)
expect(bindings).toStrictEqual({
- foo: BindingTypes.SETUP_CONST
+ foo: BindingTypes.SETUP_CONST,
})
assertCode(content)
})
@@ -197,10 +197,10 @@ describe('sfc hoist static', () => {
const foo = 'bar'
`,
- { hoistStatic: false }
+ { hoistStatic: false },
)
expect(bindings).toStrictEqual({
- foo: BindingTypes.SETUP_CONST
+ foo: BindingTypes.SETUP_CONST,
})
assertCode(content)
})
@@ -212,7 +212,7 @@ describe('sfc hoist static', () => {
const foo = 'bar'
{{ foo }}
- `
+ `,
)
expect(content).toMatch('_toDisplayString(foo)')
})
diff --git a/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts b/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts
new file mode 100644
index 00000000000..d9fd1dfe529
--- /dev/null
+++ b/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts
@@ -0,0 +1,235 @@
+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('components', () => {
+ const { content } = compile(`
+
+
+
+
+
+ FooBar
+
+ `)
+ // FooBar: should not be matched by plain text or incorrect case
+ // FooBaz: used as PascalCase component
+ // FooQux: used as kebab-case component
+ // foo: lowercase component
+ expect(content).toMatch(
+ `return { fooBar, get FooBaz() { return FooBaz }, ` +
+ `get FooQux() { return FooQux }, get foo() { return foo } }`,
+ )
+ assertCode(content)
+})
+
+test('directive', () => {
+ const { content } = compile(`
+
+
+
+
+ `)
+ expect(content).toMatch(`return { get vMyDir() { return vMyDir } }`)
+ assertCode(content)
+})
+
+test('dynamic arguments', () => {
+ const { content } = compile(`
+
+
+
+
+
+
+
+
+ `)
+ expect(content).toMatch(
+ `return { get FooBar() { return FooBar }, get foo() { return foo }, ` +
+ `get bar() { return bar }, get baz() { return baz } }`,
+ )
+ assertCode(content)
+})
+
+// https://github.com/vuejs/core/issues/4599
+test('attribute expressions', () => {
+ const { content } = compile(`
+
+
+
+
+ `)
+ expect(content).toMatch(
+ `return { cond, get bar() { return bar }, get baz() { return baz } }`,
+ )
+ assertCode(content)
+})
+
+test('vue interpolations', () => {
+ const { content } = compile(`
+
+
+ {{ x }} {{ yy }} {{ x$y }}
+
+ `)
+ // x: used in interpolation
+ // y: should not be matched by {{ yy }} or 'y' in binding exps
+ // x$y: #4274 should escape special chars when creating Regex
+ expect(content).toMatch(
+ `return { get x() { return x }, get z() { return z }, get x$y() { return x$y } }`,
+ )
+ assertCode(content)
+})
+
+// #4340 interpolations in template strings
+test('js template string interpolations', () => {
+ const { content } = compile(`
+
+
+ {{ \`\${VAR}VAR2\${VAR3}\` }}
+
+ `)
+ // VAR2 should not be matched
+ expect(content).toMatch(
+ `return { get VAR() { return VAR }, get VAR3() { return VAR3 } }`,
+ )
+ assertCode(content)
+})
+
+// edge case: last tag in template
+test('last tag', () => {
+ const { content } = compile(`
+
+
+
+
+
+ `)
+ expect(content).toMatch(
+ `return { get FooBaz() { return FooBaz }, get Last() { return Last } }`,
+ )
+ assertCode(content)
+})
+
+test('TS annotations', () => {
+ const { content } = compile(`
+
+
+ {{ a as Foo }}
+ {{ b() }}
+ {{ Baz }}
+ {{ data }}
+
+
+ `)
+ expect(content).toMatch(`return { a, b, get Baz() { return Baz } }`)
+ assertCode(content)
+})
+
+// vuejs/vue#12591
+test('v-on inline statement', () => {
+ // should not error
+ compile(`
+
+
+
+
+ `)
+})
+
+test('template ref', () => {
+ const { content } = compile(`
+
+
+
+
+
+
+ `)
+ expect(content).toMatch(
+ 'return { get foo() { return foo }, get bar() { return bar }, get Baz() { return Baz } }',
+ )
+ assertCode(content)
+})
+
+// https://github.com/nuxt/nuxt/issues/22416
+test('property access', () => {
+ const { content } = compile(`
+
+
+ {{ Foo.Bar.Baz }}
+
+ `)
+ expect(content).toMatch('return { get Foo() { return Foo } }')
+ assertCode(content)
+})
+
+test('spread operator', () => {
+ const { content } = compile(`
+
+
+
+
+ `)
+ expect(content).toMatch('return { get Foo() { return Foo } }')
+ assertCode(content)
+})
+
+test('property access (whitespace)', () => {
+ const { content } = compile(`
+
+
+ {{ Foo . Bar . Baz }}
+
+ `)
+ expect(content).toMatch('return { get Foo() { return Foo } }')
+ assertCode(content)
+})
+
+// #9974
+test('namespace / dot component usage', () => {
+ const { content } = compile(`
+
+
+
+
+ `)
+ expect(content).toMatch('return { get Foo() { return Foo } }')
+ assertCode(content)
+})
diff --git a/packages/compiler-sfc/__tests__/compileScript/reactivityTransform.spec.ts b/packages/compiler-sfc/__tests__/compileScript/reactivityTransform.spec.ts
deleted file mode 100644
index 44d51c14e75..00000000000
--- a/packages/compiler-sfc/__tests__/compileScript/reactivityTransform.spec.ts
+++ /dev/null
@@ -1,193 +0,0 @@
-// TODO remove in 3.4
-import { BindingTypes } from '@vue/compiler-core'
-import { compileSFCScript as compile, assertCode } from '../utils'
-
-// this file only tests integration with SFC - main test case for the ref
-// transform can be found in /packages/reactivity-transform/__tests__
-describe('sfc ref transform', () => {
- function compileWithReactivityTransform(src: string) {
- return compile(src, { reactivityTransform: true })
- }
-
- test('$ unwrapping', () => {
- const { content, bindings } = compileWithReactivityTransform(``)
- expect(content).not.toMatch(`$(ref())`)
- expect(content).not.toMatch(`$(ref(1))`)
- expect(content).not.toMatch(`$(shallowRef({`)
- expect(content).toMatch(`let foo = (ref())`)
- expect(content).toMatch(`let a = (ref(1))`)
- expect(content).toMatch(`
- let b = (shallowRef({
- count: 0
- }))
- `)
- // normal declarations left untouched
- expect(content).toMatch(`let c = () => {}`)
- expect(content).toMatch(`let d`)
- expect(content).toMatch(
- `return { foo, a, b, get c() { return c }, set c(v) { c = v }, ` +
- `get d() { return d }, set d(v) { d = v }, ref, shallowRef }`
- )
- assertCode(content)
- expect(bindings).toStrictEqual({
- foo: BindingTypes.SETUP_REF,
- a: BindingTypes.SETUP_REF,
- b: BindingTypes.SETUP_REF,
- c: BindingTypes.SETUP_LET,
- d: BindingTypes.SETUP_LET,
- ref: BindingTypes.SETUP_CONST,
- shallowRef: BindingTypes.SETUP_CONST
- })
- })
-
- test('$ref & $shallowRef declarations', () => {
- const { content, bindings } = compileWithReactivityTransform(``)
- expect(content).toMatch(
- `import { ref as _ref, shallowRef as _shallowRef } from 'vue'`
- )
- expect(content).not.toMatch(`$ref()`)
- expect(content).not.toMatch(`$ref(1)`)
- expect(content).not.toMatch(`$shallowRef({`)
- expect(content).toMatch(`let foo = _ref()`)
- expect(content).toMatch(`let a = _ref(1)`)
- expect(content).toMatch(`
- let b = _shallowRef({
- count: 0
- })
- `)
- // normal declarations left untouched
- expect(content).toMatch(`let c = () => {}`)
- expect(content).toMatch(`let d`)
- assertCode(content)
- expect(bindings).toStrictEqual({
- foo: BindingTypes.SETUP_REF,
- a: BindingTypes.SETUP_REF,
- b: BindingTypes.SETUP_REF,
- c: BindingTypes.SETUP_LET,
- d: BindingTypes.SETUP_LET
- })
- })
-
- test('usage in normal `)
- expect(content).not.toMatch(`$ref(0)`)
- expect(content).toMatch(`import { ref as _ref } from 'vue'`)
- expect(content).toMatch(`let count = _ref(0)`)
- expect(content).toMatch(`count.value++`)
- expect(content).toMatch(`return ({ count })`)
- assertCode(content)
- })
-
- test('usage /w typescript', () => {
- const { content } = compileWithReactivityTransform(`
-
- `)
- expect(content).toMatch(`import { ref as _ref`)
- expect(content).toMatch(`let msg = _ref('foo')`)
- expect(content).toMatch(`let bar = _ref ('bar')`)
- assertCode(content)
- })
-
- test('usage with normal
- `)
- // should dedupe helper imports
- expect(content).toMatch(`import { ref as _ref } from 'vue'`)
-
- expect(content).toMatch(`let a = _ref(0)`)
- expect(content).toMatch(`let b = _ref(0)`)
-
- // root level ref binding declared in
-
- `)
- expect(content).toMatch(`console.log(data.value)`)
- assertCode(content)
- })
-
- describe('errors', () => {
- test('defineProps/Emit() referencing ref declarations', () => {
- expect(() =>
- compile(
- ``,
- { reactivityTransform: true }
- )
- ).toThrow(`cannot reference locally declared variables`)
-
- expect(() =>
- compile(
- ``,
- { reactivityTransform: true }
- )
- ).toThrow(`cannot reference locally declared variables`)
- })
- })
-})
diff --git a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
index f671541977b..0c5c95cd17f 100644
--- a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
@@ -1,16 +1,17 @@
-import { Identifier } from '@babel/types'
-import { SFCScriptCompileOptions, parse } from '../../src'
+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,
- registerTS
} from '../../src/script/resolveType'
import ts from 'typescript'
-registerTS(ts)
+registerTS(() => ts)
describe('resolveType', () => {
test('type literal', () => {
@@ -24,7 +25,7 @@ describe('resolveType', () => {
expect(props).toStrictEqual({
foo: ['Number'],
bar: ['Function'],
- baz: ['String']
+ baz: ['String'],
})
expect(calls?.length).toBe(2)
})
@@ -34,9 +35,9 @@ describe('resolveType', () => {
resolve(`
type Aliased = { foo: number }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -45,9 +46,9 @@ describe('resolveType', () => {
resolve(`
export type Aliased = { foo: number }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -56,9 +57,9 @@ describe('resolveType', () => {
resolve(`
interface Aliased { foo: number }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -67,9 +68,9 @@ describe('resolveType', () => {
resolve(`
export interface Aliased { foo: number }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -81,12 +82,12 @@ describe('resolveType', () => {
interface C { c: string }
interface Aliased extends B, C { foo: number }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
a: ['Function'],
b: ['Boolean'],
c: ['String'],
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -95,9 +96,9 @@ describe('resolveType', () => {
resolve(`
class Foo {}
defineProps<{ foo: Foo }>()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Object']
+ foo: ['Object'],
})
})
@@ -105,7 +106,7 @@ describe('resolveType', () => {
expect(
resolve(`
defineProps<(e: 'foo') => void>()
- `).calls?.length
+ `).calls?.length,
).toBe(1)
})
@@ -114,7 +115,7 @@ describe('resolveType', () => {
resolve(`
type Fn = (e: 'foo') => void
defineProps()
- `).calls?.length
+ `).calls?.length,
).toBe(1)
})
@@ -125,13 +126,13 @@ describe('resolveType', () => {
type Bar = { bar: string }
type Baz = { bar: string | boolean }
defineProps<{ self: any } & Foo & Bar & Baz>()
- `).props
+ `).props,
).toStrictEqual({
self: ['Unknown'],
foo: ['Number'],
// both Bar & Baz has 'bar', but Baz['bar] is wider so it should be
// preferred
- bar: ['String', 'Boolean']
+ bar: ['String', 'Boolean'],
})
})
@@ -155,12 +156,12 @@ describe('resolveType', () => {
}
defineProps()
- `).props
+ `).props,
).toStrictEqual({
size: ['String'],
color: ['String', 'Number'],
appearance: ['String'],
- note: ['String']
+ note: ['String'],
})
})
@@ -172,12 +173,12 @@ describe('resolveType', () => {
defineProps<{
[\`_\${T}_\${S}_\`]: string
}>()
- `).props
+ `).props,
).toStrictEqual({
_foo_x_: ['String'],
_foo_y_: ['String'],
_bar_x_: ['String'],
- _bar_y_: ['String']
+ _bar_y_: ['String'],
})
})
@@ -194,7 +195,7 @@ describe('resolveType', () => {
} & {
[K in \`x\${T}\`]: string
}>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String', 'Number'],
bar: ['String', 'Number'],
@@ -203,7 +204,7 @@ describe('resolveType', () => {
FOO: ['String'],
xfoo: ['String'],
xbar: ['String'],
- optional: ['Boolean']
+ optional: ['Boolean'],
})
})
@@ -212,14 +213,14 @@ describe('resolveType', () => {
resolve(`
type T = { foo: number, bar: string }
defineProps>()
- `).raw.props
+ `).raw.props,
).toMatchObject({
foo: {
- optional: true
+ optional: true,
},
bar: {
- optional: true
- }
+ optional: true,
+ },
})
})
@@ -228,14 +229,14 @@ describe('resolveType', () => {
resolve(`
type T = { foo?: number, bar?: string }
defineProps>()
- `).raw.props
+ `).raw.props,
).toMatchObject({
foo: {
- optional: false
+ optional: false,
},
bar: {
- optional: false
- }
+ optional: false,
+ },
})
})
@@ -245,10 +246,10 @@ describe('resolveType', () => {
type T = { foo: number, bar: string, baz: boolean }
type K = 'foo' | 'bar'
defineProps>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['Number'],
- bar: ['String']
+ bar: ['String'],
})
})
@@ -258,9 +259,9 @@ describe('resolveType', () => {
type T = { foo: number, bar: string, baz: boolean }
type K = 'foo' | 'bar'
defineProps>()
- `).props
+ `).props,
).toStrictEqual({
- baz: ['Boolean']
+ baz: ['Boolean'],
})
})
@@ -270,9 +271,9 @@ describe('resolveType', () => {
type T = { bar: number }
type S = { nested: { foo: T['bar'] }}
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -283,10 +284,10 @@ describe('resolveType', () => {
type T = { foo: string, bar: number }
type S = { foo: { foo: T[string] }, bar: { bar: string } }
defineProps()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String', 'Number'],
- bar: ['String']
+ bar: ['String'],
})
})
@@ -298,12 +299,12 @@ describe('resolveType', () => {
type T = [1, 'foo']
type TT = [foo: 1, bar: 'foo']
defineProps<{ foo: A[number], bar: AA[number], tuple: T[number], namedTuple: TT[number] }>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String', 'Number'],
bar: ['String'],
tuple: ['Number', 'String'],
- namedTuple: ['Number', 'String']
+ namedTuple: ['Number', 'String'],
})
})
@@ -320,9 +321,9 @@ describe('resolveType', () => {
}
}
defineProps()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number']
+ foo: ['Number'],
})
})
@@ -339,10 +340,10 @@ describe('resolveType', () => {
foo: Foo['a'],
bar: Foo['b']
}>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String'],
- bar: ['Number']
+ bar: ['Number'],
})
})
@@ -359,10 +360,10 @@ describe('resolveType', () => {
foo: Foo.A,
bar: Foo.B
}>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String'],
- bar: ['Number']
+ bar: ['Number'],
})
})
@@ -379,10 +380,10 @@ describe('resolveType', () => {
foo: Foo.A,
bar: Foo['b']
}>()
- `).props
+ `).props,
).toStrictEqual({
foo: ['String'],
- bar: ['Number']
+ bar: ['Number'],
})
})
@@ -398,9 +399,9 @@ describe('resolveType', () => {
defineProps<{
foo: Foo
}>()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['Number', 'String']
+ foo: ['Number', 'String'],
})
})
@@ -409,9 +410,9 @@ describe('resolveType', () => {
resolve(`
declare const a: string
defineProps<{ foo: typeof a }>()
- `).props
+ `).props,
).toStrictEqual({
- foo: ['String']
+ foo: ['String'],
})
})
@@ -428,11 +429,11 @@ describe('resolveType', () => {
}
type Props = ExtractPropTypes
defineProps()
- `
+ `,
)
expect(props).toStrictEqual({
foo: ['String'],
- bar: ['Boolean']
+ bar: ['Boolean'],
})
expect(raw.props.bar.optional).toBe(false)
})
@@ -446,11 +447,93 @@ describe('resolveType', () => {
}
type Props = Partial>>
defineProps()
- `
+ `,
)
expect(props).toStrictEqual({
foo: ['String'],
- bar: ['Boolean']
+ bar: ['Boolean'],
+ })
+ })
+
+ describe('generics', () => {
+ test('generic with type literal', () => {
+ expect(
+ resolve(`
+ type Props = T
+ defineProps>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['String'],
+ })
+ })
+
+ test('generic used in intersection', () => {
+ expect(
+ resolve(`
+ type Foo = { foo: string; }
+ type Bar = { bar: number; }
+ type Props = T & U & { baz: boolean }
+ defineProps>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['String'],
+ bar: ['Number'],
+ baz: ['Boolean'],
+ })
+ })
+
+ test('generic type /w generic type alias', () => {
+ expect(
+ resolve(`
+ type Aliased = Readonly>
+ type Props = Aliased
+ type Foo = { foo: string; }
+ defineProps>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['String'],
+ })
+ })
+
+ test('generic type /w aliased type literal', () => {
+ expect(
+ resolve(`
+ type Aliased = { foo: T }
+ defineProps>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['String'],
+ })
+ })
+
+ test('generic type /w interface', () => {
+ expect(
+ resolve(`
+ interface Props {
+ foo: T
+ }
+ type Foo = string
+ defineProps>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['String'],
+ })
+ })
+
+ test('generic from external-file', () => {
+ const files = {
+ '/foo.ts': 'export type P = { foo: T }',
+ }
+ const { props } = resolve(
+ `
+ import { P } from './foo'
+ defineProps>()
+ `,
+ files,
+ )
+ expect(props).toStrictEqual({
+ foo: ['String'],
+ })
})
})
@@ -461,7 +544,7 @@ describe('resolveType', () => {
'/bar.d.ts':
'type X = { bar: string }; export { X as Y };' +
// verify that we can parse syntax that is only valid in d.ts
- 'export const baz: boolean'
+ 'export const baz: boolean',
}
const { props, deps } = resolve(
`
@@ -469,29 +552,59 @@ describe('resolveType', () => {
import { Y as PP } from './bar'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['Number'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
+ test.runIf(process.platform === 'win32')('relative ts on Windows', () => {
+ const files = {
+ 'C:\\Test\\FolderA\\foo.ts': 'export type P = { foo: number }',
+ 'C:\\Test\\FolderA\\bar.d.ts':
+ 'type X = { bar: string }; export { X as Y };' +
+ // verify that we can parse syntax that is only valid in d.ts
+ 'export const baz: boolean',
+ 'C:\\Test\\FolderB\\buz.ts': 'export type Z = { buz: string }',
+ }
+ const { props, deps } = resolve(
+ `
+ import { P } from './foo'
+ import { Y as PP } from './bar'
+ import { Z as PPP } from '../FolderB/buz'
+ defineProps
()
+ `,
+ files,
+ {},
+ 'C:\\Test\\FolderA\\Test.vue',
+ )
+ expect(props).toStrictEqual({
+ foo: ['Number'],
+ bar: ['String'],
+ buz: ['String'],
+ })
+ expect(deps && [...deps].map(normalize)).toStrictEqual(
+ Object.keys(files).map(normalize),
+ )
+ })
+
// #8244
test('utility type in external file', () => {
const files = {
- '/foo.ts': 'type A = { n?: number }; export type B = Required'
+ '/foo.ts': 'type A = { n?: number }; export type B = Required ',
}
const { props } = resolve(
`
import { B } from './foo'
defineProps()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- n: ['Number']
+ n: ['Number'],
})
})
@@ -500,7 +613,7 @@ describe('resolveType', () => {
'/foo.vue':
'',
'/bar.vue':
- ''
+ '',
}
const { props, deps } = resolve(
`
@@ -508,11 +621,11 @@ describe('resolveType', () => {
import { P as PP } from './bar.vue'
defineProps ()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['Number'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -522,18 +635,18 @@ describe('resolveType', () => {
'/foo.ts': `import type { P as PP } from './nested/bar.vue'
export type P = { foo: number } & PP`,
'/nested/bar.vue':
- ''
+ '',
}
const { props, deps } = resolve(
`
import { P } from './foo'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['Number'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -541,17 +654,17 @@ describe('resolveType', () => {
test('relative (chained, re-export)', () => {
const files = {
'/foo.ts': `export { P as PP } from './bar'`,
- '/bar.ts': 'export type P = { bar: string }'
+ '/bar.ts': 'export type P = { bar: string }',
}
const { props, deps } = resolve(
`
import { PP as P } from './foo'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -559,17 +672,17 @@ describe('resolveType', () => {
test('relative (chained, export *)', () => {
const files = {
'/foo.ts': `export * from './bar'`,
- '/bar.ts': 'export type P = { bar: string }'
+ '/bar.ts': 'export type P = { bar: string }',
}
const { props, deps } = resolve(
`
import { P } from './foo'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -577,7 +690,7 @@ describe('resolveType', () => {
test('relative (default export)', () => {
const files = {
'/foo.ts': `export default interface P { foo: string }`,
- '/bar.ts': `type X = { bar: string }; export default X`
+ '/bar.ts': `type X = { bar: string }; export default X`,
}
const { props, deps } = resolve(
`
@@ -585,11 +698,11 @@ describe('resolveType', () => {
import X from './bar'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['String'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -598,7 +711,7 @@ describe('resolveType', () => {
const files = {
'/bar.ts': `export { default } from './foo'`,
'/foo.ts': `export default interface P { foo: string }; export interface PP { bar: number }`,
- '/baz.ts': `export { PP as default } from './foo'`
+ '/baz.ts': `export { PP as default } from './foo'`,
}
const { props, deps } = resolve(
`
@@ -606,29 +719,48 @@ describe('resolveType', () => {
import PP from './baz'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['String'],
- bar: ['Number']
+ bar: ['Number'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
+ test('relative (re-export /w same source type name)', () => {
+ const files = {
+ '/foo.ts': `export default interface P { foo: string }`,
+ '/bar.ts': `export default interface PP { bar: number }`,
+ '/baz.ts': `export { default as X } from './foo'; export { default as XX } from './bar'; `,
+ }
+ const { props, deps } = resolve(
+ `import { X, XX } from './baz'
+ defineProps()
+ `,
+ files,
+ )
+ expect(props).toStrictEqual({
+ foo: ['String'],
+ bar: ['Number'],
+ })
+ expect(deps && [...deps]).toStrictEqual(['/baz.ts', '/foo.ts', '/bar.ts'])
+ })
+
test('relative (dynamic import)', () => {
const files = {
'/foo.ts': `export type P = { foo: string, bar: import('./bar').N }`,
- '/bar.ts': 'export type N = number'
+ '/bar.ts': 'export type N = number',
}
const { props, deps } = resolve(
`
defineProps()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['String'],
- bar: ['Number']
+ bar: ['Number'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -638,17 +770,17 @@ describe('resolveType', () => {
const files = {
'/foo.d.ts':
'import { PP } from "./bar.js"; export type P = { foo: PP }',
- '/bar.d.ts': 'export type PP = "foo" | "bar"'
+ '/bar.d.ts': 'export type PP = "foo" | "bar"',
}
const { props, deps } = resolve(
`
import { P } from './foo'
defineProps()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- foo: ['String']
+ foo: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -656,17 +788,17 @@ describe('resolveType', () => {
test('ts module resolve', () => {
const files = {
'/node_modules/foo/package.json': JSON.stringify({
- types: 'index.d.ts'
+ types: 'index.d.ts',
}),
'/node_modules/foo/index.d.ts': 'export type P = { foo: number }',
'/tsconfig.json': JSON.stringify({
compilerOptions: {
paths: {
- bar: ['./pp.ts']
- }
- }
+ bar: ['./pp.ts'],
+ },
+ },
}),
- '/pp.ts': 'export type PP = { bar: string }'
+ '/pp.ts': 'export type PP = { bar: string }',
}
const { props, deps } = resolve(
@@ -675,16 +807,16 @@ describe('resolveType', () => {
import { PP } from 'bar'
defineProps
()
`,
- files
+ files,
)
expect(props).toStrictEqual({
foo: ['Number'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual([
'/node_modules/foo/index.d.ts',
- '/pp.ts'
+ '/pp.ts',
])
})
@@ -693,23 +825,23 @@ describe('resolveType', () => {
'/tsconfig.json': JSON.stringify({
references: [
{
- path: './tsconfig.app.json'
- }
- ]
+ path: './tsconfig.app.json',
+ },
+ ],
}),
'/tsconfig.app.json': JSON.stringify({
include: ['**/*.ts', '**/*.vue'],
- extends: './tsconfig.web.json'
+ extends: './tsconfig.web.json',
}),
'/tsconfig.web.json': JSON.stringify({
compilerOptions: {
composite: true,
paths: {
- bar: ['./user.ts']
- }
- }
+ bar: ['./user.ts'],
+ },
+ },
}),
- '/user.ts': 'export type User = { bar: string }'
+ '/user.ts': 'export type User = { bar: string }',
}
const { props, deps } = resolve(
@@ -717,11 +849,11 @@ describe('resolveType', () => {
import { User } from 'bar'
defineProps()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(['/user.ts'])
})
@@ -732,12 +864,12 @@ describe('resolveType', () => {
compilerOptions: {
include: ['**/*.ts', '**/*.vue'],
paths: {
- '@/*': ['./src/*']
- }
- }
+ '@/*': ['./src/*'],
+ },
+ },
}),
'/src/Foo.vue':
- ''
+ '',
}
const { props, deps } = resolve(
@@ -745,11 +877,11 @@ describe('resolveType', () => {
import { P } from '@/Foo.vue'
defineProps()
`,
- files
+ files,
)
expect(props).toStrictEqual({
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(['/src/Foo.vue'])
})
@@ -766,16 +898,16 @@ describe('resolveType', () => {
type PP = { bar: string }
}
export {}
- `
+ `,
}
const { props, deps } = resolve(`defineProps()`, files, {
- globalTypeFiles: Object.keys(files)
+ globalTypeFiles: Object.keys(files),
})
expect(props).toStrictEqual({
name: ['String'],
- bar: ['String']
+ bar: ['String'],
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
@@ -795,16 +927,44 @@ describe('resolveType', () => {
id: string
}
}
- `
+ `,
}
const { props } = resolve(`defineProps()`, files, {
- globalTypeFiles: Object.keys(files)
+ globalTypeFiles: Object.keys(files),
})
expect(props).toStrictEqual({
id: ['String'],
- manufacturer: ['Object']
+ manufacturer: ['Object'],
+ })
+ })
+
+ // #9871
+ test('shared generics with different args', () => {
+ const files = {
+ '/foo.ts': `export interface Foo { value: T }`,
+ }
+ const { props } = resolve(
+ `import type { Foo } from './foo'
+ defineProps>()`,
+ files,
+ undefined,
+ `/One.vue`,
+ )
+ expect(props).toStrictEqual({
+ value: ['String'],
+ })
+ const { props: props2 } = resolve(
+ `import type { Foo } from './foo'
+ defineProps>()`,
+ files,
+ undefined,
+ `/Two.vue`,
+ false /* do not invalidate cache */,
+ )
+ expect(props2).toStrictEqual({
+ value: ['Number'],
})
})
})
@@ -812,25 +972,25 @@ describe('resolveType', () => {
describe('errors', () => {
test('failed type reference', () => {
expect(() => resolve(`defineProps()`)).toThrow(
- `Unresolvable type reference`
+ `Unresolvable type reference`,
)
})
test('unsupported computed keys', () => {
expect(() => resolve(`defineProps<{ [Foo]: string }>()`)).toThrow(
- `Unsupported computed key in type referenced by a macro`
+ `Unsupported computed key in type referenced by a macro`,
)
})
test('unsupported index type', () => {
expect(() => resolve(`defineProps()`)).toThrow(
- `Unsupported type when resolving index type`
+ `Unsupported type when resolving index type`,
)
})
test('failed import source resolve', () => {
expect(() =>
- resolve(`import { X } from './foo'; defineProps()`)
+ resolve(`import { X } from './foo'; defineProps()`),
).toThrow(`Failed to resolve import source "./foo"`)
})
@@ -841,7 +1001,7 @@ describe('resolveType', () => {
resolve(`
import type P from 'unknown'
defineProps<{ foo: P }>()
- `)
+ `),
).not.toThrow()
})
@@ -851,7 +1011,7 @@ describe('resolveType', () => {
import type Base from 'unknown'
interface Props extends Base {}
defineProps()
- `)
+ `),
).toThrow(`@vue-ignore`)
})
@@ -866,11 +1026,11 @@ describe('resolveType', () => {
foo: string
}
defineProps()
- `))
+ `)),
).not.toThrow(`@vue-ignore`)
expect(res.props).toStrictEqual({
- foo: ['String']
+ foo: ['String'],
})
})
})
@@ -879,26 +1039,30 @@ describe('resolveType', () => {
function resolve(
code: string,
files: Record = {},
- options?: Partial
+ options?: Partial,
+ sourceFileName: string = '/Test.vue',
+ invalidateCache = true,
) {
const { descriptor } = parse(``, {
- filename: '/Test.vue'
+ filename: sourceFileName,
})
const ctx = new ScriptCompileContext(descriptor, {
id: 'test',
fs: {
fileExists(file) {
- return !!files[file]
+ return !!(files[file] ?? files[normalize(file)])
},
readFile(file) {
- return files[file]
- }
+ return files[file] ?? files[normalize(file)]
+ },
},
- ...options
+ ...options,
})
- for (const file in files) {
- invalidateTypeCache(file)
+ if (invalidateCache) {
+ for (const file in files) {
+ invalidateTypeCache(file)
+ }
}
// ctx.userImports is collected when calling compileScript(), but we are
@@ -924,6 +1088,6 @@ function resolve(
props,
calls: raw.calls,
deps: ctx.deps,
- raw
+ raw,
}
}
diff --git a/packages/compiler-sfc/__tests__/compileStyle.spec.ts b/packages/compiler-sfc/__tests__/compileStyle.spec.ts
index b33dabfd2ce..1f9ae67225b 100644
--- a/packages/compiler-sfc/__tests__/compileStyle.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileStyle.spec.ts
@@ -1,20 +1,20 @@
import {
+ type SFCStyleCompileOptions,
compileStyle,
compileStyleAsync,
- SFCStyleCompileOptions
} from '../src/compileStyle'
-import path from 'path'
+import path from 'node:path'
export function compileScoped(
source: string,
- options?: Partial
+ options?: Partial,
): string {
const res = compileStyle({
source,
filename: 'test.css',
id: 'data-v-test',
scoped: true,
- ...options
+ ...options,
})
if (res.errors.length) {
res.errors.forEach(err => {
@@ -28,34 +28,34 @@ export function compileScoped(
describe('SFC scoped CSS', () => {
test('simple selectors', () => {
expect(compileScoped(`h1 { color: red; }`)).toMatch(
- `h1[data-v-test] { color: red;`
+ `h1[data-v-test] { color: red;`,
)
expect(compileScoped(`.foo { color: red; }`)).toMatch(
- `.foo[data-v-test] { color: red;`
+ `.foo[data-v-test] { color: red;`,
)
})
test('descendent selector', () => {
expect(compileScoped(`h1 .foo { color: red; }`)).toMatch(
- `h1 .foo[data-v-test] { color: red;`
+ `h1 .foo[data-v-test] { color: red;`,
)
})
test('multiple selectors', () => {
expect(compileScoped(`h1 .foo, .bar, .baz { color: red; }`)).toMatch(
- `h1 .foo[data-v-test], .bar[data-v-test], .baz[data-v-test] { color: red;`
+ `h1 .foo[data-v-test], .bar[data-v-test], .baz[data-v-test] { color: red;`,
)
})
test('pseudo class', () => {
expect(compileScoped(`.foo:after { color: red; }`)).toMatch(
- `.foo[data-v-test]:after { color: red;`
+ `.foo[data-v-test]:after { color: red;`,
)
})
test('pseudo element', () => {
expect(compileScoped(`::selection { display: none; }`)).toMatch(
- '[data-v-test]::selection {'
+ '[data-v-test]::selection {',
)
})
@@ -85,6 +85,16 @@ describe('SFC scoped CSS', () => {
".baz .qux[data-v-test] .foo .bar { color: red;
}"
`)
+ expect(compileScoped(`:is(.foo :deep(.bar)) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ ":is(.foo[data-v-test] .bar) { color: red;
+ }"
+ `)
+ expect(compileScoped(`:where(.foo :deep(.bar)) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ ":where(.foo[data-v-test] .bar) { color: red;
+ }"
+ `)
})
test('::v-slotted', () => {
@@ -134,6 +144,23 @@ describe('SFC scoped CSS', () => {
`)
})
+ test(':is() and :where() with multiple selectors', () => {
+ expect(compileScoped(`:is(.foo) { color: red; }`)).toMatchInlineSnapshot(`
+ ":is(.foo[data-v-test]) { color: red;
+ }"
+ `)
+ expect(compileScoped(`:where(.foo, .bar) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ ":where(.foo[data-v-test], .bar[data-v-test]) { color: red;
+ }"
+ `)
+ expect(compileScoped(`:is(.foo, .bar) div { color: red; }`))
+ .toMatchInlineSnapshot(`
+ ":is(.foo, .bar) div[data-v-test] { color: red;
+ }"
+ `)
+ })
+
test('media query', () => {
expect(compileScoped(`@media print { .foo { color: red }}`))
.toMatchInlineSnapshot(`
@@ -190,30 +217,30 @@ describe('SFC scoped CSS', () => {
to { opacity: 1; }
}
`,
- { id: 'data-v-test' }
+ { id: 'data-v-test' },
)
expect(style).toContain(
- `.anim[data-v-test] {\n animation: color-test 5s infinite, other 5s;`
+ `.anim[data-v-test] {\n animation: color-test 5s infinite, other 5s;`,
)
expect(style).toContain(
- `.anim-2[data-v-test] {\n animation-name: color-test`
+ `.anim-2[data-v-test] {\n animation-name: color-test`,
)
expect(style).toContain(
- `.anim-3[data-v-test] {\n animation: 5s color-test infinite, 5s other;`
+ `.anim-3[data-v-test] {\n animation: 5s color-test infinite, 5s other;`,
)
expect(style).toContain(`@keyframes color-test {`)
expect(style).toContain(`@-webkit-keyframes color-test {`)
expect(style).toContain(
- `.anim-multiple[data-v-test] {\n animation: color-test 5s infinite,opacity-test 2s;`
+ `.anim-multiple[data-v-test] {\n animation: color-test 5s infinite,opacity-test 2s;`,
)
expect(style).toContain(
- `.anim-multiple-2[data-v-test] {\n animation-name: color-test,opacity-test;`
+ `.anim-multiple-2[data-v-test] {\n animation-name: color-test,opacity-test;`,
)
expect(style).toContain(`@keyframes opacity-test {\nfrom { opacity: 0;`)
expect(style).toContain(
- `@-webkit-keyframes opacity-test {\nfrom { opacity: 0;`
+ `@-webkit-keyframes opacity-test {\nfrom { opacity: 0;`,
)
})
@@ -238,7 +265,7 @@ describe('SFC scoped CSS', () => {
}"
`)
expect(
- `::v-deep usage as a combinator has been deprecated.`
+ `::v-deep usage as a combinator has been deprecated.`,
).toHaveBeenWarned()
})
@@ -249,7 +276,7 @@ describe('SFC scoped CSS', () => {
}"
`)
expect(
- `the >>> and /deep/ combinators have been deprecated.`
+ `the >>> and /deep/ combinators have been deprecated.`,
).toHaveBeenWarned()
})
@@ -260,7 +287,7 @@ describe('SFC scoped CSS', () => {
}"
`)
expect(
- `the >>> and /deep/ combinators have been deprecated.`
+ `the >>> and /deep/ combinators have been deprecated.`,
).toHaveBeenWarned()
})
})
@@ -272,7 +299,7 @@ describe('SFC CSS modules', () => {
source: `.red { color: red }\n.green { color: green }\n:global(.blue) { color: blue }`,
filename: `test.css`,
id: 'test',
- modules: true
+ modules: true,
})
expect(result.modules).toBeDefined()
expect(result.modules!.red).toMatch('_red_')
@@ -289,8 +316,8 @@ describe('SFC CSS modules', () => {
modulesOptions: {
scopeBehaviour: 'global',
generateScopedName: `[name]__[local]__[hash:base64:5]`,
- localsConvention: 'camelCaseOnly'
- }
+ localsConvention: 'camelCaseOnly',
+ },
})
expect(result.modules).toBeDefined()
expect(result.modules!.fooBar).toMatch('__foo-bar__')
@@ -306,11 +333,11 @@ describe('SFC style preprocessors', () => {
`,
filename: path.resolve(__dirname, './fixture/test.scss'),
id: '',
- preprocessLang: 'scss'
+ preprocessLang: 'scss',
})
expect([...res.dependencies]).toStrictEqual([
- path.join(__dirname, './fixture/import.scss')
+ path.join(__dirname, './fixture/import.scss'),
])
})
@@ -321,7 +348,7 @@ describe('SFC style preprocessors', () => {
@mixin square($size) {
width: $size;
height: $size;
- }`
+ }`,
},
source: `
.square {
@@ -330,7 +357,7 @@ describe('SFC style preprocessors', () => {
`,
filename: path.resolve(__dirname, './fixture/test.scss'),
id: '',
- preprocessLang: 'scss'
+ preprocessLang: 'scss',
})
expect(res.errors.length).toBe(0)
@@ -353,12 +380,12 @@ describe('SFC style preprocessors', () => {
width: $size;
height: $size;
}`
- }
+ },
},
source,
filename,
id: '',
- preprocessLang: 'scss'
+ preprocessLang: 'scss',
})
expect(res.errors.length).toBe(0)
diff --git a/packages/compiler-sfc/__tests__/compileTemplate.spec.ts b/packages/compiler-sfc/__tests__/compileTemplate.spec.ts
index b471b67c9ca..45dc54a69db 100644
--- a/packages/compiler-sfc/__tests__/compileTemplate.spec.ts
+++ b/packages/compiler-sfc/__tests__/compileTemplate.spec.ts
@@ -1,13 +1,15 @@
+import { type RawSourceMap, SourceMapConsumer } from 'source-map-js'
import {
+ type SFCTemplateCompileOptions,
compileTemplate,
- SFCTemplateCompileOptions
} from '../src/compileTemplate'
-import { parse, SFCTemplateBlock } from '../src/parse'
+import { type SFCTemplateBlock, parse } from '../src/parse'
+import { compileScript } from '../src'
function compile(opts: Omit) {
return compileTemplate({
...opts,
- id: ''
+ id: '',
})
}
@@ -48,28 +50,55 @@ body
p Cool Pug example!
`,
- { filename: 'example.vue', sourceMap: true }
+ { filename: 'example.vue', sourceMap: true },
).descriptor.template as SFCTemplateBlock
const result = compile({
filename: 'example.vue',
source: template.content,
- preprocessLang: template.lang
+ preprocessLang: template.lang,
})
expect(result.errors.length).toBe(0)
})
+test('preprocess pug with indents and blank lines', () => {
+ const template = parse(
+ `
+
+ body
+ h1 The next line contains four spaces.
+
+ div.container
+ p The next line is empty.
+ p This is the last line.
+
+`,
+ { filename: 'example.vue', sourceMap: true },
+ ).descriptor.template as SFCTemplateBlock
+
+ const result = compile({
+ filename: 'example.vue',
+ source: template.content,
+ preprocessLang: template.lang,
+ })
+
+ expect(result.errors.length).toBe(0)
+ expect(result.source).toBe(
+ 'The next line contains four spaces. This is the last line.
',
+ )
+})
+
test('warn missing preprocessor', () => {
const template = parse(`hi \n`, {
filename: 'example.vue',
- sourceMap: true
+ sourceMap: true,
}).descriptor.template as SFCTemplateBlock
const result = compile({
filename: 'example.vue',
source: template.content,
- preprocessLang: template.lang
+ preprocessLang: template.lang,
})
expect(result.errors.length).toBe(1)
@@ -81,8 +110,8 @@ test('transform asset url options', () => {
const { code: code1 } = compile({
...input,
transformAssetUrls: {
- tags: { foo: ['bar'] }
- }
+ tags: { foo: ['bar'] },
+ },
})
expect(code1).toMatch(`import _imports_0 from 'baz'\n`)
@@ -90,15 +119,15 @@ test('transform asset url options', () => {
const { code: code2 } = compile({
...input,
transformAssetUrls: {
- foo: ['bar']
- }
+ foo: ['bar'],
+ },
})
expect(code2).toMatch(`import _imports_0 from 'baz'\n`)
// false option
const { code: code3 } = compile({
...input,
- transformAssetUrls: false
+ transformAssetUrls: false,
})
expect(code3).not.toMatch(`import _imports_0 from 'baz'\n`)
})
@@ -107,25 +136,194 @@ test('source map', () => {
const template = parse(
`
-
+
`,
- { filename: 'example.vue', sourceMap: true }
- ).descriptor.template as SFCTemplateBlock
+ { filename: 'example.vue', sourceMap: true },
+ ).descriptor.template!
- const result = compile({
+ const { code, map } = compile({
filename: 'example.vue',
- source: template.content
+ source: template.content,
})
- expect(result.map).toMatchSnapshot()
+ expect(map!.sources).toEqual([`example.vue`])
+ expect(map!.sourcesContent).toEqual([template.content])
+
+ const consumer = new SourceMapConsumer(map as RawSourceMap)
+ expect(
+ consumer.originalPositionFor(getPositionInCode(code, 'foobar')),
+ ).toMatchObject(getPositionInCode(template.content, `foobar`))
+})
+
+test('should work w/ AST from descriptor', () => {
+ const source = `
+
+
+
+ `
+ const template = parse(source, {
+ filename: 'example.vue',
+ sourceMap: true,
+ }).descriptor.template!
+
+ expect(template.ast!.source).toBe(source)
+
+ const { code, map } = compile({
+ filename: 'example.vue',
+ source: template.content,
+ ast: template.ast,
+ })
+
+ expect(map!.sources).toEqual([`example.vue`])
+ // when reusing AST from SFC parse for template compile,
+ // the source corresponds to the entire SFC
+ expect(map!.sourcesContent).toEqual([source])
+
+ const consumer = new SourceMapConsumer(map as RawSourceMap)
+ expect(
+ consumer.originalPositionFor(getPositionInCode(code, 'foobar')),
+ ).toMatchObject(getPositionInCode(source, `foobar`))
+
+ expect(code).toBe(
+ compile({
+ filename: 'example.vue',
+ source: template.content,
+ }).code,
+ )
+})
+
+test('should work w/ AST from descriptor in SSR mode', () => {
+ const source = `
+
+
+
+ `
+ const template = parse(source, {
+ filename: 'example.vue',
+ sourceMap: true,
+ }).descriptor.template!
+
+ expect(template.ast!.source).toBe(source)
+
+ const { code, map } = compile({
+ filename: 'example.vue',
+ source: '', // make sure it's actually using the AST instead of source
+ ast: template.ast,
+ ssr: true,
+ })
+
+ expect(map!.sources).toEqual([`example.vue`])
+ // when reusing AST from SFC parse for template compile,
+ // the source corresponds to the entire SFC
+ expect(map!.sourcesContent).toEqual([source])
+
+ const consumer = new SourceMapConsumer(map as RawSourceMap)
+ expect(
+ consumer.originalPositionFor(getPositionInCode(code, 'foobar')),
+ ).toMatchObject(getPositionInCode(source, `foobar`))
+
+ expect(code).toBe(
+ compile({
+ filename: 'example.vue',
+ source: template.content,
+ ssr: true,
+ }).code,
+ )
+})
+
+test('should not reuse AST if using custom compiler', () => {
+ const source = `
+
+
+
+ `
+ const template = parse(source, {
+ filename: 'example.vue',
+ sourceMap: true,
+ }).descriptor.template!
+
+ const { code } = compile({
+ filename: 'example.vue',
+ source: template.content,
+ ast: template.ast,
+ compiler: {
+ parse: () => null as any,
+ // @ts-expect-error
+ compile: input => ({ code: input }),
+ },
+ })
+
+ // what we really want to assert is that the `input` received by the custom
+ // compiler is the source string, not the AST.
+ expect(code).toBe(template.content)
+})
+
+test('should force re-parse on already transformed AST', () => {
+ const source = `
+
+
+
+ `
+ const template = parse(source, {
+ filename: 'example.vue',
+ sourceMap: true,
+ }).descriptor.template!
+
+ // force set to empty, if this is reused then it won't generate proper code
+ template.ast!.children = []
+ template.ast!.transformed = true
+
+ const { code } = compile({
+ filename: 'example.vue',
+ source: '',
+ ast: template.ast,
+ })
+
+ expect(code).toBe(
+ compile({
+ filename: 'example.vue',
+ source: template.content,
+ }).code,
+ )
+})
+
+test('should force re-parse with correct compiler in SSR mode', () => {
+ const source = `
+
+
+
+ `
+ const template = parse(source, {
+ filename: 'example.vue',
+ sourceMap: true,
+ }).descriptor.template!
+
+ // force set to empty, if this is reused then it won't generate proper code
+ template.ast!.children = []
+ template.ast!.transformed = true
+
+ const { code } = compile({
+ filename: 'example.vue',
+ source: '',
+ ast: template.ast,
+ ssr: true,
+ })
+
+ expect(code).toBe(
+ compile({
+ filename: 'example.vue',
+ source: template.content,
+ ssr: true,
+ }).code,
+ )
})
test('template errors', () => {
const result = compile({
filename: 'example.vue',
- source: `
`
+ source: `
`,
})
expect(result.errors).toMatchSnapshot()
})
@@ -137,20 +335,20 @@ test('preprocessor errors', () => {
div(class='class)
`,
- { filename: 'example.vue', sourceMap: true }
+ { filename: 'example.vue', sourceMap: true },
).descriptor.template as SFCTemplateBlock
const result = compile({
filename: 'example.vue',
source: template.content,
- preprocessLang: template.lang
+ preprocessLang: template.lang,
})
expect(result.errors.length).toBe(1)
const message = result.errors[0].toString()
expect(message).toMatch(`Error: example.vue:3:1`)
expect(message).toMatch(
- `The end of the string reached with no closing bracket ) found.`
+ `The end of the string reached with no closing bracket ) found.`,
)
})
@@ -164,7 +362,7 @@ test('should generate the correct imports expression', () => {
`,
- ssr: true
+ ssr: true,
})
expect(code).toMatch(`_ssrRenderAttr(\"src\", _imports_1)`)
expect(code).toMatch(`_createVNode(\"img\", { src: _imports_1 })`)
@@ -186,7 +384,7 @@ test('should not hoist srcset URLs in SSR mode', () => {
`,
- ssr: true
+ ssr: true,
})
expect(code).toMatchSnapshot()
})
@@ -199,3 +397,90 @@ test('dynamic v-on + static v-on should merged', () => {
expect(result.code).toMatchSnapshot()
})
+
+// #9853 regression found in Nuxt tests
+// walkIdentifiers can get called multiple times on the same node
+// due to #9729 calling it during SFC template usage check.
+// conditions needed:
+// 1. `
+
+ {{ list.map((t, index) => ({ t: t })) }}
+
+ `
+ const { descriptor } = parse(src)
+ // compileScript triggers importUsageCheck
+ compileScript(descriptor, { id: 'xxx' })
+ const { code } = compileTemplate({
+ id: 'xxx',
+ filename: 'test.vue',
+ ast: descriptor.template!.ast,
+ source: descriptor.template!.content,
+ })
+ expect(code).not.toMatch(`_ctx.t`)
+})
+
+test('prefixing edge case for reused AST ssr mode', () => {
+ const src = `
+
+
+
+
+
+
+ `
+ const { descriptor } = parse(src)
+ // compileScript triggers importUsageCheck
+ compileScript(descriptor, { id: 'xxx' })
+ expect(() =>
+ compileTemplate({
+ id: 'xxx',
+ filename: 'test.vue',
+ ast: descriptor.template!.ast,
+ source: descriptor.template!.content,
+ ssr: true,
+ }),
+ ).not.toThrowError()
+})
+
+interface Pos {
+ line: number
+ column: number
+ name?: string
+}
+
+function getPositionInCode(
+ code: string,
+ token: string,
+ expectName: string | boolean = false,
+): Pos {
+ const generatedOffset = code.indexOf(token)
+ let line = 1
+ let lastNewLinePos = -1
+ for (let i = 0; i < generatedOffset; i++) {
+ if (code.charCodeAt(i) === 10 /* newline char code */) {
+ line++
+ lastNewLinePos = i
+ }
+ }
+ const res: Pos = {
+ line,
+ column:
+ lastNewLinePos === -1
+ ? generatedOffset
+ : generatedOffset - lastNewLinePos - 1,
+ }
+ if (expectName) {
+ res.name = typeof expectName === 'string' ? expectName : token
+ }
+ return res
+}
diff --git a/packages/compiler-sfc/__tests__/cssVars.spec.ts b/packages/compiler-sfc/__tests__/cssVars.spec.ts
index 5b01d73d772..323c9c7a599 100644
--- a/packages/compiler-sfc/__tests__/cssVars.spec.ts
+++ b/packages/compiler-sfc/__tests__/cssVars.spec.ts
@@ -1,5 +1,5 @@
import { compileStyle, parse } from '../src'
-import { mockId, compileSFCScript, assertCode } from './utils'
+import { assertCode, compileSFCScript, mockId } from './utils'
describe('CSS vars injection', () => {
test('generating correct code for nested paths', () => {
@@ -8,7 +8,7 @@ describe('CSS vars injection', () => {
``
+ }`,
)
expect(content).toMatch(`_useCssVars(_ctx => ({
"${mockId}-color": (_ctx.color),
@@ -32,7 +32,7 @@ describe('CSS vars injection', () => {
div {
font-size: v-bind(size);
}
- `
+ `,
)
expect(content).toMatch(`_useCssVars(_ctx => ({
"${mockId}-size": (_ctx.size)
@@ -57,7 +57,7 @@ describe('CSS vars injection', () => {
font-size: v-bind(size);
border: v-bind(foo);
}
- `
+ `,
)
// should handle:
// 1. local const bindings
@@ -69,7 +69,7 @@ describe('CSS vars injection', () => {
"${mockId}-foo": (__props.foo)
})`)
expect(content).toMatch(
- `import { useCssVars as _useCssVars, unref as _unref } from 'vue'`
+ `import { useCssVars as _useCssVars, unref as _unref } from 'vue'`,
)
assertCode(content)
})
@@ -85,12 +85,12 @@ describe('CSS vars injection', () => {
font-family: v-bind(フォント);
}`,
filename: 'test.css',
- id: 'data-v-test'
+ id: 'data-v-test',
})
expect(code).toMatchInlineSnapshot(`
".foo {
color: var(--test-color);
- font-size: var(--test-font\\\\.size);
+ font-size: var(--test-font\\.size);
font-weight: var(--test-_φ);
font-size: var(--test-1-字号);
@@ -106,7 +106,7 @@ describe('CSS vars injection', () => {
color: v-bind(color);
font-size: v-bind('font.size');
}`,
- { isProd: true }
+ { isProd: true },
)
expect(content).toMatch(`_useCssVars(_ctx => ({
"4003f1a6": (_ctx.color),
@@ -120,7 +120,7 @@ describe('CSS vars injection', () => {
}`,
filename: 'test.css',
id: mockId,
- isProd: true
+ isProd: true,
})
expect(code).toMatchInlineSnapshot(`
".foo {
@@ -135,8 +135,8 @@ describe('CSS vars injection', () => {
assertCode(
compileSFCScript(
`\n` +
- ``
- ).content
+ ``,
+ ).content,
)
})
@@ -144,8 +144,8 @@ describe('CSS vars injection', () => {
assertCode(
compileSFCScript(
`\n` +
- ``
- ).content
+ ``,
+ ).content,
)
})
@@ -155,8 +155,8 @@ describe('CSS vars injection', () => {
`\n` + ``
- ).content
+ \n` + ``,
+ ).content,
)
})
@@ -164,8 +164,8 @@ describe('CSS vars injection', () => {
assertCode(
compileSFCScript(
`\n` +
- ``
- ).content
+ ``,
+ ).content,
)
})
@@ -178,7 +178,7 @@ describe('CSS vars injection', () => {
div{ /* color: v-bind(color); */ width:20; }
div{ width: v-bind(width); }
/* comment */
- `
+ `,
)
expect(content).not.toMatch(`"${mockId}-color": (color)`)
@@ -198,7 +198,7 @@ describe('CSS vars injection', () => {
p {
color: v-bind(color);
}
- `
+ `,
)
// color should only be injected once, even if it is twice in style
expect(content).toMatch(`_useCssVars(_ctx => ({
@@ -229,7 +229,7 @@ describe('CSS vars injection', () => {
p {
color: v-bind(((a + b)) / (2 * a));
}
- `
+ `,
)
expect(content).toMatch(`_useCssVars(_ctx => ({
"${mockId}-foo": (_unref(foo)),
@@ -243,7 +243,7 @@ describe('CSS vars injection', () => {
// #6022
test('should be able to parse incomplete expressions', () => {
const {
- descriptor: { cssVars }
+ descriptor: { cssVars },
} = parse(
`
`
+ `,
)
expect(cssVars).toMatchObject([`count.toString(`, `xxx`])
})
@@ -266,11 +266,79 @@ describe('CSS vars injection', () => {
label {
background: v-bind(background);
}
- `
+ `,
)
expect(content).toMatch(
- `export default {\n setup(__props, { expose: __expose }) {\n __expose();\n\n_useCssVars(_ctx => ({\n "xxxxxxxx-background": (_unref(background))\n}))`
+ `export default {\n setup(__props, { expose: __expose }) {\n __expose();\n\n_useCssVars(_ctx => ({\n "xxxxxxxx-background": (_unref(background))\n}))`,
)
})
+
+ describe('skip codegen in SSR', () => {
+ test('script setup, inline', () => {
+ const { content } = compileSFCScript(
+ `\n` +
+ ``,
+ {
+ inlineTemplate: true,
+ templateOptions: {
+ ssr: true,
+ },
+ },
+ )
+ expect(content).not.toMatch(`_useCssVars`)
+ })
+
+ // #6926
+ test('script, non-inline', () => {
+ const { content } = compileSFCScript(
+ `\n` +
+ ``,
+ {
+ inlineTemplate: false,
+ templateOptions: {
+ ssr: true,
+ },
+ },
+ )
+ expect(content).not.toMatch(`_useCssVars`)
+ })
+
+ test('normal script', () => {
+ const { content } = compileSFCScript(
+ `\n` +
+ ``,
+ {
+ templateOptions: {
+ ssr: true,
+ },
+ },
+ )
+ expect(content).not.toMatch(`_useCssVars`)
+ })
+ })
})
})
diff --git a/packages/compiler-sfc/__tests__/parse.spec.ts b/packages/compiler-sfc/__tests__/parse.spec.ts
index c7a17ab1739..048dab693aa 100644
--- a/packages/compiler-sfc/__tests__/parse.spec.ts
+++ b/packages/compiler-sfc/__tests__/parse.spec.ts
@@ -1,5 +1,10 @@
import { parse } from '../src'
-import { baseParse, baseCompile } from '@vue/compiler-core'
+import {
+ ElementTypes,
+ NodeTypes,
+ baseCompile,
+ createRoot,
+} from '@vue/compiler-core'
import { SourceMapConsumer } from 'source-map-js'
describe('compiler:sfc', () => {
@@ -7,15 +12,61 @@ describe('compiler:sfc', () => {
test('style block', () => {
// Padding determines how many blank lines will there be before the style block
const padding = Math.round(Math.random() * 10)
- const style = parse(
- `${'\n'.repeat(padding)}\n`
- ).descriptor.styles[0]
+ const src =
+ `${'\n'.repeat(padding)}` +
+ `
- expect(style.map).not.toBeUndefined()
+
- const consumer = new SourceMapConsumer(style.map!)
+
+
+`
+ const {
+ descriptor: { styles },
+ } = parse(src)
+
+ expect(styles[0].map).not.toBeUndefined()
+ const consumer = new SourceMapConsumer(styles[0].map!)
+ const lineOffset =
+ src.slice(0, src.indexOf(`\n`.replace(
/./g,
- ' '
- ) + '\n{ "greeting": "hello" }\n'
+ ' ',
+ ) + '\n{ "greeting": "hello" }\n',
)
})
@@ -121,9 +192,8 @@ h1 { color: red }
end: {
line: 3,
column: 1,
- offset: 10 + content.length
+ offset: 10 + content.length,
},
- source: content
})
})
@@ -132,9 +202,8 @@ h1 { color: red }
expect(descriptor.template).toBeTruthy()
expect(descriptor.template!.content).toBeFalsy()
expect(descriptor.template!.loc).toMatchObject({
- start: { line: 1, column: 1, offset: 0 },
- end: { line: 1, column: 1, offset: 0 },
- source: ''
+ start: { line: 1, column: 12, offset: 11 },
+ end: { line: 1, column: 12, offset: 11 },
})
})
@@ -145,7 +214,6 @@ h1 { color: red }
expect(descriptor.template!.loc).toMatchObject({
start: { line: 1, column: 11, offset: 10 },
end: { line: 1, column: 11, offset: 10 },
- source: ''
})
})
@@ -156,7 +224,7 @@ h1 { color: red }
expect(parse(``).descriptor.styles.length).toBe(0)
expect(parse(` `).descriptor.customBlocks.length).toBe(0)
expect(
- parse(` \n\t `).descriptor.customBlocks.length
+ parse(` \n\t `).descriptor.customBlocks.length,
).toBe(0)
})
@@ -167,25 +235,28 @@ h1 { color: red }
expect(descriptor.script!.attrs['src']).toBe('com')
})
+ test('should not expose ast on template node if has src import', () => {
+ const { descriptor } = parse(` `)
+ expect(descriptor.template!.ast).toBeUndefined()
+ })
+
test('ignoreEmpty: false', () => {
const { descriptor } = parse(
`\n`,
{
- ignoreEmpty: false
- }
+ ignoreEmpty: false,
+ },
)
expect(descriptor.script).toBeTruthy()
expect(descriptor.script!.loc).toMatchObject({
- source: '',
start: { line: 1, column: 9, offset: 8 },
- end: { line: 1, column: 9, offset: 8 }
+ end: { line: 1, column: 9, offset: 8 },
})
expect(descriptor.scriptSetup).toBeTruthy()
expect(descriptor.scriptSetup!.loc).toMatchObject({
- source: '\n',
start: { line: 2, column: 15, offset: 32 },
- end: { line: 3, column: 1, offset: 33 }
+ end: { line: 3, column: 1, offset: 33 },
})
})
@@ -201,20 +272,22 @@ h1 { color: red }
test('treat empty lang attribute as the html', () => {
const content = `ok
`
const { descriptor, errors } = parse(
- `${content} `
+ `${content} `,
)
expect(descriptor.template!.content).toBe(content)
expect(errors.length).toBe(0)
})
// #1120
- test('alternative template lang should be treated as plain text', () => {
- const content = `p(v-if="1 < 2") test`
+ test('template with preprocessor lang should be treated as plain text', () => {
+ const content = `p(v-if="1 < 2") test
`
const { descriptor, errors } = parse(
- `` + content + ` `
+ `` + content + ` `,
)
expect(errors.length).toBe(0)
expect(descriptor.template!.content).toBe(content)
+ // should not attempt to parse the content
+ expect(descriptor.template!.ast!.children.length).toBe(1)
})
//#2566
@@ -233,17 +306,17 @@ h1 { color: red }
expect(parse(`hi `).descriptor.slotted).toBe(false)
expect(
parse(`hi `).descriptor
- .slotted
+ .slotted,
).toBe(false)
expect(
parse(
- `hi `
- ).descriptor.slotted
+ `hi `,
+ ).descriptor.slotted,
).toBe(true)
expect(
parse(
- `hi `
- ).descriptor.slotted
+ `hi `,
+ ).descriptor.slotted,
).toBe(true)
})
@@ -260,21 +333,54 @@ h1 { color: red }
test('custom compiler', () => {
const { errors } = parse(` `, {
compiler: {
- parse: baseParse,
- compile: baseCompile
- }
+ parse: (_, options) => {
+ options.onError!(new Error('foo') as any)
+ return createRoot([])
+ },
+ compile: baseCompile,
+ },
})
- expect(errors.length).toBe(1)
+ expect(errors.length).toBe(2)
+ // error thrown by the custom parse
+ expect(errors[0].message).toBe('foo')
+ // error thrown based on the returned root
+ expect(errors[1].message).toMatch('At least one')
})
test('treat custom blocks as raw text', () => {
const { errors, descriptor } = parse(
- ` <-& `
+ ` <-& `,
)
expect(errors.length).toBe(0)
expect(descriptor.customBlocks[0].content).toBe(` <-& `)
})
+ test('should accept parser options', () => {
+ const { errors, descriptor } = parse(` `, {
+ templateParseOptions: {
+ isCustomElement: t => t === 'hello',
+ },
+ })
+ expect(errors.length).toBe(0)
+ expect(descriptor.template!.ast!.children[0]).toMatchObject({
+ type: NodeTypes.ELEMENT,
+ tag: 'hello',
+ tagType: ElementTypes.ELEMENT,
+ })
+
+ // test cache invalidation on different options
+ const { descriptor: d2 } = parse(` `, {
+ templateParseOptions: {
+ isCustomElement: t => t !== 'hello',
+ },
+ })
+ expect(d2.template!.ast!.children[0]).toMatchObject({
+ type: NodeTypes.ELEMENT,
+ tag: 'hello',
+ tagType: ElementTypes.COMPONENT,
+ })
+ })
+
describe('warnings', () => {
function assertWarning(errors: Error[], msg: string) {
expect(errors.some(e => e.message.match(msg))).toBe(true)
@@ -283,7 +389,7 @@ h1 { color: red }
test('should only allow single template element', () => {
assertWarning(
parse(`
`).errors,
- `Single file component can contain only one element`
+ `Single file component can contain only one element`,
)
})
@@ -291,24 +397,24 @@ h1 { color: red }
assertWarning(
parse(``)
.errors,
- `Single file component can contain only one `
+ ``,
).errors,
- `Single file component can contain only one `
- ).errors.length
+ ``,
+ ).errors.length,
).toBe(0)
})
@@ -316,7 +422,7 @@ h1 { color: red }
test('should throw error if no or
diff --git a/packages/sfc-playground/package.json b/packages/sfc-playground/package.json
index 1cf02f79cb6..1e6bd1a3733 100644
--- a/packages/sfc-playground/package.json
+++ b/packages/sfc-playground/package.json
@@ -1,20 +1,21 @@
{
"name": "@vue/sfc-playground",
- "version": "3.3.4",
"private": true,
+ "version": "0.0.0",
+ "type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
- "@vitejs/plugin-vue": "^4.2.3",
- "vite": "^4.3.0"
+ "@vitejs/plugin-vue": "^4.4.0",
+ "vite": "^5.0.5"
},
"dependencies": {
- "@vue/repl": "^1.4.1",
+ "@vue/repl": "^3.1.1",
"file-saver": "^2.0.5",
- "jszip": "^3.6.0",
+ "jszip": "^3.10.1",
"vue": "workspace:*"
}
}
diff --git a/packages/sfc-playground/src/App.vue b/packages/sfc-playground/src/App.vue
index f7db1b7951b..cadd39f4baa 100644
--- a/packages/sfc-playground/src/App.vue
+++ b/packages/sfc-playground/src/App.vue
@@ -1,7 +1,24 @@
@@ -108,7 +161,7 @@ body {
}
.vue-repl {
- height: calc(var(--vh) - var(--nav-height));
+ height: calc(var(--vh) - var(--nav-height)) !important;
}
button {
diff --git a/packages/sfc-playground/src/Header.vue b/packages/sfc-playground/src/Header.vue
index 45db4d3af05..48585a8e646 100644
--- a/packages/sfc-playground/src/Header.vue
+++ b/packages/sfc-playground/src/Header.vue
@@ -1,44 +1,47 @@
@@ -107,35 +72,35 @@ async function fetchVersions(): Promise {
Vue SFC Playground
@@ -233,47 +201,20 @@ h1 img {
display: flex;
}
-.version {
- margin-right: 12px;
- position: relative;
-}
-
-.active-version {
- cursor: pointer;
- position: relative;
- display: inline-flex;
- place-items: center;
-}
-
-.active-version .number {
- color: var(--green);
- margin-left: 4px;
-}
-
-.active-version::after {
- content: '';
- width: 0;
- height: 0;
- border-left: 4px solid transparent;
- border-right: 4px solid transparent;
- border-top: 6px solid #aaa;
- margin-left: 8px;
-}
-
-.toggle-dev span,
+.toggle-prod span,
.toggle-ssr span {
font-size: 12px;
border-radius: 4px;
padding: 4px 6px;
}
-.toggle-dev span {
- background: var(--purple);
+.toggle-prod span {
+ background: var(--green);
color: #fff;
}
-.toggle-dev.dev span {
- background: var(--green);
+.toggle-prod.prod span {
+ background: var(--purple);
}
.toggle-ssr span {
@@ -300,12 +241,13 @@ h1 img {
}
.links button,
-.links button a {
+.links .github {
+ padding: 1px 6px;
color: var(--btn);
}
.links button:hover,
-.links button:hover a {
+.links .github:hover {
color: var(--highlight);
}
diff --git a/packages/sfc-playground/src/VersionSelect.vue b/packages/sfc-playground/src/VersionSelect.vue
new file mode 100644
index 00000000000..50c3c59ac24
--- /dev/null
+++ b/packages/sfc-playground/src/VersionSelect.vue
@@ -0,0 +1,118 @@
+
+
+
+
+
+ {{ label }}
+ {{ version }}
+
+
+
+
+
+
+
diff --git a/packages/sfc-playground/src/download/download.ts b/packages/sfc-playground/src/download/download.ts
index 81d602f1258..f981134a701 100644
--- a/packages/sfc-playground/src/download/download.ts
+++ b/packages/sfc-playground/src/download/download.ts
@@ -5,7 +5,7 @@ import main from './template/main.js?raw'
import pkg from './template/package.json?raw'
import config from './template/vite.config.js?raw'
import readme from './template/README.md?raw'
-import { ReplStore } from '@vue/repl'
+import type { ReplStore } from '@vue/repl'
export async function downloadProject(store: ReplStore) {
if (!confirm('Download project files?')) {
@@ -27,7 +27,11 @@ export async function downloadProject(store: ReplStore) {
const files = store.getFiles()
for (const file in files) {
- src.file(file, files[file])
+ if (file !== 'import-map.json') {
+ src.file(file, files[file])
+ } else {
+ zip.file(file, files[file])
+ }
}
const blob = await zip.generateAsync({ type: 'blob' })
diff --git a/packages/sfc-playground/src/download/template/package.json b/packages/sfc-playground/src/download/template/package.json
index 762cdf38592..ee271628e71 100644
--- a/packages/sfc-playground/src/download/template/package.json
+++ b/packages/sfc-playground/src/download/template/package.json
@@ -1,6 +1,7 @@
{
"name": "vite-vue-starter",
"version": "0.0.0",
+ "type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
@@ -10,7 +11,7 @@
"vue": "^3.3.0"
},
"devDependencies": {
- "@vitejs/plugin-vue": "^4.2.3",
- "vite": "^4.3.0"
+ "@vitejs/plugin-vue": "^4.4.0",
+ "vite": "^5.0.0"
}
}
diff --git a/packages/sfc-playground/src/download/template/vite.config.js b/packages/sfc-playground/src/download/template/vite.config.js
index 315212d69a7..05c17402a4a 100644
--- a/packages/sfc-playground/src/download/template/vite.config.js
+++ b/packages/sfc-playground/src/download/template/vite.config.js
@@ -3,5 +3,5 @@ import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [vue()]
+ plugins: [vue()],
})
diff --git a/packages/sfc-playground/src/icons/GitHub.vue b/packages/sfc-playground/src/icons/GitHub.vue
index cc2506a787d..2a6aaf62dd2 100644
--- a/packages/sfc-playground/src/icons/GitHub.vue
+++ b/packages/sfc-playground/src/icons/GitHub.vue
@@ -1,6 +1,7 @@
+ d="M10.9,2.1c-4.6,0.5-8.3,4.2-8.8,8.7c-0.5,4.7,2.2,8.9,6.3,10.5C8.7,21.4,9,21.2,9,20.8v-1.6c0,0-0.4,0.1-0.9,0.1 c-1.4,0-2-1.2-2.1-1.9c-0.1-0.4-0.3-0.7-0.6-1C5.1,16.3,5,16.3,5,16.2C5,16,5.3,16,5.4,16c0.6,0,1.1,0.7,1.3,1c0.5,0.8,1.1,1,1.4,1 c0.4,0,0.7-0.1,0.9-0.2c0.1-0.7,0.4-1.4,1-1.8c-2.3-0.5-4-1.8-4-4c0-1.1,0.5-2.2,1.2-3C7.1,8.8,7,8.3,7,7.6C7,7.2,7,6.6,7.3,6 c0,0,1.4,0,2.8,1.3C10.6,7.1,11.3,7,12,7s1.4,0.1,2,0.3C15.3,6,16.8,6,16.8,6C17,6.6,17,7.2,17,7.6c0,0.8-0.1,1.2-0.2,1.4 c0.7,0.8,1.2,1.8,1.2,3c0,2.2-1.7,3.5-4,4c0.6,0.5,1,1.4,1,2.3v2.6c0,0.3,0.3,0.6,0.7,0.5c3.7-1.5,6.3-5.1,6.3-9.3 C22,6.1,16.9,1.4,10.9,2.1z"
+ />
diff --git a/packages/sfc-playground/src/icons/Moon.vue b/packages/sfc-playground/src/icons/Moon.vue
index 30c6eb515f1..21f393d4d6e 100644
--- a/packages/sfc-playground/src/icons/Moon.vue
+++ b/packages/sfc-playground/src/icons/Moon.vue
@@ -1,5 +1,8 @@
-
+
diff --git a/packages/sfc-playground/src/icons/Reload.vue b/packages/sfc-playground/src/icons/Reload.vue
new file mode 100644
index 00000000000..5ec5be80889
--- /dev/null
+++ b/packages/sfc-playground/src/icons/Reload.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/packages/sfc-playground/src/icons/Sun.vue b/packages/sfc-playground/src/icons/Sun.vue
index 4e4b1f409f9..4b73922421a 100644
--- a/packages/sfc-playground/src/icons/Sun.vue
+++ b/packages/sfc-playground/src/icons/Sun.vue
@@ -1,13 +1,40 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/packages/sfc-playground/src/main.ts b/packages/sfc-playground/src/main.ts
index 713251fd81c..7be63408035 100644
--- a/packages/sfc-playground/src/main.ts
+++ b/packages/sfc-playground/src/main.ts
@@ -1,10 +1,9 @@
import { createApp } from 'vue'
import App from './App.vue'
-import '@vue/repl/style.css'
// @ts-expect-error Custom window property
window.VUE_DEVTOOLS_CONFIG = {
- defaultSelectedAppId: 'repl'
+ defaultSelectedAppId: 'repl',
}
createApp(App).mount('#app')
diff --git a/packages/sfc-playground/src/vue-dev-proxy-prod.ts b/packages/sfc-playground/src/vue-dev-proxy-prod.ts
new file mode 100644
index 00000000000..c20c51579a4
--- /dev/null
+++ b/packages/sfc-playground/src/vue-dev-proxy-prod.ts
@@ -0,0 +1,3 @@
+// serve vue to the iframe sandbox during dev.
+// @ts-expect-error
+export * from 'vue/dist/vue.runtime.esm-browser.prod.js'
diff --git a/packages/sfc-playground/vite.config.ts b/packages/sfc-playground/vite.config.ts
index ed76f69dcf9..e30078f4b79 100644
--- a/packages/sfc-playground/vite.config.ts
+++ b/packages/sfc-playground/vite.config.ts
@@ -1,10 +1,10 @@
-import fs from 'fs'
-import path from 'path'
-import { defineConfig, Plugin } from 'vite'
+import fs from 'node:fs'
+import path from 'node:path'
+import { type Plugin, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
-import execa from 'execa'
+import { execaSync } from 'execa'
-const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
+const commit = execaSync('git', ['rev-parse', '--short=7', 'HEAD']).stdout
export default defineConfig({
plugins: [
@@ -12,19 +12,19 @@ export default defineConfig({
script: {
fs: {
fileExists: fs.existsSync,
- readFile: file => fs.readFileSync(file, 'utf-8')
- }
- }
+ readFile: file => fs.readFileSync(file, 'utf-8'),
+ },
+ },
}),
- copyVuePlugin()
+ copyVuePlugin(),
],
define: {
__COMMIT__: JSON.stringify(commit),
- __VUE_PROD_DEVTOOLS__: JSON.stringify(true)
+ __VUE_PROD_DEVTOOLS__: JSON.stringify(true),
},
optimizeDeps: {
- exclude: ['@vue/repl']
- }
+ exclude: ['@vue/repl'],
+ },
})
function copyVuePlugin(): Plugin {
@@ -37,18 +37,21 @@ function copyVuePlugin(): Plugin {
if (!fs.existsSync(filePath)) {
throw new Error(
`${basename} not built. ` +
- `Run "nr build vue -f esm-browser" first.`
+ `Run "nr build vue -f esm-browser" first.`,
)
}
this.emitFile({
type: 'asset',
fileName: basename,
- source: fs.readFileSync(filePath, 'utf-8')
+ source: fs.readFileSync(filePath, 'utf-8'),
})
}
+ copyFile(`../vue/dist/vue.esm-browser.js`)
+ copyFile(`../vue/dist/vue.esm-browser.prod.js`)
copyFile(`../vue/dist/vue.runtime.esm-browser.js`)
+ copyFile(`../vue/dist/vue.runtime.esm-browser.prod.js`)
copyFile(`../server-renderer/dist/server-renderer.esm-browser.js`)
- }
+ },
}
}
diff --git a/packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap b/packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap
index 762e32694d3..4caa583461d 100644
--- a/packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap
+++ b/packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap
@@ -1,62 +1,62 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`compiler: codeframe > line in middle 1`] = `
-"2 |
+"2 |
3 |
-4 | hi
+4 | hi
| ^^^^^^^^^^^^^^
5 |
-6 | "
+6 | "
`;
exports[`compiler: codeframe > line near bottom 1`] = `
-"4 | hi
+"4 | hi
5 |
-6 |
+6 |
| ^^^^^^^^^
7 | "
`;
exports[`compiler: codeframe > line near top 1`] = `
"1 |
-2 |
+2 |
| ^^^^^^^^^
3 |
-4 | hi "
+4 | hi "
`;
exports[`compiler: codeframe > multi-line highlights 1`] = `
-"1 |
+4 | ">
| ^"
`;
exports[`compiler: codeframe > newline sequences - unix 1`] = `
-"8 |
+"8 |
9 |
-10 |
-10 |
+10 |
| ^^^^^^^^^^^^^^^
-11 | Password
+11 | Password
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-12 |
+12 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
| ^^^^^^^^^^^^"
diff --git a/packages/shared/__tests__/codeframe.spec.ts b/packages/shared/__tests__/codeframe.spec.ts
index 5083100485d..addae82c908 100644
--- a/packages/shared/__tests__/codeframe.spec.ts
+++ b/packages/shared/__tests__/codeframe.spec.ts
@@ -75,7 +75,7 @@ attr
const keyEnd =
windowsNewLineSource.indexOf(endToken, keyStart) + endToken.length
expect(
- generateCodeFrame(windowsNewLineSource, keyStart, keyEnd)
+ generateCodeFrame(windowsNewLineSource, keyStart, keyEnd),
).toMatchSnapshot()
})
@@ -84,7 +84,7 @@ attr
const keyEnd =
unixNewlineSource.indexOf(endToken, keyStart) + endToken.length
expect(
- generateCodeFrame(unixNewlineSource, keyStart, keyEnd)
+ generateCodeFrame(unixNewlineSource, keyStart, keyEnd),
).toMatchSnapshot()
})
}
diff --git a/packages/shared/__tests__/escapeHtml.spec.ts b/packages/shared/__tests__/escapeHtml.spec.ts
index 34505d3eadc..30004706af7 100644
--- a/packages/shared/__tests__/escapeHtml.spec.ts
+++ b/packages/shared/__tests__/escapeHtml.spec.ts
@@ -1,11 +1,31 @@
-import { escapeHtml } from '../src'
-
-test('ssr: escapeHTML', () => {
- expect(escapeHtml(`foo`)).toBe(`foo`)
- expect(escapeHtml(true)).toBe(`true`)
- expect(escapeHtml(false)).toBe(`false`)
- expect(escapeHtml(`a && b`)).toBe(`a && b`)
- expect(escapeHtml(`"foo"`)).toBe(`"foo"`)
- expect(escapeHtml(`'bar'`)).toBe(`'bar'`)
- expect(escapeHtml(`
`)).toBe(`<div>`)
+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 && b`)
+ expect(escapeHtml(`"foo"`)).toBe(`"foo"`)
+ expect(escapeHtml(`'bar'`)).toBe(`'bar'`)
+ expect(escapeHtml(`
`)).toBe(`<div>`)
+ })
+
+ test('ssr: escapeHTMLComment', () => {
+ const input = ''
+ const result = escapeHtmlComment(input)
+ expect(result).toEqual(' Hello World! ')
+ })
+
+ test('ssr: escapeHTMLComment', () => {
+ const input = ' Hello World!'
+ const result = escapeHtmlComment(input)
+ expect(result).toEqual(' Comment 1 Hello ! Comment 2 World!')
+ })
+
+ test('should not affect non-comment strings', () => {
+ const input = 'Hello World'
+ const result = escapeHtmlComment(input)
+ expect(result).toEqual(input)
+ })
})
diff --git a/packages/shared/__tests__/looseEqual.spec.ts b/packages/shared/__tests__/looseEqual.spec.ts
index 67b69dd76d4..2dea58ce586 100644
--- a/packages/shared/__tests__/looseEqual.spec.ts
+++ b/packages/shared/__tests__/looseEqual.spec.ts
@@ -69,27 +69,27 @@ describe('utils/looseEqual', () => {
const date2 = new Date(2019, 1, 2, 3, 4, 5, 7)
const file1 = new File([''], 'filename.txt', {
type: 'text/plain',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
const file2 = new File([''], 'filename.txt', {
type: 'text/plain',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
const file3 = new File([''], 'filename.txt', {
type: 'text/plain',
- lastModified: date2.getTime()
+ lastModified: date2.getTime(),
})
const file4 = new File([''], 'filename.csv', {
type: 'text/csv',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
const file5 = new File(['abcdef'], 'filename.txt', {
type: 'text/plain',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
const file6 = new File(['12345'], 'filename.txt', {
type: 'text/plain',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
// Identical file object references
@@ -178,7 +178,7 @@ describe('utils/looseEqual', () => {
const date1 = new Date(2019, 1, 2, 3, 4, 5, 6)
const file1 = new File([''], 'filename.txt', {
type: 'text/plain',
- lastModified: date1.getTime()
+ lastModified: date1.getTime(),
})
expect(looseEqual(123, '123')).toBe(true)
diff --git a/packages/shared/__tests__/normalizeProp.spec.ts b/packages/shared/__tests__/normalizeProp.spec.ts
index a3cb104c003..4e5736af46f 100644
--- a/packages/shared/__tests__/normalizeProp.spec.ts
+++ b/packages/shared/__tests__/normalizeProp.spec.ts
@@ -1,22 +1,70 @@
import { normalizeClass, parseStringStyle } from '../src'
describe('normalizeClass', () => {
+ test('handles undefined correctly', () => {
+ expect(normalizeClass(undefined)).toEqual('')
+ })
+
test('handles string correctly', () => {
expect(normalizeClass('foo')).toEqual('foo')
})
test('handles array correctly', () => {
expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual(
- 'foo bar'
+ 'foo bar',
)
})
+ test('handles empty array correctly', () => {
+ expect(normalizeClass([])).toEqual('')
+ })
+
+ test('handles nested array correctly', () => {
+ expect(normalizeClass(['foo', ['bar'], [['baz']]])).toEqual('foo bar baz')
+ })
+
test('handles object correctly', () => {
expect(normalizeClass({ foo: true, bar: false, baz: true })).toEqual(
- 'foo baz'
+ 'foo baz',
)
})
+ test('handles empty object correctly', () => {
+ expect(normalizeClass({})).toEqual('')
+ })
+
+ test('handles arrays and objects correctly', () => {
+ expect(
+ normalizeClass(['foo', ['bar'], { baz: true }, [{ qux: true }]]),
+ ).toEqual('foo bar baz qux')
+ })
+
+ test('handles array of objects with falsy values', () => {
+ expect(
+ normalizeClass([
+ { foo: false },
+ { bar: 0 },
+ { baz: -0 },
+ { qux: '' },
+ { quux: null },
+ { corge: undefined },
+ { grault: NaN },
+ ]),
+ ).toEqual('')
+ })
+
+ test('handles array of objects with truthy values', () => {
+ expect(
+ normalizeClass([
+ { foo: true },
+ { bar: 'not-empty' },
+ { baz: 1 },
+ { qux: {} },
+ { quux: [] },
+ ]),
+ ).toEqual('foo bar baz qux quux')
+ })
+
// #6777
test('parse multi-line inline style', () => {
expect(
@@ -28,7 +76,7 @@ describe('normalizeClass', () => {
#ccc 0.5em,
white 0,
white 0.75em
- );`)
+ );`),
).toMatchInlineSnapshot(`
{
"background": "linear-gradient(white, white) padding-box,
diff --git a/packages/shared/__tests__/toDisplayString.spec.ts b/packages/shared/__tests__/toDisplayString.spec.ts
index 5255c0e400b..ef5030239b4 100644
--- a/packages/shared/__tests__/toDisplayString.spec.ts
+++ b/packages/shared/__tests__/toDisplayString.spec.ts
@@ -27,19 +27,19 @@ describe('toDisplayString', () => {
foo: 555,
toString() {
return 'override'
- }
+ },
}
expect(toDisplayString(objWithToStringOverride)).toBe('override')
const objWithNonInvokableToString = {
foo: 555,
- toString: null
+ toString: null,
}
expect(toDisplayString(objWithNonInvokableToString)).toBe(
`{
"foo": 555,
"toString": null
-}`
+}`,
)
// object created from null does not have .toString in its prototype
@@ -48,7 +48,7 @@ describe('toDisplayString', () => {
expect(toDisplayString(nullObjectWithoutToString)).toBe(
`{
"bar": 1
-}`
+}`,
)
// array toString override is ignored
@@ -60,7 +60,7 @@ describe('toDisplayString', () => {
1,
2,
3
-]`
+]`,
)
})
@@ -70,8 +70,8 @@ describe('toDisplayString', () => {
expect(
toDisplayString({
n,
- np
- })
+ np,
+ }),
).toBe(JSON.stringify({ n: 1, np: 2 }, null, 2))
})
@@ -92,7 +92,7 @@ describe('toDisplayString', () => {
expect(toDisplayString(div)).toMatch('[object HTMLDivElement]')
expect(toDisplayString({ div })).toMatchInlineSnapshot(`
"{
- \\"div\\": \\"[object HTMLDivElement]\\"
+ "div": "[object HTMLDivElement]"
}"
`)
})
@@ -100,34 +100,34 @@ describe('toDisplayString', () => {
test('Map and Set', () => {
const m = new Map
([
[1, 'foo'],
- [{ baz: 1 }, { foo: 'bar', qux: 2 }]
+ [{ baz: 1 }, { foo: 'bar', qux: 2 }],
])
const s = new Set([1, { foo: 'bar' }, m])
expect(toDisplayString(m)).toMatchInlineSnapshot(`
"{
- \\"Map(2)\\": {
- \\"1 =>\\": \\"foo\\",
- \\"[object Object] =>\\": {
- \\"foo\\": \\"bar\\",
- \\"qux\\": 2
+ "Map(2)": {
+ "1 =>": "foo",
+ "[object Object] =>": {
+ "foo": "bar",
+ "qux": 2
}
}
}"
`)
expect(toDisplayString(s)).toMatchInlineSnapshot(`
"{
- \\"Set(3)\\": [
+ "Set(3)": [
1,
{
- \\"foo\\": \\"bar\\"
+ "foo": "bar"
},
{
- \\"Map(2)\\": {
- \\"1 =>\\": \\"foo\\",
- \\"[object Object] =>\\": {
- \\"foo\\": \\"bar\\",
- \\"qux\\": 2
+ "Map(2)": {
+ "1 =>": "foo",
+ "[object Object] =>": {
+ "foo": "bar",
+ "qux": 2
}
}
}
@@ -138,31 +138,31 @@ describe('toDisplayString', () => {
expect(
toDisplayString({
m,
- s
- })
+ s,
+ }),
).toMatchInlineSnapshot(`
"{
- \\"m\\": {
- \\"Map(2)\\": {
- \\"1 =>\\": \\"foo\\",
- \\"[object Object] =>\\": {
- \\"foo\\": \\"bar\\",
- \\"qux\\": 2
+ "m": {
+ "Map(2)": {
+ "1 =>": "foo",
+ "[object Object] =>": {
+ "foo": "bar",
+ "qux": 2
}
}
},
- \\"s\\": {
- \\"Set(3)\\": [
+ "s": {
+ "Set(3)": [
1,
{
- \\"foo\\": \\"bar\\"
+ "foo": "bar"
},
{
- \\"Map(2)\\": {
- \\"1 =>\\": \\"foo\\",
- \\"[object Object] =>\\": {
- \\"foo\\": \\"bar\\",
- \\"qux\\": 2
+ "Map(2)": {
+ "1 =>": "foo",
+ "[object Object] =>": {
+ "foo": "bar",
+ "qux": 2
}
}
}
@@ -171,4 +171,49 @@ describe('toDisplayString', () => {
}"
`)
})
+
+ //#9727
+ test('Map with Symbol keys', () => {
+ const m = new Map([
+ [Symbol(), 'foo'],
+ [Symbol(), 'bar'],
+ [Symbol('baz'), 'baz'],
+ ])
+ expect(toDisplayString(m)).toMatchInlineSnapshot(`
+ "{
+ "Map(3)": {
+ "Symbol(0) =>": "foo",
+ "Symbol(1) =>": "bar",
+ "Symbol(baz) =>": "baz"
+ }
+ }"
+ `)
+ // confirming the symbol renders Symbol(foo)
+ expect(toDisplayString(new Map([[Symbol('foo'), 'foo']]))).toContain(
+ String(Symbol('foo')),
+ )
+ })
+
+ test('Set with Symbol values', () => {
+ const s = new Set([Symbol('foo'), Symbol('bar'), Symbol()])
+ expect(toDisplayString(s)).toMatchInlineSnapshot(`
+ "{
+ "Set(3)": [
+ "Symbol(foo)",
+ "Symbol(bar)",
+ "Symbol()"
+ ]
+ }"
+ `)
+ })
+
+ test('Object with Symbol values', () => {
+ expect(toDisplayString({ foo: Symbol('x'), bar: Symbol() }))
+ .toMatchInlineSnapshot(`
+ "{
+ "foo": "Symbol(x)",
+ "bar": "Symbol()"
+ }"
+ `)
+ })
})
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 836f78dc1f1..75bae9b0d9c 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/shared",
- "version": "3.3.4",
+ "version": "3.4.15",
"description": "internal utils shared across @vue packages",
"main": "index.js",
"module": "dist/shared.esm-bundler.js",
@@ -9,6 +9,20 @@
"index.js",
"dist"
],
+ "exports": {
+ ".": {
+ "types": "./dist/shared.d.ts",
+ "node": {
+ "production": "./dist/shared.cjs.prod.js",
+ "development": "./dist/shared.cjs.js",
+ "default": "./index.js"
+ },
+ "module": "./dist/shared.esm-bundler.js",
+ "import": "./dist/shared.esm-bundler.js",
+ "require": "./index.js"
+ },
+ "./*": "./*"
+ },
"sideEffects": false,
"buildOptions": {
"formats": [
diff --git a/packages/shared/src/codeframe.ts b/packages/shared/src/codeframe.ts
index 82b38bfb330..af7212166ee 100644
--- a/packages/shared/src/codeframe.ts
+++ b/packages/shared/src/codeframe.ts
@@ -3,7 +3,7 @@ const range: number = 2
export function generateCodeFrame(
source: string,
start = 0,
- end = source.length
+ end = source.length,
): string {
// Split the content into individual lines but capture the newline sequence
// that separated each line. This is important because the actual sequence is
@@ -28,7 +28,7 @@ export function generateCodeFrame(
res.push(
`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${
lines[j]
- }`
+ }`,
)
const lineLength = lines[j].length
const newLineSeqLength =
@@ -39,7 +39,7 @@ export function generateCodeFrame(
const pad = start - (count - (lineLength + newLineSeqLength))
const length = Math.max(
1,
- end > count ? lineLength - pad : end - start
+ end > count ? lineLength - pad : end - start,
)
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length))
} else if (j > i) {
diff --git a/packages/shared/src/domAttrConfig.ts b/packages/shared/src/domAttrConfig.ts
index 5f7f851b0df..758dfb307be 100644
--- a/packages/shared/src/domAttrConfig.ts
+++ b/packages/shared/src/domAttrConfig.ts
@@ -21,7 +21,7 @@ export const isBooleanAttr = /*#__PURE__*/ makeMap(
specialBooleanAttrs +
`,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
`inert,loop,open,required,reversed,scoped,seamless,` +
- `checked,muted,multiple,selected`
+ `checked,muted,multiple,selected`,
)
/**
@@ -50,7 +50,7 @@ export const propsToAttrMap: Record = {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
- httpEquiv: 'http-equiv'
+ httpEquiv: 'http-equiv',
}
/**
@@ -74,7 +74,7 @@ export const isKnownHtmlAttr = /*#__PURE__*/ makeMap(
`referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
`selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
`start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
- `value,width,wrap`
+ `value,width,wrap`,
)
/**
@@ -118,6 +118,17 @@ export const isKnownSvgAttr = /*#__PURE__*/ makeMap(
`v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
`vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
`writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
+ `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,` +
+ `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`,
)
+
+/**
+ * Shared between server-renderer and runtime-core hydration logic
+ */
+export function isRenderableAttrValue(value: unknown): boolean {
+ if (value == null) {
+ return false
+ }
+ const type = typeof value
+ return type === 'string' || type === 'number' || type === 'boolean'
+}
diff --git a/packages/shared/src/domTagConfig.ts b/packages/shared/src/domTagConfig.ts
index 535aa6be718..000432298ff 100644
--- a/packages/shared/src/domTagConfig.ts
+++ b/packages/shared/src/domTagConfig.ts
@@ -27,6 +27,14 @@ const SVG_TAGS =
'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
'text,textPath,title,tspan,unknown,use,view'
+// https://www.w3.org/TR/mathml4/ (content elements excluded)
+const MATH_TAGS =
+ 'annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,' +
+ 'merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,' +
+ 'mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,' +
+ 'mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,' +
+ 'msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics'
+
const VOID_TAGS =
'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'
@@ -40,6 +48,11 @@ export const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS)
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
*/
export const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS)
+/**
+ * Compiler only.
+ * Do NOT use in runtime code paths unless behind `__DEV__` flag.
+ */
+export const isMathMLTag = /*#__PURE__*/ makeMap(MATH_TAGS)
/**
* Compiler only.
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
diff --git a/packages/shared/src/general.ts b/packages/shared/src/general.ts
index 6efaf52524f..e04b961227a 100644
--- a/packages/shared/src/general.ts
+++ b/packages/shared/src/general.ts
@@ -12,8 +12,11 @@ export const NOOP = () => {}
*/
export const NO = () => false
-const onRE = /^on[^a-z]/
-export const isOn = (key: string) => onRE.test(key)
+export const isOn = (key: string) =>
+ key.charCodeAt(0) === 111 /* o */ &&
+ key.charCodeAt(1) === 110 /* n */ &&
+ // uppercase letter
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97)
export const isModelListener = (key: string) => key.startsWith('onUpdate:')
@@ -29,7 +32,7 @@ export const remove = (arr: T[], el: T) => {
const hasOwnProperty = Object.prototype.hasOwnProperty
export const hasOwn = (
val: object,
- key: string | symbol
+ key: string | symbol,
): key is keyof typeof val => hasOwnProperty.call(val, key)
export const isArray = Array.isArray
@@ -50,7 +53,11 @@ export const isObject = (val: unknown): val is Record =>
val !== null && typeof val === 'object'
export const isPromise = (val: unknown): val is Promise => {
- return isObject(val) && isFunction(val.then) && isFunction(val.catch)
+ return (
+ (isObject(val) || isFunction(val)) &&
+ isFunction((val as any).then) &&
+ isFunction((val as any).catch)
+ )
}
export const objectToString = Object.prototype.toString
@@ -76,11 +83,11 @@ export const isReservedProp = /*#__PURE__*/ makeMap(
',key,ref,ref_for,ref_key,' +
'onVnodeBeforeMount,onVnodeMounted,' +
'onVnodeBeforeUpdate,onVnodeUpdated,' +
- 'onVnodeBeforeUnmount,onVnodeUnmounted'
+ 'onVnodeBeforeUnmount,onVnodeUnmounted',
)
export const isBuiltInDirective = /*#__PURE__*/ makeMap(
- 'bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo'
+ 'bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo',
)
const cacheStringFunction = string>(fn: T): T => {
@@ -104,22 +111,23 @@ const hyphenateRE = /\B([A-Z])/g
* @private
*/
export const hyphenate = cacheStringFunction((str: string) =>
- str.replace(hyphenateRE, '-$1').toLowerCase()
+ str.replace(hyphenateRE, '-$1').toLowerCase(),
)
/**
* @private
*/
-export const capitalize = cacheStringFunction(
- (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
-)
+export const capitalize = cacheStringFunction((str: T) => {
+ return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize
+})
/**
* @private
*/
-export const toHandlerKey = cacheStringFunction((str: string) =>
- str ? `on${capitalize(str)}` : ``
-)
+export const toHandlerKey = cacheStringFunction((str: T) => {
+ const s = str ? `on${capitalize(str)}` : ``
+ return s as T extends '' ? '' : `on${Capitalize}`
+})
// compare whether a value has changed, accounting for NaN.
export const hasChanged = (value: any, oldValue: any): boolean =>
@@ -135,7 +143,7 @@ export const def = (obj: object, key: string | symbol, value: any) => {
Object.defineProperty(obj, key, {
configurable: true,
enumerable: false,
- value
+ value,
})
}
@@ -149,7 +157,7 @@ export const looseToNumber = (val: any): any => {
}
/**
- * Only conerces number-like strings
+ * Only concerns number-like strings
* "123-foo" will be returned as-is
*/
export const toNumber = (val: any): any => {
@@ -165,12 +173,12 @@ export const getGlobalThis = (): any => {
typeof globalThis !== 'undefined'
? globalThis
: typeof self !== 'undefined'
- ? self
- : typeof window !== 'undefined'
- ? window
- : typeof global !== 'undefined'
- ? global
- : {})
+ ? self
+ : typeof window !== 'undefined'
+ ? window
+ : typeof global !== 'undefined'
+ ? global
+ : {})
)
}
diff --git a/packages/shared/src/globalsWhitelist.ts b/packages/shared/src/globalsAllowList.ts
similarity index 54%
rename from packages/shared/src/globalsWhitelist.ts
rename to packages/shared/src/globalsAllowList.ts
index 9485a41dafa..210650e3e2b 100644
--- a/packages/shared/src/globalsWhitelist.ts
+++ b/packages/shared/src/globalsAllowList.ts
@@ -1,8 +1,11 @@
import { makeMap } from './makeMap'
-const GLOBALS_WHITE_LISTED =
+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'
+ 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error'
-export const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED)
+export const isGloballyAllowed = /*#__PURE__*/ makeMap(GLOBALS_ALLOWED)
+
+/** @deprecated use `isGloballyAllowed` instead */
+export const isGloballyWhitelisted = isGloballyAllowed
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 2e7292f0eac..11580a06435 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -3,7 +3,7 @@ export * from './general'
export * from './patchFlags'
export * from './shapeFlags'
export * from './slotFlags'
-export * from './globalsWhitelist'
+export * from './globalsAllowList'
export * from './codeframe'
export * from './normalizeProp'
export * from './domTagConfig'
diff --git a/packages/shared/src/makeMap.ts b/packages/shared/src/makeMap.ts
index b598704c673..f11cc407c6f 100644
--- a/packages/shared/src/makeMap.ts
+++ b/packages/shared/src/makeMap.ts
@@ -7,12 +7,10 @@
*/
export function makeMap(
str: string,
- expectsLowerCase?: boolean
+ expectsLowerCase?: boolean,
): (key: string) => boolean {
- const map: Record = Object.create(null)
- const list: Array = str.split(',')
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true
- }
- return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val]
+ const set = new Set(str.split(','))
+ return expectsLowerCase
+ ? val => set.has(val.toLowerCase())
+ : val => set.has(val)
}
diff --git a/packages/shared/src/normalizeProp.ts b/packages/shared/src/normalizeProp.ts
index 6a1dd20e393..07e782d44f1 100644
--- a/packages/shared/src/normalizeProp.ts
+++ b/packages/shared/src/normalizeProp.ts
@@ -1,9 +1,9 @@
-import { isArray, isString, isObject, hyphenate } from './general'
+import { hyphenate, isArray, isObject, isString } from './general'
export type NormalizedStyle = Record
export function normalizeStyle(
- value: unknown
+ value: unknown,
): NormalizedStyle | string | undefined {
if (isArray(value)) {
const res: NormalizedStyle = {}
@@ -19,9 +19,7 @@ export function normalizeStyle(
}
}
return res
- } else if (isString(value)) {
- return value
- } else if (isObject(value)) {
+ } else if (isString(value) || isObject(value)) {
return value
}
}
@@ -45,7 +43,7 @@ export function parseStringStyle(cssText: string): NormalizedStyle {
}
export function stringifyStyle(
- styles: NormalizedStyle | string | undefined
+ styles: NormalizedStyle | string | undefined,
): string {
let ret = ''
if (!styles || isString(styles)) {
diff --git a/packages/shared/src/patchFlags.ts b/packages/shared/src/patchFlags.ts
index 58e8935aeb8..009b714737f 100644
--- a/packages/shared/src/patchFlags.ts
+++ b/packages/shared/src/patchFlags.ts
@@ -16,7 +16,7 @@
* Check the `patchElement` function in '../../runtime-core/src/renderer.ts' to see how the
* flags are handled during diff.
*/
-export const enum PatchFlags {
+export enum PatchFlags {
/**
* Indicates an element with dynamic textContent (children fast path)
*/
@@ -57,10 +57,11 @@ export const enum PatchFlags {
FULL_PROPS = 1 << 4,
/**
- * Indicates an element with event listeners (which need to be attached
- * during hydration)
+ * Indicates an element that requires props hydration
+ * (but not necessarily patching)
+ * e.g. event listeners & v-bind with prop modifier
*/
- HYDRATE_EVENTS = 1 << 5,
+ NEED_HYDRATION = 1 << 5,
/**
* Indicates a fragment whose children order doesn't change.
@@ -119,7 +120,7 @@ export const enum PatchFlags {
* render functions, which should always be fully diffed)
* OR manually cloneVNodes
*/
- BAIL = -2
+ BAIL = -2,
}
/**
@@ -131,7 +132,7 @@ export const PatchFlagNames: Record = {
[PatchFlags.STYLE]: `STYLE`,
[PatchFlags.PROPS]: `PROPS`,
[PatchFlags.FULL_PROPS]: `FULL_PROPS`,
- [PatchFlags.HYDRATE_EVENTS]: `HYDRATE_EVENTS`,
+ [PatchFlags.NEED_HYDRATION]: `NEED_HYDRATION`,
[PatchFlags.STABLE_FRAGMENT]: `STABLE_FRAGMENT`,
[PatchFlags.KEYED_FRAGMENT]: `KEYED_FRAGMENT`,
[PatchFlags.UNKEYED_FRAGMENT]: `UNKEYED_FRAGMENT`,
@@ -139,5 +140,5 @@ export const PatchFlagNames: Record = {
[PatchFlags.DYNAMIC_SLOTS]: `DYNAMIC_SLOTS`,
[PatchFlags.DEV_ROOT_FRAGMENT]: `DEV_ROOT_FRAGMENT`,
[PatchFlags.HOISTED]: `HOISTED`,
- [PatchFlags.BAIL]: `BAIL`
+ [PatchFlags.BAIL]: `BAIL`,
}
diff --git a/packages/shared/src/shapeFlags.ts b/packages/shared/src/shapeFlags.ts
index 8defb8a3bf3..855d159ea59 100644
--- a/packages/shared/src/shapeFlags.ts
+++ b/packages/shared/src/shapeFlags.ts
@@ -1,4 +1,4 @@
-export const enum ShapeFlags {
+export enum ShapeFlags {
ELEMENT = 1,
FUNCTIONAL_COMPONENT = 1 << 1,
STATEFUL_COMPONENT = 1 << 2,
@@ -9,5 +9,5 @@ export const enum ShapeFlags {
SUSPENSE = 1 << 7,
COMPONENT_SHOULD_KEEP_ALIVE = 1 << 8,
COMPONENT_KEPT_ALIVE = 1 << 9,
- COMPONENT = ShapeFlags.STATEFUL_COMPONENT | ShapeFlags.FUNCTIONAL_COMPONENT
+ COMPONENT = ShapeFlags.STATEFUL_COMPONENT | ShapeFlags.FUNCTIONAL_COMPONENT,
}
diff --git a/packages/shared/src/slotFlags.ts b/packages/shared/src/slotFlags.ts
index 53860ff4dd1..e7892343d5c 100644
--- a/packages/shared/src/slotFlags.ts
+++ b/packages/shared/src/slotFlags.ts
@@ -1,4 +1,4 @@
-export const enum SlotFlags {
+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
@@ -17,7 +17,7 @@ export const enum SlotFlags {
* received. This has to be refined at runtime, when the child's vnode
* is being created (in `normalizeChildren`)
*/
- FORWARDED = 3
+ FORWARDED = 3,
}
/**
@@ -26,5 +26,5 @@ export const enum SlotFlags {
export const slotFlagsText = {
[SlotFlags.STABLE]: 'STABLE',
[SlotFlags.DYNAMIC]: 'DYNAMIC',
- [SlotFlags.FORWARDED]: 'FORWARDED'
+ [SlotFlags.FORWARDED]: 'FORWARDED',
}
diff --git a/packages/shared/src/toDisplayString.ts b/packages/shared/src/toDisplayString.ts
index 7f5818d9491..aff107cd97f 100644
--- a/packages/shared/src/toDisplayString.ts
+++ b/packages/shared/src/toDisplayString.ts
@@ -1,12 +1,13 @@
import {
isArray,
+ isFunction,
isMap,
isObject,
- isFunction,
isPlainObject,
isSet,
+ isString,
+ isSymbol,
objectToString,
- isString
} from './general'
/**
@@ -17,12 +18,12 @@ export const toDisplayString = (val: unknown): string => {
return isString(val)
? val
: val == null
- ? ''
- : isArray(val) ||
- (isObject(val) &&
- (val.toString === objectToString || !isFunction(val.toString)))
- ? JSON.stringify(val, replacer, 2)
- : String(val)
+ ? ''
+ : isArray(val) ||
+ (isObject(val) &&
+ (val.toString === objectToString || !isFunction(val.toString)))
+ ? JSON.stringify(val, replacer, 2)
+ : String(val)
}
const replacer = (_key: string, val: any): any => {
@@ -31,17 +32,26 @@ const replacer = (_key: string, val: any): any => {
return replacer(_key, val.value)
} else if (isMap(val)) {
return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
- ;(entries as any)[`${key} =>`] = val
- return entries
- }, {})
+ [`Map(${val.size})`]: [...val.entries()].reduce(
+ (entries, [key, val], i) => {
+ entries[stringifySymbol(key, i) + ' =>'] = val
+ return entries
+ },
+ {} as Record,
+ ),
}
} else if (isSet(val)) {
return {
- [`Set(${val.size})`]: [...val.values()]
+ [`Set(${val.size})`]: [...val.values()].map(v => stringifySymbol(v)),
}
+ } else if (isSymbol(val)) {
+ return stringifySymbol(val)
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
+ // native elements
return String(val)
}
return val
}
+
+const stringifySymbol = (v: unknown, i: number | string = ''): any =>
+ isSymbol(v) ? `Symbol(${v.description ?? i})` : v
diff --git a/packages/shared/src/typeUtils.ts b/packages/shared/src/typeUtils.ts
index 67fb47c23b3..63372d82916 100644
--- a/packages/shared/src/typeUtils.ts
+++ b/packages/shared/src/typeUtils.ts
@@ -12,3 +12,12 @@ export type LooseRequired = { [P in keyof (T & Required)]: T[P] }
// If the type T accepts type "any", output type Y, otherwise output type N.
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
export type IfAny = 0 extends 1 & T ? Y : N
+
+// To prevent users with TypeScript versions lower than 4.5 from encountering unsupported Awaited type, a copy has been made here.
+export type Awaited = T extends null | undefined
+ ? T // special case for `null | undefined` when not in `--strictNullChecks` mode
+ : T extends object & { then(onfulfilled: infer F, ...args: infer _): any } // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
+ ? F extends (value: infer V, ...args: infer _) => any // if the argument to `then` is callable, extracts the first argument
+ ? Awaited // recursively unwrap the value
+ : never // the argument to `then` was not callable
+ : T // non-object or non-thenable
diff --git a/packages/size-check/README.md b/packages/size-check/README.md
deleted file mode 100644
index 23cf1899eaf..00000000000
--- a/packages/size-check/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Size Check
-
-This package is private and is used for checking the baseline runtime size after tree-shaking (with only the bare minimal code required to render something to the screen).
diff --git a/packages/size-check/brotli.js b/packages/size-check/brotli.js
deleted file mode 100644
index f9dedac0b1c..00000000000
--- a/packages/size-check/brotli.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const { brotliCompressSync } = require('zlib')
-
-const file = require('fs').readFileSync('dist/index.js')
-const compressed = brotliCompressSync(file)
-const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
-console.log(`brotli: ${compressedSize}`)
diff --git a/packages/size-check/package.json b/packages/size-check/package.json
deleted file mode 100644
index 1f9fba88594..00000000000
--- a/packages/size-check/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "@vue/size-check",
- "version": "3.3.4",
- "private": true,
- "scripts": {
- "build": "vite build"
- },
- "dependencies": {
- "vue": "workspace:*"
- }
-}
diff --git a/packages/size-check/src/index.ts b/packages/size-check/src/index.ts
deleted file mode 100644
index ad3b68a5cc1..00000000000
--- a/packages/size-check/src/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { h, createApp } from 'vue'
-
-// The bare minimum code required for rendering something to the screen
-createApp({
- render: () => h('div', 'hello world!')
-}).mount('#app')
diff --git a/packages/size-check/vite.config.js b/packages/size-check/vite.config.js
deleted file mode 100644
index 73721f95910..00000000000
--- a/packages/size-check/vite.config.js
+++ /dev/null
@@ -1,15 +0,0 @@
-export default {
- define: {
- __VUE_PROD_DEVTOOLS__: false,
- __VUE_OPTIONS_API__: true
- },
- build: {
- rollupOptions: {
- input: ['src/index.ts'],
- output: {
- entryFileNames: `[name].js`
- }
- },
- minify: 'terser'
- }
-}
diff --git a/packages/template-explorer/package.json b/packages/template-explorer/package.json
index 320b4c05ed3..ec3ad73ac4c 100644
--- a/packages/template-explorer/package.json
+++ b/packages/template-explorer/package.json
@@ -1,7 +1,7 @@
{
"name": "@vue/template-explorer",
- "version": "3.3.4",
"private": true,
+ "version": "0.0.0",
"buildOptions": {
"formats": [
"global"
@@ -11,7 +11,7 @@
"enableNonBrowserBranches": true
},
"dependencies": {
- "monaco-editor": "^0.20.0",
+ "monaco-editor": "^0.45.0",
"source-map-js": "^1.0.2"
}
}
diff --git a/packages/template-explorer/src/index.ts b/packages/template-explorer/src/index.ts
index bace011ed89..988712d623c 100644
--- a/packages/template-explorer/src/index.ts
+++ b/packages/template-explorer/src/index.ts
@@ -1,11 +1,15 @@
-import * as m from 'monaco-editor'
-import { compile, CompilerError, CompilerOptions } from '@vue/compiler-dom'
+import type * as m from 'monaco-editor'
+import {
+ type CompilerError,
+ type CompilerOptions,
+ compile,
+} from '@vue/compiler-dom'
import { compile as ssrCompile } from '@vue/compiler-ssr'
import {
- defaultOptions,
compilerOptions,
+ defaultOptions,
initOptions,
- ssrMode
+ ssrMode,
} from './options'
import { toRaw, watchEffect } from '@vue/runtime-dom'
import { SourceMapConsumer } from 'source-map-js'
@@ -30,8 +34,8 @@ const sharedEditorOptions: m.editor.IStandaloneEditorConstructionOptions = {
scrollBeyondLastLine: false,
renderWhitespace: 'selection',
minimap: {
- enabled: false
- }
+ enabled: false,
+ },
}
window.init = () => {
@@ -48,13 +52,13 @@ window.init = () => {
hash = escape(atob(hash))
} catch (e) {}
persistedState = JSON.parse(
- decodeURIComponent(hash) || localStorage.getItem('state') || `{}`
+ decodeURIComponent(hash) || localStorage.getItem('state') || `{}`,
)
} catch (e: any) {
// bad stored state, clear it
console.warn(
'Persisted state in localStorage seems to be corrupted, please reload.\n' +
- e.message
+ e.message,
)
localStorage.clear()
}
@@ -76,18 +80,18 @@ window.init = () => {
const compileFn = ssrMode.value ? ssrCompile : compile
const start = performance.now()
const { code, ast, map } = compileFn(source, {
- filename: 'ExampleTemplate.vue',
...compilerOptions,
+ filename: 'ExampleTemplate.vue',
sourceMap: true,
onError: err => {
errors.push(err)
- }
+ },
})
console.log(`Compiled in ${(performance.now() - start).toFixed(2)}ms.`)
monaco.editor.setModelMarkers(
editor.getModel()!,
`@vue/compiler-dom`,
- errors.filter(e => e.loc).map(formatError)
+ errors.filter(e => e.loc).map(formatError),
)
console.log(`AST: `, ast)
console.log(`Options: `, toRaw(compilerOptions))
@@ -110,7 +114,7 @@ window.init = () => {
endLineNumber: loc.end.line,
endColumn: loc.end.column,
message: `Vue template compilation error: ${err.message}`,
- code: String(err.code)
+ code: String(err.code),
}
}
@@ -123,7 +127,7 @@ window.init = () => {
for (key in compilerOptions) {
const val = compilerOptions[key]
if (typeof val !== 'object' && val !== defaultOptions[key]) {
- // @ts-ignore
+ // @ts-expect-error
optionsToSave[key] = val
}
}
@@ -131,7 +135,7 @@ window.init = () => {
const state = JSON.stringify({
src,
ssr: ssrMode.value,
- options: optionsToSave
+ options: optionsToSave,
} as PersistedState)
localStorage.setItem('state', state)
window.location.hash = btoa(unescape(encodeURIComponent(state)))
@@ -145,21 +149,21 @@ window.init = () => {
value: persistedState?.src || `Hello World
`,
language: 'html',
...sharedEditorOptions,
- wordWrap: 'bounded'
+ wordWrap: 'bounded',
})
editor.getModel()!.updateOptions({
- tabSize: 2
+ tabSize: 2,
})
const output = monaco.editor.create(document.getElementById('output')!, {
value: '',
language: 'javascript',
readOnly: true,
- ...sharedEditorOptions
+ ...sharedEditorOptions,
})
output.getModel()!.updateOptions({
- tabSize: 2
+ tabSize: 2,
})
// handle resize
@@ -184,7 +188,7 @@ window.init = () => {
const pos = lastSuccessfulMap.generatedPositionFor({
source: 'ExampleTemplate.vue',
line: e.position.lineNumber,
- column: e.position.column - 1
+ column: e.position.column - 1,
})
if (pos.line != null && pos.column != null) {
prevOutputDecos = output.deltaDecorations(prevOutputDecos, [
@@ -193,22 +197,22 @@ window.init = () => {
pos.line,
pos.column + 1,
pos.line,
- pos.lastColumn ? pos.lastColumn + 2 : pos.column + 2
+ pos.lastColumn ? pos.lastColumn + 2 : pos.column + 2,
),
options: {
- inlineClassName: `highlight`
- }
- }
+ inlineClassName: `highlight`,
+ },
+ },
])
output.revealPositionInCenter({
lineNumber: pos.line,
- column: pos.column + 1
+ column: pos.column + 1,
})
} else {
clearOutputDecos()
}
}
- }, 100)
+ }, 100),
)
let previousEditorDecos: string[] = []
@@ -222,7 +226,7 @@ window.init = () => {
if (lastSuccessfulMap) {
const pos = lastSuccessfulMap.originalPositionFor({
line: e.position.lineNumber,
- column: e.position.column - 1
+ column: e.position.column - 1,
})
if (
pos.line != null &&
@@ -234,7 +238,7 @@ window.init = () => {
) {
const translatedPos = {
column: pos.column + 1,
- lineNumber: pos.line
+ lineNumber: pos.line,
}
previousEditorDecos = editor.deltaDecorations(previousEditorDecos, [
{
@@ -242,20 +246,20 @@ window.init = () => {
pos.line,
pos.column + 1,
pos.line,
- pos.column + 1
+ pos.column + 1,
),
options: {
isWholeLine: true,
- className: `highlight`
- }
- }
+ className: `highlight`,
+ },
+ },
])
editor.revealPositionInCenter(translatedPos)
} else {
clearEditorDecos()
}
}
- }, 100)
+ }, 100),
)
initOptions()
@@ -264,7 +268,7 @@ window.init = () => {
function debounce any>(
fn: T,
- delay: number = 300
+ delay: number = 300,
): T {
let prevTimer: number | null = null
return ((...args: any[]) => {
diff --git a/packages/template-explorer/src/options.ts b/packages/template-explorer/src/options.ts
index 73e0a959f79..e3cc6173a8a 100644
--- a/packages/template-explorer/src/options.ts
+++ b/packages/template-explorer/src/options.ts
@@ -1,5 +1,5 @@
-import { h, reactive, createApp, ref } from 'vue'
-import { CompilerOptions } from '@vue/compiler-dom'
+import { createApp, h, reactive, ref } from 'vue'
+import type { CompilerOptions } from '@vue/compiler-dom'
import { BindingTypes } from '@vue/compiler-core'
export const ssrMode = ref(false)
@@ -22,12 +22,12 @@ export const defaultOptions: CompilerOptions = {
setupLet: BindingTypes.SETUP_LET,
setupMaybeRef: BindingTypes.SETUP_MAYBE_REF,
setupProp: BindingTypes.PROPS,
- vMySetupDir: BindingTypes.SETUP_CONST
- }
+ vMySetupDir: BindingTypes.SETUP_CONST,
+ },
}
export const compilerOptions: CompilerOptions = reactive(
- Object.assign({}, defaultOptions)
+ Object.assign({}, defaultOptions),
)
const App = {
@@ -44,18 +44,18 @@ const App = {
'a',
{
href: `https://github.com/vuejs/core/tree/${__COMMIT__}`,
- target: `_blank`
+ target: `_blank`,
},
- `@${__COMMIT__}`
+ `@${__COMMIT__}`,
),
' | ',
h(
'a',
{
href: 'https://app.netlify.com/sites/vue-next-template-explorer/deploys',
- target: `_blank`
+ target: `_blank`,
},
- 'History'
+ 'History',
),
h('div', { id: 'options-wrapper' }, [
@@ -71,7 +71,7 @@ const App = {
checked: isModule,
onChange() {
compilerOptions.mode = 'module'
- }
+ },
}),
h('label', { for: 'mode-module' }, 'module'),
' ',
@@ -82,9 +82,9 @@ const App = {
checked: !isModule,
onChange() {
compilerOptions.mode = 'function'
- }
+ },
}),
- h('label', { for: 'mode-function' }, 'function')
+ h('label', { for: 'mode-function' }, 'function'),
]),
// whitespace handling
@@ -97,7 +97,7 @@ const App = {
checked: compilerOptions.whitespace === 'condense',
onChange() {
compilerOptions.whitespace = 'condense'
- }
+ },
}),
h('label', { for: 'whitespace-condense' }, 'condense'),
' ',
@@ -108,9 +108,9 @@ const App = {
checked: compilerOptions.whitespace === 'preserve',
onChange() {
compilerOptions.whitespace = 'preserve'
- }
+ },
}),
- h('label', { for: 'whitespace-preserve' }, 'preserve')
+ h('label', { for: 'whitespace-preserve' }, 'preserve'),
]),
// SSR
@@ -122,9 +122,9 @@ const App = {
checked: ssrMode.value,
onChange(e: Event) {
ssrMode.value = (e.target as HTMLInputElement).checked
- }
+ },
}),
- h('label', { for: 'ssr' }, 'SSR')
+ h('label', { for: 'ssr' }, 'SSR'),
]),
// toggle prefixIdentifiers
@@ -137,9 +137,9 @@ const App = {
onChange(e: Event) {
compilerOptions.prefixIdentifiers =
(e.target as HTMLInputElement).checked || isModule
- }
+ },
}),
- h('label', { for: 'prefix' }, 'prefixIdentifiers')
+ h('label', { for: 'prefix' }, 'prefixIdentifiers'),
]),
// toggle hoistStatic
@@ -153,9 +153,9 @@ const App = {
compilerOptions.hoistStatic = (
e.target as HTMLInputElement
).checked
- }
+ },
}),
- h('label', { for: 'hoist' }, 'hoistStatic')
+ h('label', { for: 'hoist' }, 'hoistStatic'),
]),
// toggle cacheHandlers
@@ -169,9 +169,9 @@ const App = {
compilerOptions.cacheHandlers = (
e.target as HTMLInputElement
).checked
- }
+ },
}),
- h('label', { for: 'cache' }, 'cacheHandlers')
+ h('label', { for: 'cache' }, 'cacheHandlers'),
]),
// toggle scopeId
@@ -186,9 +186,9 @@ const App = {
isModule && (e.target as HTMLInputElement).checked
? 'scope-id'
: null
- }
+ },
}),
- h('label', { for: 'scope-id' }, 'scopeId')
+ h('label', { for: 'scope-id' }, 'scopeId'),
]),
// inline mode
@@ -201,9 +201,9 @@ const App = {
compilerOptions.inline = (
e.target as HTMLInputElement
).checked
- }
+ },
}),
- h('label', { for: 'inline' }, 'inline')
+ h('label', { for: 'inline' }, 'inline'),
]),
// compat mode
@@ -218,15 +218,15 @@ const App = {
).checked
? 2
: 3
- }
+ },
}),
- h('label', { for: 'compat' }, 'v2 compat mode')
- ])
- ])
- ])
+ h('label', { for: 'compat' }, 'v2 compat mode'),
+ ]),
+ ]),
+ ]),
]
}
- }
+ },
}
export function initOptions() {
diff --git a/packages/template-explorer/src/theme.ts b/packages/template-explorer/src/theme.ts
index 99da1081ae9..9027cd0c011 100644
--- a/packages/template-explorer/src/theme.ts
+++ b/packages/template-explorer/src/theme.ts
@@ -4,234 +4,234 @@ export default {
rules: [
{
foreground: 'de935f',
- token: 'number'
+ token: 'number',
},
{
foreground: '969896',
- token: 'comment'
+ token: 'comment',
},
{
foreground: 'ced1cf',
- token: 'keyword.operator.class'
+ token: 'keyword.operator.class',
},
{
foreground: 'ced1cf',
- token: 'constant.other'
+ token: 'constant.other',
},
{
foreground: 'ced1cf',
- token: 'source.php.embedded.line'
+ token: 'source.php.embedded.line',
},
{
foreground: 'cc6666',
- token: 'variable'
+ token: 'variable',
},
{
foreground: 'cc6666',
- token: 'support.other.variable'
+ token: 'support.other.variable',
},
{
foreground: 'cc6666',
- token: 'string.other.link'
+ token: 'string.other.link',
},
{
foreground: 'cc6666',
- token: 'string.regexp'
+ token: 'string.regexp',
},
{
foreground: 'cc6666',
- token: 'entity.name.tag'
+ token: 'entity.name.tag',
},
{
foreground: 'cc6666',
- token: 'entity.other.attribute-name'
+ token: 'entity.other.attribute-name',
},
{
foreground: 'cc6666',
- token: 'meta.tag'
+ token: 'meta.tag',
},
{
foreground: 'cc6666',
- token: 'declaration.tag'
+ token: 'declaration.tag',
},
{
foreground: 'cc6666',
- token: 'markup.deleted.git_gutter'
+ token: 'markup.deleted.git_gutter',
},
{
foreground: 'de935f',
- token: 'constant.numeric'
+ token: 'constant.numeric',
},
{
foreground: 'de935f',
- token: 'constant.language'
+ token: 'constant.language',
},
{
foreground: 'de935f',
- token: 'support.constant'
+ token: 'support.constant',
},
{
foreground: 'de935f',
- token: 'constant.character'
+ token: 'constant.character',
},
{
foreground: 'de935f',
- token: 'variable.parameter'
+ token: 'variable.parameter',
},
{
foreground: 'de935f',
- token: 'punctuation.section.embedded'
+ token: 'punctuation.section.embedded',
},
{
foreground: 'de935f',
- token: 'keyword.other.unit'
+ token: 'keyword.other.unit',
},
{
foreground: 'f0c674',
- token: 'entity.name.class'
+ token: 'entity.name.class',
},
{
foreground: 'f0c674',
- token: 'entity.name.type.class'
+ token: 'entity.name.type.class',
},
{
foreground: 'f0c674',
- token: 'support.type'
+ token: 'support.type',
},
{
foreground: 'f0c674',
- token: 'support.class'
+ token: 'support.class',
},
{
foreground: 'b5bd68',
- token: 'string'
+ token: 'string',
},
{
foreground: 'b5bd68',
- token: 'constant.other.symbol'
+ token: 'constant.other.symbol',
},
{
foreground: 'b5bd68',
- token: 'entity.other.inherited-class'
+ token: 'entity.other.inherited-class',
},
{
foreground: 'b5bd68',
- token: 'markup.heading'
+ token: 'markup.heading',
},
{
foreground: 'b5bd68',
- token: 'markup.inserted.git_gutter'
+ token: 'markup.inserted.git_gutter',
},
{
foreground: '8abeb7',
- token: 'keyword.operator'
+ token: 'keyword.operator',
},
{
foreground: '8abeb7',
- token: 'constant.other.color'
+ token: 'constant.other.color',
},
{
foreground: '81a2be',
- token: 'entity.name.function'
+ token: 'entity.name.function',
},
{
foreground: '81a2be',
- token: 'meta.function-call'
+ token: 'meta.function-call',
},
{
foreground: '81a2be',
- token: 'support.function'
+ token: 'support.function',
},
{
foreground: '81a2be',
- token: 'keyword.other.special-method'
+ token: 'keyword.other.special-method',
},
{
foreground: '81a2be',
- token: 'meta.block-level'
+ token: 'meta.block-level',
},
{
foreground: '81a2be',
- token: 'markup.changed.git_gutter'
+ token: 'markup.changed.git_gutter',
},
{
foreground: 'b294bb',
- token: 'keyword'
+ token: 'keyword',
},
{
foreground: 'b294bb',
- token: 'storage'
+ token: 'storage',
},
{
foreground: 'b294bb',
- token: 'storage.type'
+ token: 'storage.type',
},
{
foreground: 'b294bb',
- token: 'entity.name.tag.css'
+ token: 'entity.name.tag.css',
},
{
foreground: 'ced2cf',
background: 'df5f5f',
- token: 'invalid'
+ token: 'invalid',
},
{
foreground: 'ced2cf',
background: '82a3bf',
- token: 'meta.separator'
+ token: 'meta.separator',
},
{
foreground: 'ced2cf',
background: 'b798bf',
- token: 'invalid.deprecated'
+ token: 'invalid.deprecated',
},
{
foreground: 'ffffff',
- token: 'markup.inserted.diff'
+ token: 'markup.inserted.diff',
},
{
foreground: 'ffffff',
- token: 'markup.deleted.diff'
+ token: 'markup.deleted.diff',
},
{
foreground: 'ffffff',
- token: 'meta.diff.header.to-file'
+ token: 'meta.diff.header.to-file',
},
{
foreground: 'ffffff',
- token: 'meta.diff.header.from-file'
+ token: 'meta.diff.header.from-file',
},
{
foreground: '718c00',
- token: 'markup.inserted.diff'
+ token: 'markup.inserted.diff',
},
{
foreground: '718c00',
- token: 'meta.diff.header.to-file'
+ token: 'meta.diff.header.to-file',
},
{
foreground: 'c82829',
- token: 'markup.deleted.diff'
+ token: 'markup.deleted.diff',
},
{
foreground: 'c82829',
- token: 'meta.diff.header.from-file'
+ token: 'meta.diff.header.from-file',
},
{
foreground: 'ffffff',
background: '4271ae',
- token: 'meta.diff.header.from-file'
+ token: 'meta.diff.header.from-file',
},
{
foreground: 'ffffff',
background: '4271ae',
- token: 'meta.diff.header.to-file'
+ token: 'meta.diff.header.to-file',
},
{
foreground: '3e999f',
fontStyle: 'italic',
- token: 'meta.diff.range'
- }
+ token: 'meta.diff.range',
+ },
],
colors: {
'editor.foreground': '#C5C8C6',
@@ -239,6 +239,6 @@ export default {
'editor.selectionBackground': '#373B41',
'editor.lineHighlightBackground': '#282A2E',
'editorCursor.foreground': '#AEAFAD',
- 'editorWhitespace.foreground': '#4B4E55'
- }
+ 'editorWhitespace.foreground': '#4B4E55',
+ },
}
diff --git a/packages/template-explorer/style.css b/packages/template-explorer/style.css
index 01a3e8b550b..93f6f623c68 100644
--- a/packages/template-explorer/style.css
+++ b/packages/template-explorer/style.css
@@ -1,7 +1,9 @@
body {
margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
- --bg: #1D1F21;
+ overflow: hidden;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
+ Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+ --bg: #1d1f21;
--border: #333;
}
diff --git a/packages/vue-compat/__tests__/compiler.spec.ts b/packages/vue-compat/__tests__/compiler.spec.ts
index 88de3d20f3b..2ae2f211a10 100644
--- a/packages/vue-compat/__tests__/compiler.spec.ts
+++ b/packages/vue-compat/__tests__/compiler.spec.ts
@@ -1,14 +1,13 @@
-import { vi } from 'vitest'
import Vue from '@vue/compat'
import { nextTick } from '@vue/runtime-core'
-import { CompilerDeprecationTypes } from '../../compiler-core/src'
+import { CompilerDeprecationTypes } from '@vue/compiler-core'
import { toggleDeprecationWarning } from '../../runtime-core/src/compat/compatConfig'
import { triggerEvent } from './utils'
beforeEach(() => {
toggleDeprecationWarning(false)
Vue.configureCompat({
- MODE: 2
+ MODE: 2,
})
})
@@ -22,14 +21,14 @@ afterEach(() => {
test('COMPILER_IS_ON_ELEMENT', () => {
const MyButton = {
- template: `
`
+ template: `
`,
}
const vm = new Vue({
template: `text `,
components: {
- MyButton
- }
+ MyButton,
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -39,14 +38,14 @@ test('COMPILER_IS_ON_ELEMENT', () => {
test('COMPILER_IS_ON_ELEMENT (dynamic)', () => {
const MyButton = {
- template: `
`
+ template: `
`,
}
const vm = new Vue({
template: `text `,
components: {
- MyButton
- }
+ MyButton,
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -57,19 +56,19 @@ test('COMPILER_IS_ON_ELEMENT (dynamic)', () => {
test('COMPILER_V_BIND_SYNC', async () => {
const MyButton = {
props: ['foo'],
- template: `{{ foo }} `
+ template: `{{ foo }} `,
}
const vm = new Vue({
data() {
return {
- foo: 0
+ foo: 0,
}
},
template: ` `,
components: {
- MyButton
- }
+ MyButton,
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLButtonElement)
@@ -82,25 +81,15 @@ test('COMPILER_V_BIND_SYNC', async () => {
expect(CompilerDeprecationTypes.COMPILER_V_BIND_SYNC).toHaveBeenWarned()
})
-test('COMPILER_V_BIND_PROP', () => {
- const vm = new Vue({
- template: `
`
- }).$mount()
-
- expect(vm.$el).toBeInstanceOf(HTMLDivElement)
- expect(vm.$el.id).toBe('foo')
- expect(CompilerDeprecationTypes.COMPILER_V_BIND_PROP).toHaveBeenWarned()
-})
-
test('COMPILER_V_BIND_OBJECT_ORDER', () => {
const vm = new Vue({
- template: `
`
+ template: `
`,
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.id).toBe('foo')
expect(vm.$el.className).toBe('baz')
expect(
- CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER
+ CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER,
).toHaveBeenWarned()
})
@@ -110,12 +99,12 @@ test('COMPILER_V_ON_NATIVE', () => {
template: ` `,
components: {
child: {
- template: ` `
- }
+ template: ` `,
+ },
},
methods: {
- spy
- }
+ spy,
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLButtonElement)
@@ -127,13 +116,13 @@ test('COMPILER_V_ON_NATIVE', () => {
test('COMPILER_V_IF_V_FOR_PRECEDENCE', () => {
new Vue({ template: `
` }).$mount()
expect(
- CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE
+ CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE,
).toHaveBeenWarned()
})
test('COMPILER_NATIVE_TEMPLATE', () => {
const vm = new Vue({
- template: ``
+ template: ``,
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -148,9 +137,9 @@ test('COMPILER_INLINE_TEMPLATE', () => {
foo: {
data() {
return { n: 123 }
- }
- }
- }
+ },
+ },
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
diff --git a/packages/vue-compat/__tests__/componentAsync.spec.ts b/packages/vue-compat/__tests__/componentAsync.spec.ts
index 8fda196a099..7b85d8b1e19 100644
--- a/packages/vue-compat/__tests__/componentAsync.spec.ts
+++ b/packages/vue-compat/__tests__/componentAsync.spec.ts
@@ -2,14 +2,14 @@ import Vue from '@vue/compat'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
beforeEach(() => {
toggleDeprecationWarning(true)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -28,7 +28,7 @@ describe('COMPONENT_ASYNC', () => {
}
const vm = new Vue({
template: `
`,
- components: { comp }
+ components: { comp },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -40,8 +40,8 @@ describe('COMPONENT_ASYNC', () => {
expect(
(deprecationData[DeprecationTypes.COMPONENT_ASYNC].message as Function)(
- comp
- )
+ comp,
+ ),
).toHaveBeenWarned()
})
@@ -49,7 +49,7 @@ describe('COMPONENT_ASYNC', () => {
const comp = () => Promise.resolve({ template: 'foo' })
const vm = new Vue({
template: `
`,
- components: { comp }
+ components: { comp },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.innerHTML).toBe(``)
@@ -58,19 +58,19 @@ describe('COMPONENT_ASYNC', () => {
expect(
(deprecationData[DeprecationTypes.COMPONENT_ASYNC].message as Function)(
- comp
- )
+ comp,
+ ),
).toHaveBeenWarned()
})
test('object syntax', async () => {
const comp = () => ({
- component: Promise.resolve({ template: 'foo' })
+ component: Promise.resolve({ template: 'foo' }),
})
const vm = new Vue({
template: `
`,
- components: { comp }
+ components: { comp },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -80,8 +80,8 @@ describe('COMPONENT_ASYNC', () => {
expect(
(deprecationData[DeprecationTypes.COMPONENT_ASYNC].message as Function)(
- comp
- )
+ comp,
+ ),
).toHaveBeenWarned()
})
})
diff --git a/packages/vue-compat/__tests__/componentFunctional.spec.ts b/packages/vue-compat/__tests__/componentFunctional.spec.ts
index 8ee0b3cd96b..d3d11daebbc 100644
--- a/packages/vue-compat/__tests__/componentFunctional.spec.ts
+++ b/packages/vue-compat/__tests__/componentFunctional.spec.ts
@@ -2,14 +2,14 @@ import Vue from '@vue/compat'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
beforeEach(() => {
toggleDeprecationWarning(true)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -24,27 +24,27 @@ describe('COMPONENT_FUNCTIONAL', () => {
name: 'Func',
functional: true,
props: {
- x: String
+ x: String,
},
inject: ['foo'],
render: (h: any, { data, props, injections, slots }: any) => {
return h('div', { id: props.x, class: data.class }, [
h('div', { class: 'inject' }, injections.foo),
- h('div', { class: 'slot' }, slots().default)
+ h('div', { class: 'slot' }, slots().default),
])
- }
+ },
}
const vm = new Vue({
provide() {
return {
- foo: 123
+ foo: 123,
}
},
components: {
- func
+ func,
},
- template: `hello `
+ template: `hello `,
}).$mount()
expect(vm.$el.id).toBe('foo')
@@ -52,14 +52,14 @@ describe('COMPONENT_FUNCTIONAL', () => {
expect(vm.$el.querySelector('.inject').textContent).toBe('123')
expect(vm.$el.querySelector('.slot').textContent).toBe('hello')
expect(vm.$el.outerHTML).toMatchInlineSnapshot(
- '""'
+ `""`,
)
expect(
(
deprecationData[DeprecationTypes.COMPONENT_FUNCTIONAL]
.message as Function
- )(func)
+ )(func),
).toHaveBeenWarned()
})
@@ -68,17 +68,17 @@ describe('COMPONENT_FUNCTIONAL', () => {
name: 'Func',
functional: true,
compatConfig: {
- ATTR_FALSE_VALUE: 'suppress-warning' as const
+ ATTR_FALSE_VALUE: 'suppress-warning' as const,
},
render: (h: any) => {
// should not render required: false due to compatConfig
return h('div', { 'data-some-attr': false })
- }
+ },
}
const vm = new Vue({
components: { func },
- template: `hello `
+ template: `hello `,
}).$mount()
expect(vm.$el.outerHTML).toMatchInlineSnapshot(`"
"`)
@@ -86,12 +86,12 @@ describe('COMPONENT_FUNCTIONAL', () => {
(
deprecationData[DeprecationTypes.COMPONENT_FUNCTIONAL]
.message as Function
- )(func)
+ )(func),
).toHaveBeenWarned()
expect(
(deprecationData[DeprecationTypes.ATTR_FALSE_VALUE].message as Function)(
- func
- )
+ func,
+ ),
).not.toHaveBeenWarned()
})
})
diff --git a/packages/vue-compat/__tests__/componentVModel.spec.ts b/packages/vue-compat/__tests__/componentVModel.spec.ts
index 05043b018d2..7e498828715 100644
--- a/packages/vue-compat/__tests__/componentVModel.spec.ts
+++ b/packages/vue-compat/__tests__/componentVModel.spec.ts
@@ -1,10 +1,10 @@
import Vue from '@vue/compat'
-import { ComponentOptions } from '../../runtime-core/src/component'
+import type { ComponentOptions } from '../../runtime-core/src/component'
import { nextTick } from '../../runtime-core/src/scheduler'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
import { triggerEvent } from './utils'
@@ -12,7 +12,7 @@ beforeEach(() => {
toggleDeprecationWarning(true)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -26,7 +26,7 @@ describe('COMPONENT_V_MODEL', () => {
const vm = new Vue({
data() {
return {
- text: 'foo'
+ text: 'foo',
}
},
components: { CustomInput },
@@ -35,7 +35,7 @@ describe('COMPONENT_V_MODEL', () => {
{{ text }}
- `
+ `,
}).$mount() as any
const input = vm.$el.querySelector('input')
@@ -46,8 +46,8 @@ describe('COMPONENT_V_MODEL', () => {
expect(
(deprecationData[DeprecationTypes.COMPONENT_V_MODEL].message as Function)(
- CustomInput
- )
+ CustomInput,
+ ),
).toHaveBeenWarned()
input.value = 'bar'
@@ -67,7 +67,7 @@ describe('COMPONENT_V_MODEL', () => {
await runTest({
name: 'CustomInput',
props: ['value'],
- template: `
`
+ template: `
`,
})
})
@@ -77,9 +77,9 @@ describe('COMPONENT_V_MODEL', () => {
props: ['input'],
model: {
prop: 'input',
- event: 'update'
+ event: 'update',
},
- template: `
`
+ template: `
`,
})
})
})
diff --git a/packages/vue-compat/__tests__/filters.spec.ts b/packages/vue-compat/__tests__/filters.spec.ts
index c1acbd899bc..9942673552a 100644
--- a/packages/vue-compat/__tests__/filters.spec.ts
+++ b/packages/vue-compat/__tests__/filters.spec.ts
@@ -1,9 +1,9 @@
import Vue from '@vue/compat'
import { CompilerDeprecationTypes } from '../../compiler-core/src'
import {
- deprecationData,
DeprecationTypes,
- toggleDeprecationWarning
+ deprecationData,
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
beforeEach(() => {
@@ -40,8 +40,8 @@ describe('FILTERS', () => {
const vm = new Vue({
template: '
{{ msg | globalUpper }}
',
data: () => ({
- msg: 'hi'
- })
+ msg: 'hi',
+ }),
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.textContent).toBe('HI')
@@ -54,11 +54,11 @@ describe('FILTERS', () => {
const vm = new Vue({
template: '
{{ msg | upper }}
',
data: () => ({
- msg: 'hi'
+ msg: 'hi',
}),
filters: {
- upper
- }
+ upper,
+ },
}).$mount()
expect(vm.$el.textContent).toBe('HI')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -68,12 +68,12 @@ describe('FILTERS', () => {
const vm = new Vue({
template: '
{{ msg | upper | reverse }}
',
data: () => ({
- msg: 'hi'
+ msg: 'hi',
}),
filters: {
upper,
- reverse
- }
+ reverse,
+ },
}).$mount()
expect(vm.$el.textContent).toBe('IH')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -91,13 +91,13 @@ describe('FILTERS', () => {
filters: {
upper,
reverse,
- lower
+ lower,
},
data: () => ({
id: 'abc',
cls: 'foo',
- ref: 'BAR'
- })
+ ref: 'BAR',
+ }),
}).$mount()
expect(vm.$el.id).toBe('CBA')
expect(vm.$el.className).toBe('oof')
@@ -112,9 +112,9 @@ describe('FILTERS', () => {
components: {
test: {
props: ['pattern'],
- template: '
'
- }
- }
+ template: '
',
+ },
+ },
}).$mount() as any
expect(vm.$refs.test.pattern).toBeInstanceOf(RegExp)
expect(vm.$refs.test.pattern.toString()).toBe('/a|b\\//')
@@ -125,7 +125,7 @@ describe('FILTERS', () => {
const vm = new Vue({
data: () => ({ a: 2 }),
template: `
{{ 1/a / 4 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(1 / 4))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -135,7 +135,7 @@ describe('FILTERS', () => {
const vm = new Vue({
data: () => ({ a: 20 }),
template: `
{{ (a*2) / 5 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(16))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -144,7 +144,7 @@ describe('FILTERS', () => {
it('handle division with dot', () => {
const vm = new Vue({
template: `
{{ 20. / 5 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(8))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -154,7 +154,7 @@ describe('FILTERS', () => {
const vm = new Vue({
data: () => ({ a: [20] }),
template: `
{{ a[0] / 5 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(8))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -164,7 +164,7 @@ describe('FILTERS', () => {
const vm = new Vue({
data: () => ({ a: { n: 20 } }),
template: `
{{ a['n'] / 5 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(8))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -174,7 +174,7 @@ describe('FILTERS', () => {
const vm = new Vue({
data: () => ({ a_: 8 }),
template: `
{{ a_ / 2 | double }}
`,
- filters: { double }
+ filters: { double },
}).$mount()
expect(vm.$el.textContent).toBe(String(8))
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -185,11 +185,11 @@ describe('FILTERS', () => {
template: `
{{ msg | add(a, 3) }}
`,
data: () => ({
msg: 1,
- a: 2
+ a: 2,
}),
filters: {
- add: (v: number, arg1: number, arg2: number) => v + arg1 + arg2
- }
+ add: (v: number, arg1: number, arg2: number) => v + arg1 + arg2,
+ },
}).$mount()
expect(vm.$el.textContent).toBe('6')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -199,11 +199,11 @@ describe('FILTERS', () => {
const vm = new Vue({
template: `
{{ msg + "b | c" + 'd' | upper }}
`,
data: () => ({
- msg: 'a'
+ msg: 'a',
}),
filters: {
- upper
- }
+ upper,
+ },
}).$mount()
expect(vm.$el.textContent).toBe('AB | CD')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -214,11 +214,11 @@ describe('FILTERS', () => {
template: `
{{ b || msg | upper }}
`,
data: () => ({
b: false,
- msg: 'a'
+ msg: 'a',
}),
filters: {
- upper
- }
+ upper,
+ },
}).$mount()
expect(vm.$el.textContent).toBe('A')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -228,8 +228,8 @@ describe('FILTERS', () => {
const vm = new Vue({
template: `
{{ { a: 123 } | pick('a') }}
`,
filters: {
- pick: (v: any, key: string) => v[key]
- }
+ pick: (v: any, key: string) => v[key],
+ },
}).$mount()
expect(vm.$el.textContent).toBe('123')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -239,8 +239,8 @@ describe('FILTERS', () => {
const vm = new Vue({
template: `
{{ [1, 2, 3] | reverse }}
`,
filters: {
- reverse: (arr: any[]) => arr.reverse().join(',')
- }
+ reverse: (arr: any[]) => arr.reverse().join(','),
+ },
}).$mount()
expect(vm.$el.textContent).toBe('3,2,1')
expect(CompilerDeprecationTypes.COMPILER_FILTERS).toHaveBeenWarned()
@@ -248,7 +248,7 @@ describe('FILTERS', () => {
it('bigint support', () => {
const vm = new Vue({
- template: `
{{ BigInt(BigInt(10000000)) + BigInt(2000000000n) * 3000000n }}
`
+ template: `
{{ BigInt(BigInt(10000000)) + BigInt(2000000000n) * 3000000n }}
`,
}).$mount()
expect(vm.$el.textContent).toBe('6000000010000000')
})
diff --git a/packages/vue-compat/__tests__/global.spec.ts b/packages/vue-compat/__tests__/global.spec.ts
index d189d65f67b..fcbdefa2f29 100644
--- a/packages/vue-compat/__tests__/global.spec.ts
+++ b/packages/vue-compat/__tests__/global.spec.ts
@@ -1,11 +1,10 @@
-import { expect, vi } from 'vitest'
import Vue from '@vue/compat'
import { effect, isReactive } from '@vue/reactivity'
import { h, nextTick } from '@vue/runtime-core'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
import { singletonApp } from '../../runtime-core/src/compat/global'
import { createApp } from '../src/esm-index'
@@ -31,12 +30,12 @@ describe('GLOBAL_MOUNT', () => {
compatConfig: { GLOBAL_MOUNT: true },
data() {
return {
- msg: 'hello'
+ msg: 'hello',
}
- }
+ },
})
expect(
- deprecationData[DeprecationTypes.GLOBAL_MOUNT].message
+ deprecationData[DeprecationTypes.GLOBAL_MOUNT].message,
).toHaveBeenWarned()
expect(el.innerHTML).toBe('hello')
})
@@ -47,9 +46,9 @@ describe('GLOBAL_MOUNT', () => {
new Vue({
data() {
return {
- msg: 'hello'
+ msg: 'hello',
}
- }
+ },
}).$mount(el)
expect(el.innerHTML).toBe('hello')
})
@@ -65,10 +64,10 @@ describe('GLOBAL_MOUNT_CONTAINER', () => {
new Vue().$mount(el)
// warning only
expect(
- deprecationData[DeprecationTypes.GLOBAL_MOUNT].message
+ deprecationData[DeprecationTypes.GLOBAL_MOUNT].message,
).toHaveBeenWarned()
expect(
- deprecationData[DeprecationTypes.GLOBAL_MOUNT_CONTAINER].message
+ deprecationData[DeprecationTypes.GLOBAL_MOUNT_CONTAINER].message,
).toHaveBeenWarned()
})
})
@@ -81,46 +80,46 @@ describe('GLOBAL_EXTEND', () => {
const Test = Vue.extend({
name: 'test',
a: 1,
- b: 2
+ b: 2,
})
expect(Test.options.a).toBe(1)
expect(Test.options.b).toBe(2)
expect(Test.super).toBe(Vue)
const t = new Test({
- a: 2
+ a: 2,
})
expect(t.$options.a).toBe(2)
expect(t.$options.b).toBe(2)
// inheritance
const Test2 = Test.extend({
- a: 2
+ a: 2,
})
expect(Test2.options.a).toBe(2)
expect(Test2.options.b).toBe(2)
const t2 = new Test2({
- a: 3
+ a: 3,
})
expect(t2.$options.a).toBe(3)
expect(t2.$options.b).toBe(2)
expect(
- deprecationData[DeprecationTypes.GLOBAL_MOUNT].message
+ deprecationData[DeprecationTypes.GLOBAL_MOUNT].message,
).toHaveBeenWarned()
expect(
- deprecationData[DeprecationTypes.GLOBAL_EXTEND].message
+ deprecationData[DeprecationTypes.GLOBAL_EXTEND].message,
).toHaveBeenWarned()
})
it('should work when used as components', () => {
const foo = Vue.extend({
- template: '
foo '
+ template: '
foo ',
})
const bar = Vue.extend({
- template: '
bar '
+ template: '
bar ',
})
const vm = new Vue({
template: '
',
- components: { foo, bar }
+ components: { foo, bar },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.innerHTML).toBe('
foo bar ')
@@ -131,17 +130,17 @@ describe('GLOBAL_EXTEND', () => {
const A = Vue.extend({
created() {
calls.push(1)
- }
+ },
})
const B = A.extend({
created() {
calls.push(2)
- }
+ },
})
new B({
created() {
calls.push(3)
- }
+ },
})
expect(calls).toEqual([1, 2, 3])
})
@@ -152,22 +151,22 @@ describe('GLOBAL_EXTEND', () => {
const c = vi.fn()
const d = vi.fn()
const A = Vue.extend({
- created: a
+ created: a,
})
const B = Vue.extend({
mixins: [A],
- created: b
+ created: b,
})
const C = Vue.extend({
extends: B,
- created: c
+ created: c,
})
const D = Vue.extend({
mixins: [C],
created: d,
render() {
return null
- }
+ },
})
new D().$mount()
expect(a.mock.calls.length).toStrictEqual(1)
@@ -181,23 +180,23 @@ describe('GLOBAL_EXTEND', () => {
methods: {
a() {
return this.n
- }
- }
+ },
+ },
})
const B = A.extend({
methods: {
b() {
return this.n + 1
- }
- }
+ },
+ },
})
const b = new B({
data: () => ({ n: 0 }),
methods: {
c() {
return this.n + 2
- }
- }
+ },
+ },
}) as any
expect(b.a()).toBe(0)
expect(b.b()).toBe(1)
@@ -208,19 +207,19 @@ describe('GLOBAL_EXTEND', () => {
const A = Vue.extend({
components: {
aa: {
- template: '
A
'
- }
- }
+ template: '
A
',
+ },
+ },
})
const B = A.extend({
components: {
bb: {
- template: '
B
'
- }
- }
+ template: '
B
',
+ },
+ },
})
const b = new B({
- template: '
'
+ template: '
',
}).$mount()
expect(b.$el).toBeInstanceOf(HTMLDivElement)
expect(b.$el.innerHTML).toBe('
A
B
')
@@ -228,7 +227,7 @@ describe('GLOBAL_EXTEND', () => {
it('caching', () => {
const options = {
- template: '
'
+ template: '
',
}
const A = Vue.extend(options)
const B = Vue.extend(options)
@@ -252,10 +251,10 @@ describe('GLOBAL_PROTOTYPE', () => {
expect(vm.$test).toBe(1)
delete Vue.prototype.$test
expect(
- deprecationData[DeprecationTypes.GLOBAL_MOUNT].message
+ deprecationData[DeprecationTypes.GLOBAL_MOUNT].message,
).toHaveBeenWarned()
expect(
- deprecationData[DeprecationTypes.GLOBAL_PROTOTYPE].message
+ deprecationData[DeprecationTypes.GLOBAL_PROTOTYPE].message,
).toHaveBeenWarned()
})
@@ -266,7 +265,7 @@ describe('GLOBAL_PROTOTYPE', () => {
const vm = new Vue({
data() {
return { msg: 'method' }
- }
+ },
}) as any
expect(vm.$test()).toBe('method')
delete Vue.prototype.$test
@@ -277,12 +276,12 @@ describe('GLOBAL_PROTOTYPE', () => {
configurable: true,
get() {
return this.msg
- }
+ },
})
const vm = new Vue({
data() {
return { msg: 'getter' }
- }
+ },
}) as any
expect(vm.$test).toBe('getter')
delete Vue.prototype.$test
@@ -300,9 +299,9 @@ describe('GLOBAL_PROTOTYPE', () => {
const vm = new Vue({
data() {
return {
- msg: 'test'
+ msg: 'test',
}
- }
+ },
}) as any
expect(typeof vm.$test).toBe('function')
expect(typeof vm.$test.additionalFn).toBe('function')
@@ -322,7 +321,7 @@ describe('GLOBAL_PROTOTYPE', () => {
test('should affect apps created via createApp()', () => {
Vue.prototype.$test = 1
const vm = createApp({
- template: 'foo'
+ template: 'foo',
}).mount(document.createElement('div')) as any
expect(vm.$test).toBe(1)
delete Vue.prototype.$test
@@ -336,7 +335,7 @@ describe('GLOBAL_SET/DELETE', () => {
Vue.set(obj, 'foo', 1)
expect(obj.foo).toBe(1)
expect(
- deprecationData[DeprecationTypes.GLOBAL_SET].message
+ deprecationData[DeprecationTypes.GLOBAL_SET].message,
).toHaveBeenWarned()
})
@@ -346,7 +345,7 @@ describe('GLOBAL_SET/DELETE', () => {
Vue.delete(obj, 'foo')
expect('foo' in obj).toBe(false)
expect(
- deprecationData[DeprecationTypes.GLOBAL_DELETE].message
+ deprecationData[DeprecationTypes.GLOBAL_DELETE].message,
).toHaveBeenWarned()
})
})
@@ -357,7 +356,7 @@ describe('GLOBAL_OBSERVABLE', () => {
const obj = Vue.observable({})
expect(isReactive(obj)).toBe(true)
expect(
- deprecationData[DeprecationTypes.GLOBAL_OBSERVABLE].message
+ deprecationData[DeprecationTypes.GLOBAL_OBSERVABLE].message,
).toHaveBeenWarned()
})
})
@@ -366,7 +365,6 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
test('defineReactive', () => {
toggleDeprecationWarning(true)
const obj: any = {}
- // @ts-ignore
Vue.util.defineReactive(obj, 'test', 1)
let n
@@ -378,17 +376,16 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
expect(n).toBe(2)
expect(
- deprecationData[DeprecationTypes.GLOBAL_PRIVATE_UTIL].message
+ deprecationData[DeprecationTypes.GLOBAL_PRIVATE_UTIL].message,
).toHaveBeenWarned()
})
test('defineReactive on instance', async () => {
const vm = new Vue({
beforeCreate() {
- // @ts-ignore
Vue.util.defineReactive(this, 'foo', 1)
},
- template: `
{{ foo }}
`
+ template: `
{{ foo }}
`,
}).$mount() as any
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.textContent).toBe('1')
@@ -400,10 +397,9 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
test('defineReactive on instance with key that starts with $', async () => {
const vm = new Vue({
beforeCreate() {
- // @ts-ignore
Vue.util.defineReactive(this, '$foo', 1)
},
- template: `
{{ $foo }}
`
+ template: `
{{ $foo }}
`,
}).$mount() as any
expect(vm.$el.textContent).toBe('1')
vm.$foo = 2
@@ -414,7 +410,6 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
test('defineReactive with object value', () => {
const obj: any = {}
const val = { a: 1 }
- // @ts-ignore
Vue.util.defineReactive(obj, 'foo', val)
let n
@@ -430,7 +425,6 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
test('defineReactive with array value', () => {
const obj: any = {}
const val = [1]
- // @ts-ignore
Vue.util.defineReactive(obj, 'foo', val)
let n
@@ -447,7 +441,7 @@ describe('GLOBAL_PRIVATE_UTIL', () => {
test('global asset registration should affect apps created via createApp', () => {
Vue.component('foo', { template: 'foo' })
const vm = createApp({
- template: '
'
+ template: '
',
}).mount(document.createElement('div')) as any
expect(vm.$el.textContent).toBe('foo')
delete singletonApp._context.components.foo
@@ -455,7 +449,7 @@ test('global asset registration should affect apps created via createApp', () =>
test('post-facto global asset registration should affect apps created via createApp', () => {
const app = createApp({
- template: '
'
+ template: '
',
})
Vue.component('foo', { template: 'foo' })
const vm = app.mount(document.createElement('div'))
@@ -471,7 +465,7 @@ test('local asset registration should not affect other local apps', () => {
app2.component('foo', {})
expect(
- `Component "foo" has already been registered in target app`
+ `Component "foo" has already been registered in target app`,
).not.toHaveBeenWarned()
})
@@ -496,9 +490,9 @@ test('local app config should not affect other local apps in v3 mode', () => {
render: () => h('div'),
provide() {
return {
- test: 123
+ test: 123,
}
- }
+ },
})
app1.config.globalProperties.test = () => {}
app1.mount(document.createElement('div'))
diff --git a/packages/vue-compat/__tests__/globalConfig.spec.ts b/packages/vue-compat/__tests__/globalConfig.spec.ts
index 2a3adddba38..44cf6651527 100644
--- a/packages/vue-compat/__tests__/globalConfig.spec.ts
+++ b/packages/vue-compat/__tests__/globalConfig.spec.ts
@@ -1,8 +1,7 @@
-import { vi } from 'vitest'
import Vue from '@vue/compat'
import {
DeprecationTypes,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
import { createApp } from '../src/esm-index'
import { triggerEvent } from './utils'
@@ -22,7 +21,7 @@ afterEach(() => {
test('GLOBAL_KEY_CODES', () => {
Vue.config.keyCodes = {
foo: 86,
- bar: [38, 87]
+ bar: [38, 87],
}
const onFoo = vi.fn()
@@ -34,8 +33,8 @@ test('GLOBAL_KEY_CODES', () => {
template: `
`,
methods: {
onFoo,
- onBar
- }
+ onBar,
+ },
})
triggerEvent(el.children[0], 'keyup', e => {
@@ -65,7 +64,7 @@ test('GLOBAL_IGNORED_ELEMENTS', () => {
const el = document.createElement('div')
new Vue({
el,
- template: `
`
+ template: `
`,
})
expect(el.innerHTML).toBe(`
`)
})
@@ -74,7 +73,7 @@ test('singleton config should affect apps created with createApp()', () => {
Vue.config.ignoredElements = [/^v-/, 'foo']
const el = document.createElement('div')
createApp({
- template: `
`
+ template: `
`,
}).mount(el)
expect(el.innerHTML).toBe(`
`)
})
diff --git a/packages/vue-compat/__tests__/instance.spec.ts b/packages/vue-compat/__tests__/instance.spec.ts
index abcd3d1fab0..63ce5581230 100644
--- a/packages/vue-compat/__tests__/instance.spec.ts
+++ b/packages/vue-compat/__tests__/instance.spec.ts
@@ -1,19 +1,19 @@
-import { vi, Mock } from 'vitest'
+import type { Mock } from 'vitest'
import Vue from '@vue/compat'
-import { Slots } from '../../runtime-core/src/componentSlots'
+import type { Slots } from '../../runtime-core/src/componentSlots'
import { Text } from '../../runtime-core/src/vnode'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
-import { LegacyPublicInstance } from '../../runtime-core/src/compat/instance'
+import type { LegacyPublicInstance } from '../../runtime-core/src/compat/instance'
beforeEach(() => {
toggleDeprecationWarning(true)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -27,7 +27,7 @@ test('INSTANCE_SET', () => {
new Vue().$set(obj, 'foo', 1)
expect(obj.foo).toBe(1)
expect(
- deprecationData[DeprecationTypes.INSTANCE_SET].message
+ deprecationData[DeprecationTypes.INSTANCE_SET].message,
).toHaveBeenWarned()
})
@@ -36,14 +36,14 @@ test('INSTANCE_DELETE', () => {
new Vue().$delete(obj, 'foo')
expect('foo' in obj).toBe(false)
expect(
- deprecationData[DeprecationTypes.INSTANCE_DELETE].message
+ deprecationData[DeprecationTypes.INSTANCE_DELETE].message,
).toHaveBeenWarned()
})
test('INSTANCE_DESTROY', () => {
new Vue({ template: 'foo' }).$mount().$destroy()
expect(
- deprecationData[DeprecationTypes.INSTANCE_DESTROY].message
+ deprecationData[DeprecationTypes.INSTANCE_DESTROY].message,
).toHaveBeenWarned()
})
@@ -67,7 +67,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
expect(spy).toHaveBeenCalledTimes(1)
expect(spy).toHaveBeenCalledWith(1, 2, 3, 4)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -83,7 +83,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
expect(spy).toHaveBeenCalledTimes(2)
expect(spy).toHaveBeenCalledWith(5, 6, 7, 8)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -96,7 +96,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
vm.$emit('test3', 1, 2, 3, 4)
expect(spy).toHaveBeenCalledTimes(1)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -106,7 +106,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
vm.$emit('test1')
expect(spy).not.toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -117,7 +117,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
expect(spy).toHaveBeenCalledTimes(1)
expect(spy).toHaveBeenCalledWith(1, 2, 3)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -127,7 +127,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
vm.$emit('test', 1, 2, 3)
expect(spy).not.toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -139,7 +139,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
vm.$emit('test2')
expect(spy).not.toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -153,7 +153,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
expect(spy).toHaveBeenCalledTimes(1)
expect(spy).toHaveBeenCalledWith(2)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
@@ -167,7 +167,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
expect(spy2).toHaveBeenCalledTimes(1)
expect(spy2).toHaveBeenCalledWith(1, 2, 3)
expect(
- deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message
+ deprecationData[DeprecationTypes.INSTANCE_EVENT_EMITTER].message,
).toHaveBeenWarned()
})
})
@@ -183,7 +183,7 @@ describe('INSTANCE_EVENT_HOOKS', () => {
(
deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
.message as Function
- )('hook:mounted')
+ )('hook:mounted'),
).toHaveBeenWarned()
})
@@ -194,16 +194,16 @@ describe('INSTANCE_EVENT_HOOKS', () => {
methods: { spy },
components: {
child: {
- template: 'foo'
- }
- }
+ template: 'foo',
+ },
+ },
}).$mount()
expect(spy).toHaveBeenCalled()
expect(
(
deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
.message as Function
- )('hook:mounted')
+ )('hook:mounted'),
).toHaveBeenWarned()
})
})
@@ -216,16 +216,16 @@ test('INSTANCE_EVENT_CHILDREN', () => {
template: 'foo',
data() {
return { n: 1 }
- }
- }
- }
+ },
+ },
+ },
}).$mount()
expect(vm.$children.length).toBe(4)
vm.$children.forEach((c: any) => {
expect(c.n).toBe(1)
})
expect(
- deprecationData[DeprecationTypes.INSTANCE_CHILDREN].message
+ deprecationData[DeprecationTypes.INSTANCE_CHILDREN].message,
).toHaveBeenWarned()
})
@@ -242,9 +242,9 @@ test('INSTANCE_LISTENERS', () => {
template: `
`,
mounted() {
listeners = this.$listeners
- }
- }
- }
+ },
+ },
+ },
}).$mount()
expect(Object.keys(listeners!)).toMatchObject(['click', 'custom'])
@@ -252,7 +252,7 @@ test('INSTANCE_LISTENERS', () => {
expect(listeners!.custom()).toBe('bar')
expect(
- deprecationData[DeprecationTypes.INSTANCE_LISTENERS].message
+ deprecationData[DeprecationTypes.INSTANCE_LISTENERS].message,
).toHaveBeenWarned()
})
@@ -266,20 +266,20 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
compatConfig: { RENDER_FUNCTION: false },
render() {
slots = this.$scopedSlots
- }
- }
- }
+ },
+ },
+ },
}).$mount()
expect(slots!.default!({ msg: 'hi' })).toMatchObject([
{
type: Text,
- children: 'hi'
- }
+ children: 'hi',
+ },
])
expect(
- deprecationData[DeprecationTypes.INSTANCE_SCOPED_SLOTS].message
+ deprecationData[DeprecationTypes.INSTANCE_SCOPED_SLOTS].message,
).toHaveBeenWarned()
})
@@ -294,16 +294,16 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
render() {
normalSlots = this.$slots
scopedSlots = this.$scopedSlots
- }
- }
- }
+ },
+ },
+ },
}).$mount()
expect('default' in normalSlots!).toBe(true)
expect('default' in scopedSlots!).toBe(false)
expect(
- deprecationData[DeprecationTypes.INSTANCE_SCOPED_SLOTS].message
+ deprecationData[DeprecationTypes.INSTANCE_SCOPED_SLOTS].message,
).toHaveBeenWarned()
})
})
@@ -314,20 +314,20 @@ test('INSTANCE_ATTR_CLASS_STYLE', () => {
components: {
child: {
inheritAttrs: false,
- template: `
`
- }
- }
+ template: `
`,
+ },
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.outerHTML).toBe(
- `
`
+ `
`,
)
expect(
(
deprecationData[DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE]
.message as Function
- )('Anonymous')
+ )('Anonymous'),
).toHaveBeenWarned()
})
diff --git a/packages/vue-compat/__tests__/misc.spec.ts b/packages/vue-compat/__tests__/misc.spec.ts
index 5d16ae2907a..d9598be3738 100644
--- a/packages/vue-compat/__tests__/misc.spec.ts
+++ b/packages/vue-compat/__tests__/misc.spec.ts
@@ -1,10 +1,9 @@
-import { vi } from 'vitest'
import Vue from '@vue/compat'
import { nextTick } from '../../runtime-core/src/scheduler'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
import { triggerEvent } from './utils'
import { h } from '@vue/runtime-core'
@@ -13,7 +12,7 @@ beforeEach(() => {
toggleDeprecationWarning(true)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -25,23 +24,23 @@ afterEach(() => {
test('mode as function', () => {
const Foo = {
name: 'Foo',
- render: (h: any) => h('div', 'foo')
+ render: (h: any) => h('div', 'foo'),
}
const Bar = {
name: 'Bar',
data: () => ({ msg: 'bar' }),
- render: (ctx: any) => h('div', ctx.msg)
+ render: (ctx: any) => h('div', ctx.msg),
}
toggleDeprecationWarning(false)
Vue.configureCompat({
- MODE: comp => (comp && comp.name === 'Bar' ? 3 : 2)
+ MODE: comp => (comp && comp.name === 'Bar' ? 3 : 2),
})
const vm = new Vue({
components: { Foo, Bar },
- template: `
`
+ template: `
`,
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -53,15 +52,15 @@ test('WATCH_ARRAY', async () => {
const vm = new Vue({
data() {
return {
- foo: []
+ foo: [],
}
},
watch: {
- foo: spy
- }
+ foo: spy,
+ },
}) as any
expect(
- deprecationData[DeprecationTypes.WATCH_ARRAY].message
+ deprecationData[DeprecationTypes.WATCH_ARRAY].message,
).toHaveBeenWarned()
expect(spy).not.toHaveBeenCalled()
@@ -83,21 +82,21 @@ test('PROPS_DEFAULT_THIS', () => {
thisCtx = {
foo: this.foo,
$options: this.$options,
- provided: this.provided
+ provided: this.provided,
}
return this.foo + 1
- }
- }
+ },
+ },
},
- template: `{{ bar }}`
+ template: `{{ bar }}`,
}
const vm = new Vue({
components: { Child },
provide: {
- provided: 2
+ provided: 2,
},
- template: `
`
+ template: `
`,
}).$mount()
expect(vm.$el.textContent).toBe('1')
@@ -110,8 +109,8 @@ test('PROPS_DEFAULT_THIS', () => {
expect(
(deprecationData[DeprecationTypes.PROPS_DEFAULT_THIS].message as Function)(
- 'bar'
- )
+ 'bar',
+ ),
).toHaveBeenWarned()
})
@@ -119,7 +118,7 @@ test('V_ON_KEYCODE_MODIFIER', () => {
const spy = vi.fn()
const vm = new Vue({
template: `
`,
- methods: { spy }
+ methods: { spy },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLInputElement)
triggerEvent(vm.$el, 'keyup', e => {
@@ -128,7 +127,7 @@ test('V_ON_KEYCODE_MODIFIER', () => {
})
expect(spy).toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.V_ON_KEYCODE_MODIFIER].message
+ deprecationData[DeprecationTypes.V_ON_KEYCODE_MODIFIER].message,
).toHaveBeenWarned()
})
@@ -138,7 +137,7 @@ test('CUSTOM_DIR', async () => {
inserted: vi.fn(),
update: vi.fn(),
componentUpdated: vi.fn(),
- unbind: vi.fn()
+ unbind: vi.fn(),
} as any
const getCalls = () =>
@@ -148,13 +147,13 @@ test('CUSTOM_DIR', async () => {
data() {
return {
ok: true,
- foo: 1
+ foo: 1,
}
},
template: `
`,
directives: {
- myDir
- }
+ myDir,
+ },
}).$mount() as any
expect(getCalls()).toMatchObject([1, 1, 0, 0, 0])
@@ -162,14 +161,14 @@ test('CUSTOM_DIR', async () => {
expect(
(deprecationData[DeprecationTypes.CUSTOM_DIR].message as Function)(
'bind',
- 'beforeMount'
- )
+ 'beforeMount',
+ ),
).toHaveBeenWarned()
expect(
(deprecationData[DeprecationTypes.CUSTOM_DIR].message as Function)(
'inserted',
- 'mounted'
- )
+ 'mounted',
+ ),
).toHaveBeenWarned()
vm.foo++
@@ -179,39 +178,39 @@ test('CUSTOM_DIR', async () => {
expect(
(deprecationData[DeprecationTypes.CUSTOM_DIR].message as Function)(
'update',
- 'updated'
- )
+ 'updated',
+ ),
).toHaveBeenWarned()
expect(
(deprecationData[DeprecationTypes.CUSTOM_DIR].message as Function)(
'componentUpdated',
- 'updated'
- )
+ 'updated',
+ ),
).toHaveBeenWarned()
})
test('ATTR_FALSE_VALUE', () => {
const vm = new Vue({
- template: `
`
+ template: `
`,
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.hasAttribute('id')).toBe(false)
expect(vm.$el.hasAttribute('foo')).toBe(false)
expect(
(deprecationData[DeprecationTypes.ATTR_FALSE_VALUE].message as Function)(
- 'id'
- )
+ 'id',
+ ),
).toHaveBeenWarned()
expect(
(deprecationData[DeprecationTypes.ATTR_FALSE_VALUE].message as Function)(
- 'foo'
- )
+ 'foo',
+ ),
).toHaveBeenWarned()
})
test('ATTR_ENUMERATED_COERCION', () => {
const vm = new Vue({
- template: `
`
+ template: `
`,
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
@@ -222,18 +221,18 @@ test('ATTR_ENUMERATED_COERCION', () => {
(
deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
.message as Function
- )('draggable', null, 'false')
+ )('draggable', null, 'false'),
).toHaveBeenWarned()
expect(
(
deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
.message as Function
- )('spellcheck', 0, 'true')
+ )('spellcheck', 0, 'true'),
).toHaveBeenWarned()
expect(
(
deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
.message as Function
- )('contenteditable', 'foo', 'true')
+ )('contenteditable', 'foo', 'true'),
).toHaveBeenWarned()
})
diff --git a/packages/vue-compat/__tests__/options.spec.ts b/packages/vue-compat/__tests__/options.spec.ts
index 75b5a440d3c..a459d4fdfcd 100644
--- a/packages/vue-compat/__tests__/options.spec.ts
+++ b/packages/vue-compat/__tests__/options.spec.ts
@@ -1,10 +1,9 @@
-import { vi } from 'vitest'
import Vue from '@vue/compat'
import { nextTick } from '../../runtime-core/src/scheduler'
import {
DeprecationTypes,
deprecationData,
- toggleDeprecationWarning
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
beforeEach(() => {
@@ -12,7 +11,7 @@ beforeEach(() => {
Vue.configureCompat({
MODE: 2,
GLOBAL_MOUNT: 'suppress-warning',
- GLOBAL_EXTEND: 'suppress-warning'
+ GLOBAL_EXTEND: 'suppress-warning',
})
})
@@ -24,11 +23,11 @@ afterEach(() => {
test('root data plain object', () => {
const vm = new Vue({
data: { foo: 1 } as any,
- template: `{{ foo }}`
+ template: `{{ foo }}`,
}).$mount()
expect(vm.$el.textContent).toBe('1')
expect(
- deprecationData[DeprecationTypes.OPTIONS_DATA_FN].message
+ deprecationData[DeprecationTypes.OPTIONS_DATA_FN].message,
).toHaveBeenWarned()
})
@@ -37,30 +36,30 @@ test('data deep merge', () => {
data() {
return {
foo: {
- baz: 2
- }
+ baz: 2,
+ },
}
- }
+ },
}
const vm = new Vue({
mixins: [mixin],
data: () => ({
foo: {
- bar: 1
+ bar: 1,
},
- selfData: 3
+ selfData: 3,
}),
- template: `{{ { selfData, foo } }}`
+ template: `{{ { selfData, foo } }}`,
}).$mount()
expect(vm.$el.textContent).toBe(
- JSON.stringify({ selfData: 3, foo: { baz: 2, bar: 1 } }, null, 2)
+ JSON.stringify({ selfData: 3, foo: { baz: 2, bar: 1 } }, null, 2),
)
expect(
(deprecationData[DeprecationTypes.OPTIONS_DATA_MERGE].message as Function)(
- 'foo'
- )
+ 'foo',
+ ),
).toHaveBeenWarned()
})
@@ -69,18 +68,18 @@ test('data deep merge w/ extended constructor', () => {
const App = Vue.extend({
template: `
{{ { mixinData, selfData } }} `,
mixins: [{ data: () => ({ mixinData: 'mixinData' }) }],
- data: () => ({ selfData: 'selfData' })
+ data: () => ({ selfData: 'selfData' }),
})
const vm = new App().$mount()
expect(vm.$el.textContent).toBe(
JSON.stringify(
{
mixinData: 'mixinData',
- selfData: 'selfData'
+ selfData: 'selfData',
},
null,
- 2
- )
+ 2,
+ ),
)
})
@@ -91,7 +90,7 @@ test('beforeDestroy/destroyed', async () => {
const child = {
template: `foo`,
beforeDestroy,
- destroyed
+ destroyed,
}
const vm = new Vue({
@@ -99,7 +98,7 @@ test('beforeDestroy/destroyed', async () => {
data() {
return { ok: true }
},
- components: { child }
+ components: { child },
}).$mount() as any
vm.ok = false
@@ -108,11 +107,11 @@ test('beforeDestroy/destroyed', async () => {
expect(destroyed).toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.OPTIONS_BEFORE_DESTROY].message
+ deprecationData[DeprecationTypes.OPTIONS_BEFORE_DESTROY].message,
).toHaveBeenWarned()
expect(
- deprecationData[DeprecationTypes.OPTIONS_DESTROYED].message
+ deprecationData[DeprecationTypes.OPTIONS_DESTROYED].message,
).toHaveBeenWarned()
})
@@ -123,7 +122,7 @@ test('beforeDestroy/destroyed in Vue.extend components', async () => {
const child = Vue.extend({
template: `foo`,
beforeDestroy,
- destroyed
+ destroyed,
})
const vm = new Vue({
@@ -131,7 +130,7 @@ test('beforeDestroy/destroyed in Vue.extend components', async () => {
data() {
return { ok: true }
},
- components: { child }
+ components: { child },
}).$mount() as any
vm.ok = false
@@ -140,10 +139,10 @@ test('beforeDestroy/destroyed in Vue.extend components', async () => {
expect(destroyed).toHaveBeenCalled()
expect(
- deprecationData[DeprecationTypes.OPTIONS_BEFORE_DESTROY].message
+ deprecationData[DeprecationTypes.OPTIONS_BEFORE_DESTROY].message,
).toHaveBeenWarned()
expect(
- deprecationData[DeprecationTypes.OPTIONS_DESTROYED].message
+ deprecationData[DeprecationTypes.OPTIONS_DESTROYED].message,
).toHaveBeenWarned()
})
diff --git a/packages/vue-compat/__tests__/renderFn.spec.ts b/packages/vue-compat/__tests__/renderFn.spec.ts
index 9b3d1466597..04d8aaac19e 100644
--- a/packages/vue-compat/__tests__/renderFn.spec.ts
+++ b/packages/vue-compat/__tests__/renderFn.spec.ts
@@ -2,12 +2,12 @@ import { ShapeFlags } from '@vue/shared'
import Vue from '@vue/compat'
import { createComponentInstance } from '../../runtime-core/src/component'
import { setCurrentRenderingInstance } from '../../runtime-core/src/componentRenderContext'
-import { DirectiveBinding } from '../../runtime-core/src/directives'
+import type { DirectiveBinding } from '../../runtime-core/src/directives'
import { createVNode } from '../../runtime-core/src/vnode'
import {
- deprecationData,
DeprecationTypes,
- toggleDeprecationWarning
+ deprecationData,
+ toggleDeprecationWarning,
} from '../../runtime-core/src/compat/compatConfig'
import { compatH as h } from '../../runtime-core/src/compat/renderFn'
@@ -15,7 +15,7 @@ beforeEach(() => {
toggleDeprecationWarning(false)
Vue.configureCompat({
MODE: 2,
- GLOBAL_MOUNT: 'suppress-warning'
+ GLOBAL_MOUNT: 'suppress-warning',
})
})
@@ -29,16 +29,16 @@ describe('compat: render function', () => {
const mockChildComp = {}
const mockComponent = {
directives: {
- mockDir
+ mockDir,
},
components: {
- foo: mockChildComp
- }
+ foo: mockChildComp,
+ },
}
const mockInstance = createComponentInstance(
createVNode(mockComponent),
null,
- null
+ null,
)
beforeEach(() => {
setCurrentRenderingInstance(mockInstance)
@@ -49,7 +49,7 @@ describe('compat: render function', () => {
test('string component lookup', () => {
expect(h('foo')).toMatchObject({
- type: mockChildComp
+ type: mockChildComp,
})
})
@@ -59,23 +59,23 @@ describe('compat: render function', () => {
class: 'foo',
style: { color: 'red' },
attrs: {
- id: 'foo'
+ id: 'foo',
},
domProps: {
- innerHTML: 'hi'
+ innerHTML: 'hi',
},
props: {
- myProp: 'foo'
- }
- })
+ myProp: 'foo',
+ },
+ }),
).toMatchObject({
props: {
class: 'foo',
style: { color: 'red' },
id: 'foo',
innerHTML: 'hi',
- myProp: 'foo'
- }
+ myProp: 'foo',
+ },
})
})
@@ -83,12 +83,12 @@ describe('compat: render function', () => {
expect(
h('div', {
class: { foo: true },
- staticClass: 'bar'
- })
+ staticClass: 'bar',
+ }),
).toMatchObject({
props: {
- class: 'bar foo'
- }
+ class: 'bar foo',
+ },
})
})
@@ -96,15 +96,15 @@ describe('compat: render function', () => {
expect(
h('div', {
style: { color: 'red' },
- staticStyle: { fontSize: '14px' }
- })
+ staticStyle: { fontSize: '14px' },
+ }),
).toMatchObject({
props: {
style: {
color: 'red',
- fontSize: '14px'
- }
- }
+ fontSize: '14px',
+ },
+ },
})
})
@@ -114,20 +114,20 @@ describe('compat: render function', () => {
h('div', {
on: {
click: fn,
- fooBar: fn
+ fooBar: fn,
},
nativeOn: {
click: fn,
- 'bar-baz': fn
- }
- })
+ 'bar-baz': fn,
+ },
+ }),
).toMatchObject({
props: {
onClick: fn,
onClickNative: fn,
onFooBar: fn,
- 'onBar-bazNative': fn
- }
+ 'onBar-bazNative': fn,
+ },
})
})
@@ -138,15 +138,15 @@ describe('compat: render function', () => {
on: {
'&click': fn,
'~keyup': fn,
- '!touchend': fn
- }
- })
+ '!touchend': fn,
+ },
+ }),
).toMatchObject({
props: {
onClickPassive: fn,
onKeyupOnce: fn,
- onTouchendCapture: fn
- }
+ onTouchendCapture: fn,
+ },
})
})
@@ -160,11 +160,11 @@ describe('compat: render function', () => {
// expression: '1 + 1',
arg: 'foo',
modifiers: {
- bar: true
- }
- }
- ]
- })
+ bar: true,
+ },
+ },
+ ],
+ }),
).toMatchObject({
dirs: [
{
@@ -174,22 +174,22 @@ describe('compat: render function', () => {
oldValue: void 0,
arg: 'foo',
modifiers: {
- bar: true
- }
- }
- ] as DirectiveBinding[]
+ bar: true,
+ },
+ },
+ ] as DirectiveBinding[],
})
})
test('scopedSlots', () => {
const scopedSlots = {
- default() {}
+ default() {},
}
const vnode = h(mockComponent, {
- scopedSlots
+ scopedSlots,
})
expect(vnode).toMatchObject({
- children: scopedSlots
+ children: scopedSlots,
})
expect('scopedSlots' in vnode.props!).toBe(false)
expect(vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN).toBeTruthy()
@@ -201,7 +201,7 @@ describe('compat: render function', () => {
h('div', { slot: 'foo' }, 'one'),
h('div', { slot: 'bar' }, 'two'),
h('div', { slot: 'foo' }, 'three'),
- h('div', 'four')
+ h('div', 'four'),
])
expect(vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN).toBeTruthy()
const slots = vnode.children as any
@@ -210,7 +210,7 @@ describe('compat: render function', () => {
expect(slots.default()).toMatchObject(['text', { children: 'four' }])
expect(slots.foo()).toMatchObject([
{ children: 'one' },
- { children: 'three' }
+ { children: 'three' },
])
expect(slots.bar()).toMatchObject([{ children: 'two' }])
})
@@ -224,16 +224,16 @@ describe('compat: render function', () => {
'div',
{
class: 'foo',
- attrs: { id: 'bar' }
+ attrs: { id: 'bar' },
},
- 'hello'
+ 'hello',
)
- }
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.outerHTML).toBe(`
hello
`)
expect(
- deprecationData[DeprecationTypes.RENDER_FUNCTION].message
+ deprecationData[DeprecationTypes.RENDER_FUNCTION].message,
).toHaveBeenWarned()
})
@@ -241,13 +241,13 @@ describe('compat: render function', () => {
const vm = new Vue({
data() {
return {
- a: 'hello'
+ a: 'hello',
}
},
// check is arg length based
render(c: any, _c: any) {
return createVNode('div', null, c.a)
- }
+ },
}).$mount()
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
expect(vm.$el.outerHTML).toBe(`
hello
`)
diff --git a/packages/vue-compat/__tests__/utils.ts b/packages/vue-compat/__tests__/utils.ts
index bcf72b296de..18e6516a4a6 100644
--- a/packages/vue-compat/__tests__/utils.ts
+++ b/packages/vue-compat/__tests__/utils.ts
@@ -1,10 +1,12 @@
export function triggerEvent(
target: Element,
event: string,
- process?: (e: any) => any
+ process?: (e: any) => any,
) {
- const e = document.createEvent('HTMLEvents')
- e.initEvent(event, true, true)
+ const e = new Event(event, {
+ bubbles: true,
+ cancelable: true,
+ })
if (process) process(e)
target.dispatchEvent(e)
return e
diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json
index 92b0bdddfa2..e97e15a9289 100644
--- a/packages/vue-compat/package.json
+++ b/packages/vue-compat/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/compat",
- "version": "3.3.4",
+ "version": "3.4.15",
"description": "Vue 3 compatibility build for Vue 2",
"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
@@ -10,6 +10,20 @@
"index.js",
"dist"
],
+ "exports": {
+ ".": {
+ "types": "./dist/vue.d.ts",
+ "node": {
+ "production": "./dist/vue.cjs.prod.js",
+ "development": "./dist/vue.cjs.js",
+ "default": "./index.js"
+ },
+ "module": "./dist/vue.esm-bundler.js",
+ "import": "./dist/vue.esm-bundler.js",
+ "require": "./index.js"
+ },
+ "./*": "./*"
+ },
"buildOptions": {
"name": "Vue",
"filename": "vue",
@@ -38,11 +52,11 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue-compat#readme",
"dependencies": {
- "@babel/parser": "^7.21.3",
+ "@babel/parser": "^7.23.6",
"estree-walker": "^2.0.2",
"source-map-js": "^1.0.2"
},
"peerDependencies": {
- "vue": "3.3.4"
+ "vue": "workspace:*"
}
}
diff --git a/packages/vue-compat/src/createCompatVue.ts b/packages/vue-compat/src/createCompatVue.ts
index 5815fc21dc6..3144a529de6 100644
--- a/packages/vue-compat/src/createCompatVue.ts
+++ b/packages/vue-compat/src/createCompatVue.ts
@@ -2,14 +2,14 @@
// `dist/vue.esm-bundler.js` which is used by default for bundlers.
import { initDev } from './dev'
import {
- compatUtils,
- createApp,
+ DeprecationTypes,
+ KeepAlive,
Transition,
TransitionGroup,
- KeepAlive,
- DeprecationTypes,
+ compatUtils,
+ createApp,
+ vModelDynamic,
vShow,
- vModelDynamic
} from '@vue/runtime-dom'
import { extend } from '@vue/shared'
@@ -20,7 +20,7 @@ if (__DEV__) {
import * as runtimeDom from '@vue/runtime-dom'
function wrappedCreateApp(...args: any[]) {
- // @ts-ignore
+ // @ts-expect-error
const app = createApp(...args)
if (compatUtils.isCompatEnabled(DeprecationTypes.RENDER_FUNCTION, null)) {
// register built-in components so that they can be resolved via strings
diff --git a/packages/vue-compat/src/dev.ts b/packages/vue-compat/src/dev.ts
index 99ba49a2085..22e1c6c3858 100644
--- a/packages/vue-compat/src/dev.ts
+++ b/packages/vue-compat/src/dev.ts
@@ -5,7 +5,7 @@ export function initDev() {
if (!__ESM_BUNDLER__) {
console.info(
`You are running a development build of Vue.\n` +
- `Make sure to use the production build (*.prod.js) when deploying for production.`
+ `Make sure to use the production build (*.prod.js) when deploying for production.`,
)
}
diff --git a/packages/vue-compat/src/index.ts b/packages/vue-compat/src/index.ts
index 642ecd20d11..70608b7e646 100644
--- a/packages/vue-compat/src/index.ts
+++ b/packages/vue-compat/src/index.ts
@@ -1,21 +1,29 @@
// This entry is the "full-build" that includes both the runtime
// and the compiler, and supports on-the-fly compilation of the template option.
import { createCompatVue } from './createCompatVue'
-import { compile, CompilerError, CompilerOptions } from '@vue/compiler-dom'
-import { registerRuntimeCompiler, RenderFunction, warn } from '@vue/runtime-dom'
-import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
-import { InternalRenderFunction } from 'packages/runtime-core/src/component'
+import {
+ type CompilerError,
+ type CompilerOptions,
+ compile,
+} from '@vue/compiler-dom'
+import {
+ type RenderFunction,
+ registerRuntimeCompiler,
+ warn,
+} from '@vue/runtime-dom'
+import { NOOP, extend, generateCodeFrame, isString } from '@vue/shared'
+import type { InternalRenderFunction } from 'packages/runtime-core/src/component'
import * as runtimeDom from '@vue/runtime-dom'
import {
DeprecationTypes,
- warnDeprecation
+ warnDeprecation,
} from '../../runtime-core/src/compat/compatConfig'
const compileCache: Record
= Object.create(null)
function compileToFunction(
template: string | HTMLElement,
- options?: CompilerOptions
+ options?: CompilerOptions,
): RenderFunction {
if (!isString(template)) {
if (template.nodeType) {
@@ -55,10 +63,10 @@ function compileToFunction(
hoistStatic: true,
whitespace: 'preserve',
onError: __DEV__ ? onError : undefined,
- onWarn: __DEV__ ? e => onError(e, true) : NOOP
+ onWarn: __DEV__ ? e => onError(e, true) : NOOP,
} as CompilerOptions,
- options
- )
+ options,
+ ),
)
function onError(err: CompilerError, asWarning = false) {
@@ -70,7 +78,7 @@ function compileToFunction(
generateCodeFrame(
template as string,
err.loc.start.offset,
- err.loc.end.offset
+ err.loc.end.offset,
)
warn(codeFrame ? `${message}\n${codeFrame}` : message)
}
diff --git a/packages/vue-compat/src/runtime.ts b/packages/vue-compat/src/runtime.ts
index 5cb5845b24c..9b52d0de6c3 100644
--- a/packages/vue-compat/src/runtime.ts
+++ b/packages/vue-compat/src/runtime.ts
@@ -12,10 +12,10 @@ Vue.compile = (() => {
(__ESM_BUNDLER__
? ` Configure your bundler to alias "vue" to "@vue/compat/dist/vue.esm-bundler.js".`
: __ESM_BROWSER__
- ? ` Use "vue.esm-browser.js" instead.`
- : __GLOBAL__
- ? ` Use "vue.global.js" instead.`
- : ``) /* should not happen */
+ ? ` Use "vue.esm-browser.js" instead.`
+ : __GLOBAL__
+ ? ` Use "vue.global.js" instead.`
+ : ``) /* should not happen */,
)
}
}) as any
diff --git a/packages/vue/README.md b/packages/vue/README.md
index a98bd997487..2aca524e03d 100644
--- a/packages/vue/README.md
+++ b/packages/vue/README.md
@@ -33,18 +33,23 @@
#### Bundler Build Feature Flags
-Starting with 3.0.0-rc.3, `esm-bundler` builds now exposes global feature flags that can be overwritten at compile time:
+[Detailed Reference on vuejs.org](https://vuejs.org/api/compile-time-flags.html)
-- `__VUE_OPTIONS_API__` (enable/disable Options API support, default: `true`)
-- `__VUE_PROD_DEVTOOLS__` (enable/disable devtools support in production, default: `false`)
+`esm-bundler` builds of Vue expose global feature flags that can be overwritten at compile time:
-The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree-shaking in the final bundle. To configure these flags:
+- `__VUE_OPTIONS_API__`
+ - Default: `true`
+ - Enable / disable Options API support
-- webpack: use [DefinePlugin](https://webpack.js.org/plugins/define-plugin/)
-- Rollup: use [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace)
-- Vite: configured by default, but can be overwritten using the [`define` option](https://github.com/vitejs/vite/blob/a4133c073e640b17276b2de6e91a6857bdf382e1/src/node/config.ts#L72-L76)
+- `__VUE_PROD_DEVTOOLS__`
+ - Default: `false`
+ - Enable / disable devtools support in production
-Note: the replacement value **must be boolean literals** and cannot be strings, otherwise the bundler/minifier will not be able to properly evaluate the conditions.
+- `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`
+ - Default: `false`
+ - Enable / disable detailed warnings for hydration mismatches in production
+
+The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree-shaking in the final bundle.
### For Server-Side Rendering
diff --git a/packages/vue/__tests__/customElementCasing.spec.ts b/packages/vue/__tests__/customElementCasing.spec.ts
index b08de351de1..7712099bff4 100644
--- a/packages/vue/__tests__/customElementCasing.spec.ts
+++ b/packages/vue/__tests__/customElementCasing.spec.ts
@@ -1,4 +1,3 @@
-import { vi } from 'vitest'
import { createApp } from '../src'
// https://github.com/vuejs/docs/pull/1890
@@ -13,7 +12,7 @@ test('custom element event casing', () => {
this.dispatchEvent(new Event('CAPScase'))
this.dispatchEvent(new Event('PascalCase'))
}
- }
+ },
)
const container = document.createElement('div')
@@ -34,8 +33,8 @@ test('custom element event casing', () => {
}" />`,
methods: {
handler,
- handler2
- }
+ handler2,
+ },
}).mount(container)
expect(handler).toHaveBeenCalledTimes(3)
diff --git a/packages/vue/__tests__/e2e/Transition.spec.ts b/packages/vue/__tests__/e2e/Transition.spec.ts
index f283d82608c..e8d6d1e049e 100644
--- a/packages/vue/__tests__/e2e/Transition.spec.ts
+++ b/packages/vue/__tests__/e2e/Transition.spec.ts
@@ -1,7 +1,6 @@
-import { vi } from 'vitest'
import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
-import path from 'path'
-import { h, createApp, Transition, ref, nextTick } from 'vue'
+import path from 'node:path'
+import { Transition, createApp, h, nextTick, ref } from 'vue'
describe('e2e: Transition', () => {
const { page, html, classList, isVisible, timeout, nextFrame, click } =
@@ -47,7 +46,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -56,13 +55,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-leave-from',
- 'v-leave-active'
+ 'v-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-leave-active',
- 'v-leave-to'
+ 'v-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -71,18 +70,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-enter-from',
- 'v-enter-active'
+ 'v-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-enter-active',
- 'v-enter-to'
+ 'v-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -103,7 +102,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -112,13 +111,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -127,18 +126,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -164,7 +163,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -173,13 +172,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'bye-from',
- 'bye-active'
+ 'bye-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'bye-active',
- 'bye-to'
+ 'bye-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -188,18 +187,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'hello-from',
- 'hello-active'
+ 'hello-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'hello-active',
- 'hello-to'
+ 'hello-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -223,7 +222,7 @@ describe('e2e: Transition', () => {
const click = () => (toggle.value = !toggle.value)
const changeName = () => (name.value = 'changed')
return { toggle, click, name, changeName }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -232,13 +231,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -250,18 +249,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'changed-enter-from',
- 'changed-enter-active'
+ 'changed-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'changed-enter-active',
- 'changed-enter-to'
+ 'changed-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -288,7 +287,7 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -296,12 +295,12 @@ describe('e2e: Transition', () => {
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()"
+ @before-leave="beforeLeaveSpy()"
+ @leave="onLeaveSpy()"
+ @after-leave="afterLeaveSpy()">
content
@@ -318,9 +317,9 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
}
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -329,7 +328,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
expect(beforeLeaveSpy).toBeCalled()
expect(onLeaveSpy).toBeCalled()
@@ -338,7 +337,7 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
expect(afterLeaveSpy).not.toBeCalled()
await transitionFinish()
@@ -349,7 +348,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
expect(beforeEnterSpy).toBeCalled()
expect(onEnterSpy).toBeCalled()
@@ -358,14 +357,14 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
expect(afterEnterSpy).not.toBeCalled()
await transitionFinish()
expect(await html('#container')).toBe('content
')
expect(afterEnterSpy).toBeCalled()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -392,7 +391,7 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -442,9 +441,9 @@ describe('e2e: Transition', () => {
},
afterLeaveSpy: (el: Element) => {
afterLeaveSpy()
- }
+ },
}
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -457,7 +456,7 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'before-leave',
- 'leave'
+ 'leave',
])
await timeout(200 + buffer)
@@ -472,16 +471,16 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'before-enter',
- 'enter'
+ 'enter',
])
await timeout(200 + buffer)
expect(afterEnterSpy).toBeCalled()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test('onEnterCancelled', async () => {
@@ -497,7 +496,7 @@ describe('e2e: Transition', () => {
+ @enter-cancelled="enterCancelledSpy()">
content
@@ -509,9 +508,9 @@ describe('e2e: Transition', () => {
return {
toggle,
click,
- enterCancelledSpy
+ enterCancelledSpy,
}
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('')
@@ -520,27 +519,27 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
// cancel (leave)
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
expect(enterCancelledSpy).toBeCalled()
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -568,7 +567,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
return Promise.resolve().then(() => {
return document.querySelector('.test')!.className.split(/\s+/g)
@@ -578,13 +577,13 @@ describe('e2e: Transition', () => {
expect(appearClass).toStrictEqual([
'test',
'test-appear-from',
- 'test-appear-active'
+ 'test-appear-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-appear-active',
- 'test-appear-to'
+ 'test-appear-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
@@ -593,13 +592,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -608,18 +607,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -655,7 +654,7 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -667,15 +666,15 @@ describe('e2e: Transition', () => {
appear-from-class="test-appear-from"
appear-to-class="test-appear-to"
appear-active-class="test-appear-active"
- @before-enter="beforeEnterSpy"
- @enter="onEnterSpy"
- @after-enter="afterEnterSpy"
- @before-leave="beforeLeaveSpy"
- @leave="onLeaveSpy"
- @after-leave="afterLeaveSpy"
- @before-appear="beforeAppearSpy"
- @appear="onAppearSpy"
- @after-appear="afterAppearSpy">
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()"
+ @before-leave="beforeLeaveSpy()"
+ @leave="onLeaveSpy()"
+ @after-leave="afterLeaveSpy()"
+ @before-appear="beforeAppearSpy()"
+ @appear="onAppearSpy()"
+ @after-appear="afterAppearSpy()">
content
@@ -695,9 +694,9 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
}
- }
+ },
}).mount('#app')
return Promise.resolve().then(() => {
return document.querySelector('.test')!.className.split(/\s+/g)
@@ -707,7 +706,7 @@ describe('e2e: Transition', () => {
expect(appearClass).toStrictEqual([
'test',
'test-appear-from',
- 'test-appear-active'
+ 'test-appear-active',
])
expect(beforeAppearSpy).toBeCalled()
expect(onAppearSpy).toBeCalled()
@@ -716,7 +715,7 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-appear-active',
- 'test-appear-to'
+ 'test-appear-to',
])
expect(afterAppearSpy).not.toBeCalled()
await transitionFinish()
@@ -731,7 +730,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
expect(beforeLeaveSpy).toBeCalled()
expect(onLeaveSpy).toBeCalled()
@@ -740,7 +739,7 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
expect(afterLeaveSpy).not.toBeCalled()
await transitionFinish()
@@ -751,7 +750,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
expect(beforeEnterSpy).toBeCalled()
expect(onEnterSpy).toBeCalled()
@@ -760,14 +759,14 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
expect(afterEnterSpy).not.toBeCalled()
await transitionFinish()
expect(await html('#container')).toBe('
content
')
expect(afterEnterSpy).toBeCalled()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -794,7 +793,7 @@ describe('e2e: Transition', () => {
onAfterEnterSpy,
onBeforeLeaveSpy,
onLeaveSpy,
- onAfterLeaveSpy
+ onAfterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -803,12 +802,12 @@ describe('e2e: Transition', () => {
+ @before-enter="onBeforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="onAfterEnterSpy()"
+ @before-leave="onBeforeLeaveSpy()"
+ @leave="onLeaveSpy()"
+ @after-leave="onAfterLeaveSpy()">
content
@@ -825,9 +824,9 @@ describe('e2e: Transition', () => {
onAfterEnterSpy,
onBeforeLeaveSpy,
onLeaveSpy,
- onAfterLeaveSpy
+ onAfterLeaveSpy,
}
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -845,7 +844,7 @@ describe('e2e: Transition', () => {
expect(onAfterEnterSpy).toBeCalled()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -866,7 +865,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -874,7 +873,7 @@ describe('e2e: Transition', () => {
// leave
expect(await classWhenTransitionStart()).toStrictEqual([
'noop-leave-from',
- 'noop-leave-active'
+ 'noop-leave-active',
])
await nextFrame()
expect(await html('#container')).toBe('')
@@ -882,12 +881,12 @@ describe('e2e: Transition', () => {
// enter
expect(await classWhenTransitionStart()).toStrictEqual([
'noop-enter-from',
- 'noop-enter-active'
+ 'noop-enter-active',
])
await nextFrame()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -908,7 +907,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -916,12 +915,12 @@ describe('e2e: Transition', () => {
// leave
expect(await classWhenTransitionStart()).toStrictEqual([
'test-anim-leave-from',
- 'test-anim-leave-active'
+ 'test-anim-leave-active',
])
await nextFrame()
expect(await classList('#container div')).toStrictEqual([
'test-anim-leave-active',
- 'test-anim-leave-to'
+ 'test-anim-leave-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('')
@@ -929,17 +928,17 @@ describe('e2e: Transition', () => {
// enter
expect(await classWhenTransitionStart()).toStrictEqual([
'test-anim-enter-from',
- 'test-anim-enter-active'
+ 'test-anim-enter-active',
])
await nextFrame()
expect(await classList('#container div')).toStrictEqual([
'test-anim-enter-active',
- 'test-anim-enter-to'
+ 'test-anim-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -956,7 +955,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -964,12 +963,12 @@ describe('e2e: Transition', () => {
// leave
expect(await classWhenTransitionStart()).toStrictEqual([
'test-anim-long-leave-from',
- 'test-anim-long-leave-active'
+ 'test-anim-long-leave-active',
])
await nextFrame()
expect(await classList('#container div')).toStrictEqual([
'test-anim-long-leave-active',
- 'test-anim-long-leave-to'
+ 'test-anim-long-leave-to',
])
if (!process.env.CI) {
@@ -978,7 +977,7 @@ describe('e2e: Transition', () => {
})
expect(await classList('#container div')).toStrictEqual([
'test-anim-long-leave-active',
- 'test-anim-long-leave-to'
+ 'test-anim-long-leave-to',
])
}
@@ -988,12 +987,12 @@ describe('e2e: Transition', () => {
// enter
expect(await classWhenTransitionStart()).toStrictEqual([
'test-anim-long-enter-from',
- 'test-anim-long-enter-active'
+ 'test-anim-long-enter-active',
])
await nextFrame()
expect(await classList('#container div')).toStrictEqual([
'test-anim-long-enter-active',
- 'test-anim-long-enter-to'
+ 'test-anim-long-enter-to',
])
if (!process.env.CI) {
@@ -1002,14 +1001,14 @@ describe('e2e: Transition', () => {
})
expect(await classList('#container div')).toStrictEqual([
'test-anim-long-enter-active',
- 'test-anim-long-enter-to'
+ 'test-anim-long-enter-to',
])
}
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1030,11 +1029,11 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
- ' '
+ ' ',
)
const svgTransitionStart = () =>
@@ -1052,13 +1051,13 @@ describe('e2e: Transition', () => {
expect(await svgTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -1067,20 +1066,20 @@ describe('e2e: Transition', () => {
expect(await svgTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe(
- ' '
+ ' ',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1096,13 +1095,13 @@ describe('e2e: Transition', () => {
components: {
'my-transition': (props: any, { slots }: any) => {
return h(Transition, { name: 'test' }, slots)
- }
+ },
},
setup: () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -1111,13 +1110,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -1126,18 +1125,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1157,11 +1156,11 @@ describe('e2e: Transition', () => {
`,
components: {
one: {
- template: 'one
'
+ template: 'one
',
},
two: {
- template: 'two
'
- }
+ template: 'two
',
+ },
},
setup: () => {
const toggle = ref(true)
@@ -1170,7 +1169,7 @@ describe('e2e: Transition', () => {
const change = () =>
(view.value = view.value === 'one' ? 'two' : 'one')
return { toggle, click, change, view }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('')
@@ -1183,13 +1182,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('two
')
@@ -1202,18 +1201,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
@@ -1234,7 +1233,7 @@ describe('e2e: Transition', () => {
createApp({
template: `
-
+
content
@@ -1246,21 +1245,21 @@ describe('e2e: Transition', () => {
Comp: {
async setup() {
return () => h('div', { class: 'test' }, 'content')
- }
- }
+ },
+ },
},
setup: () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click, onEnterSpy, onLeaveSpy }
- }
+ },
}).mount('#app')
})
expect(onEnterSpy).toBeCalledTimes(1)
await nextFrame()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
await transitionFinish()
expect(await html('#container')).toBe('content
')
@@ -1269,14 +1268,14 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-leave-from',
- 'v-leave-active'
+ 'v-leave-active',
])
expect(onLeaveSpy).toBeCalledTimes(1)
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-leave-active',
- 'v-leave-to'
+ 'v-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -1297,19 +1296,19 @@ describe('e2e: Transition', () => {
expect(enterClass).toStrictEqual([
'test',
'v-enter-from',
- 'v-enter-active'
+ 'v-enter-active',
])
expect(onEnterSpy).toBeCalledTimes(2)
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-enter-active',
- 'v-enter-to'
+ 'v-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
// #1689
@@ -1333,7 +1332,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -1342,13 +1341,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-leave-from',
- 'v-leave-active'
+ 'v-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-leave-active',
- 'v-leave-to'
+ 'v-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -1357,18 +1356,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-enter-from',
- 'v-enter-active'
+ 'v-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-enter-active',
- 'v-enter-to'
+ 'v-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1385,12 +1384,12 @@ describe('e2e: Transition', () => {
const One = {
async setup() {
return () => h('div', { class: 'test' }, 'one')
- }
+ },
}
const Two = {
async setup() {
return () => h('div', { class: 'test' }, 'two')
- }
+ },
}
createApp({
template: `
@@ -1409,13 +1408,13 @@ describe('e2e: Transition', () => {
view.value = view.value === One ? Two : One
}
return { view, click }
- }
+ },
}).mount('#app')
})
await nextFrame()
expect(await html('#container')).toBe(
- 'one
'
+ 'one
',
)
await transitionFinish()
expect(await html('#container')).toBe('one
')
@@ -1424,7 +1423,7 @@ describe('e2e: Transition', () => {
await classWhenTransitionStart()
await nextFrame()
expect(await html('#container')).toBe(
- 'one
'
+ 'one
',
)
await transitionFinish()
await nextFrame()
@@ -1434,7 +1433,7 @@ describe('e2e: Transition', () => {
await transitionFinish()
expect(await html('#container')).toBe('two
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
// #3963
@@ -1448,13 +1447,13 @@ describe('e2e: Transition', () => {
template: `{{ msg }}
`,
setup() {
return new Promise(_resolve => {
- // @ts-ignore
+ // @ts-expect-error
window.resolve = () =>
_resolve({
- msg: 'success'
+ msg: 'success',
})
})
- }
+ },
}
createApp({
@@ -1479,7 +1478,7 @@ describe('e2e: Transition', () => {
view.value = view.value ? null : h(One)
}
return { view, click }
- }
+ },
}).mount('#app')
})
@@ -1490,14 +1489,239 @@ describe('e2e: Transition', () => {
expect(await html('#container')).toBe('Loading...
')
await page().evaluate(() => {
- // @ts-ignore
+ // @ts-expect-error
window.resolve()
})
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('success
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
+ )
+
+ // #5844
+ test('children mount should be called after html changes', async () => {
+ const fooMountSpy = vi.fn()
+ const barMountSpy = vi.fn()
+
+ await page().exposeFunction('fooMountSpy', fooMountSpy)
+ await page().exposeFunction('barMountSpy', barMountSpy)
+
+ await page().evaluate(() => {
+ const { fooMountSpy, barMountSpy } = window as any
+ const { createApp, ref, h, onMounted } = (window as any).Vue
+ createApp({
+ template: `
+
+
+
+
+
+
+
+
+ button
+ `,
+ components: {
+ Foo: {
+ setup() {
+ const el = ref(null)
+ onMounted(() => {
+ fooMountSpy(
+ !!el.value,
+ !!document.getElementById('foo'),
+ !!document.getElementById('bar'),
+ )
+ })
+
+ return () => h('div', { ref: el, id: 'foo' }, 'Foo')
+ },
+ },
+ Bar: {
+ setup() {
+ const el = ref(null)
+ onMounted(() => {
+ barMountSpy(
+ !!el.value,
+ !!document.getElementById('foo'),
+ !!document.getElementById('bar'),
+ )
+ })
+
+ return () => h('div', { ref: el, id: 'bar' }, 'Bar')
+ },
+ },
+ },
+ setup: () => {
+ const toggle = ref(true)
+ const click = () => (toggle.value = !toggle.value)
+ return { toggle, click }
+ },
+ }).mount('#app')
+ })
+
+ await nextFrame()
+ expect(await html('#container')).toBe('Foo
')
+ await transitionFinish()
+
+ expect(fooMountSpy).toBeCalledTimes(1)
+ expect(fooMountSpy).toHaveBeenNthCalledWith(1, true, true, false)
+
+ await page().evaluate(async () => {
+ ;(document.querySelector('#toggleBtn') as any)!.click()
+ // nextTrick for patch start
+ await Promise.resolve()
+ // nextTrick for Suspense resolve
+ await Promise.resolve()
+ // nextTrick for dom transition start
+ await Promise.resolve()
+ return document.querySelector('#container div')!.className.split(/\s+/g)
+ })
+
+ await nextFrame()
+ await transitionFinish()
+
+ expect(await html('#container')).toBe('Bar
')
+
+ expect(barMountSpy).toBeCalledTimes(1)
+ expect(barMountSpy).toHaveBeenNthCalledWith(1, true, false, true)
+ })
+
+ // #8105
+ test(
+ 'trigger again when transition is not finished',
+ async () => {
+ await page().evaluate(duration => {
+ const { createApp, shallowRef, h } = (window as any).Vue
+ const One = {
+ async setup() {
+ return () => h('div', { class: 'test' }, 'one')
+ },
+ }
+ const Two = {
+ async setup() {
+ return () => h('div', { class: 'test' }, 'two')
+ },
+ }
+ createApp({
+ template: `
+
+
+
+
+
+
+
+ button
+ `,
+ setup: () => {
+ const view = shallowRef(One)
+ const click = () => {
+ view.value = view.value === One ? Two : One
+ }
+ return { view, click }
+ },
+ }).mount('#app')
+ }, duration)
+
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'one
',
+ )
+
+ await transitionFinish()
+ expect(await html('#container')).toBe('one
')
+
+ // trigger twice
+ classWhenTransitionStart()
+ classWhenTransitionStart()
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'one
',
+ )
+
+ await transitionFinish()
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'one
',
+ )
+
+ await transitionFinish()
+ await nextFrame()
+ expect(await html('#container')).toBe('one
')
+ },
+ E2E_TIMEOUT,
+ )
+
+ // #9996
+ test(
+ 'trigger again when transition is not finished & correctly anchor',
+ async () => {
+ await page().evaluate(duration => {
+ const { createApp, shallowRef, h } = (window as any).Vue
+ const One = {
+ async setup() {
+ return () => h('div', { class: 'test' }, 'one')
+ },
+ }
+ const Two = {
+ async setup() {
+ return () => h('div', { class: 'test' }, 'two')
+ },
+ }
+ createApp({
+ template: `
+
+
Top
+
+
+
+
+
+
Bottom
+
+ button
+ `,
+ setup: () => {
+ const view = shallowRef(One)
+ const click = () => {
+ view.value = view.value === One ? Two : One
+ }
+ return { view, click }
+ },
+ }).mount('#app')
+ }, duration)
+
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'Top
one
Bottom
',
+ )
+
+ await transitionFinish()
+ expect(await html('#container')).toBe(
+ 'Top
one
Bottom
',
+ )
+
+ // trigger twice
+ classWhenTransitionStart()
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'Top
one
Bottom
',
+ )
+
+ await transitionFinish()
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'Top
two
Bottom
',
+ )
+
+ await transitionFinish()
+ await nextFrame()
+ expect(await html('#container')).toBe(
+ 'Top
two
Bottom
',
+ )
+ },
+ E2E_TIMEOUT,
)
})
@@ -1520,7 +1744,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -1530,13 +1754,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await isVisible('.test')).toBe(false)
@@ -1545,20 +1769,20 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1585,7 +1809,7 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -1593,12 +1817,12 @@ describe('e2e: Transition', () => {
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()"
+ @before-leave="beforeLeaveSpy()"
+ @leave="onLeaveSpy()"
+ @after-leave="afterLeaveSpy()">
content
@@ -1615,9 +1839,9 @@ describe('e2e: Transition', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
}
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -1626,7 +1850,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
expect(beforeLeaveSpy).toBeCalled()
expect(onLeaveSpy).toBeCalled()
@@ -1635,7 +1859,7 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
expect(afterLeaveSpy).not.toBeCalled()
await transitionFinish()
@@ -1646,7 +1870,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
expect(beforeEnterSpy).toBeCalled()
expect(onEnterSpy).toBeCalled()
@@ -1655,16 +1879,16 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
expect(afterEnterSpy).not.toBeCalled()
await transitionFinish()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
expect(afterEnterSpy).toBeCalled()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1679,7 +1903,7 @@ describe('e2e: Transition', () => {
createApp({
template: `
@@ -1689,7 +1913,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click, onLeaveCancelledSpy }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe('content
')
@@ -1699,34 +1923,34 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
// cancel (enter)
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
expect(onLeaveCancelledSpy).toBeCalled()
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1751,9 +1975,9 @@ describe('e2e: Transition', () => {
appear-from-class="test-appear-from"
appear-to-class="test-appear-to"
appear-active-class="test-appear-active"
- @before-enter="beforeEnterSpy"
- @enter="onEnterSpy"
- @after-enter="afterEnterSpy">
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()">
content
@@ -1767,9 +1991,9 @@ describe('e2e: Transition', () => {
click,
beforeEnterSpy,
onEnterSpy,
- afterEnterSpy
+ afterEnterSpy,
}
- }
+ },
}).mount('#app')
return Promise.resolve().then(() => {
return document.querySelector('.test')!.className.split(/\s+/g)
@@ -1784,13 +2008,13 @@ describe('e2e: Transition', () => {
expect(appearClass).toStrictEqual([
'test',
'test-appear-from',
- 'test-appear-active'
+ 'test-appear-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-appear-active',
- 'test-appear-to'
+ 'test-appear-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
@@ -1803,13 +2027,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await isVisible('.test')).toBe(false)
@@ -1818,20 +2042,20 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
// #4845
@@ -1855,9 +2079,9 @@ describe('e2e: Transition', () => {
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()">
content
@@ -1871,9 +2095,9 @@ describe('e2e: Transition', () => {
click,
beforeEnterSpy,
onEnterSpy,
- afterEnterSpy
+ afterEnterSpy,
}
- }
+ },
}).mount('#app')
})
await nextTick()
@@ -1886,7 +2110,7 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
expect(beforeEnterSpy).toBeCalledTimes(1)
expect(onEnterSpy).toBeCalledTimes(1)
@@ -1895,16 +2119,16 @@ describe('e2e: Transition', () => {
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
expect(afterEnterSpy).not.toBeCalled()
await transitionFinish()
expect(await html('#container')).toBe(
- 'content
'
+ 'content
',
)
expect(afterEnterSpy).toBeCalled()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
@@ -1927,7 +2151,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
}, duration)
expect(await html('#container')).toBe('content
')
@@ -1936,13 +2160,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('')
@@ -1951,18 +2175,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -1983,7 +2207,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
}, duration)
expect(await html('#container')).toBe('content
')
@@ -1992,13 +2216,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -2007,18 +2231,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -2039,7 +2263,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
}, duration)
expect(await html('#container')).toBe('content
')
@@ -2048,13 +2272,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('')
@@ -2063,18 +2287,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -2098,7 +2322,7 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
}, duration)
expect(await html('#container')).toBe('content
')
@@ -2107,13 +2331,13 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-leave-from',
- 'test-leave-active'
+ 'test-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-leave-active',
- 'test-leave-to'
+ 'test-leave-to',
])
await transitionFinish(duration * 2)
expect(await html('#container')).toBe('')
@@ -2122,18 +2346,18 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'test-enter-from',
- 'test-enter-active'
+ 'test-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'test-enter-active',
- 'test-enter-to'
+ 'test-enter-to',
])
await transitionFinish(duration * 4)
expect(await html('#container')).toBe('content
')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -2146,11 +2370,11 @@ describe('e2e: Transition', () => {
content
- `
+ `,
}).mount(document.createElement('div'))
expect(
`[Vue warn]: explicit duration is NaN - ` +
- 'the duration expression might be incorrect.'
+ 'the duration expression might be incorrect.',
).toHaveBeenWarned()
createApp({
@@ -2163,14 +2387,14 @@ describe('e2e: Transition', () => {
content
- `
+ `,
}).mount(document.createElement('div'))
expect(
`[Vue warn]: explicit duration is not a valid number - ` +
- `got ${JSON.stringify({})}`
+ `got ${JSON.stringify({})}`,
).toHaveBeenWarned()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
@@ -2178,12 +2402,12 @@ describe('e2e: Transition', () => {
createApp({
render() {
return h(Transition, null, {
- default: () => [h('div'), h('div')]
+ default: () => [h('div'), h('div')],
})
- }
+ },
}).mount(document.createElement('div'))
expect(
- ' can only be used on a single element or component'
+ ' can only be used on a single element or component',
).toHaveBeenWarned()
})
@@ -2195,7 +2419,7 @@ describe('e2e: Transition', () => {
content
- `
+ `,
}).mount(document.createElement('div'))
expect(`invalid mode: none`).toHaveBeenWarned()
})
@@ -2213,11 +2437,11 @@ describe('e2e: Transition', () => {
onLeave(el, end) {
innerSpy()
end()
- }
+ },
},
- this.$slots.default
+ this.$slots.default,
)
- }
+ },
}
const toggle = ref(true)
@@ -2226,9 +2450,9 @@ describe('e2e: Transition', () => {
createApp({
render() {
return h(MyTransition, { onLeave: () => outerSpy() }, () =>
- toggle.value ? h('div') : null
+ toggle.value ? h('div') : null,
)
- }
+ },
}).mount(root)
expect(root.innerHTML).toBe(`
`)
@@ -2251,8 +2475,8 @@ describe('e2e: Transition', () => {
template: `
- `
- }
+ `,
+ },
},
template: `
@@ -2268,24 +2492,24 @@ describe('e2e: Transition', () => {
const toggle = ref(true)
const click = () => (toggle.value = !toggle.value)
return { toggle, click }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
- '
'
+ '
',
)
// leave
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-leave-from',
- 'v-leave-active'
+ 'v-leave-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-leave-active',
- 'v-leave-to'
+ 'v-leave-to',
])
await transitionFinish()
expect(await html('#container')).toBe('')
@@ -2294,19 +2518,19 @@ describe('e2e: Transition', () => {
expect(await classWhenTransitionStart()).toStrictEqual([
'test',
'v-enter-from',
- 'v-enter-active'
+ 'v-enter-active',
])
await nextFrame()
expect(await classList('.test')).toStrictEqual([
'test',
'v-enter-active',
- 'v-enter-to'
+ 'v-enter-to',
])
await transitionFinish()
expect(await html('#container')).toBe(
- '
'
+ '
',
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/TransitionGroup.spec.ts b/packages/vue/__tests__/e2e/TransitionGroup.spec.ts
index a78f3912412..febc9d3c20a 100644
--- a/packages/vue/__tests__/e2e/TransitionGroup.spec.ts
+++ b/packages/vue/__tests__/e2e/TransitionGroup.spec.ts
@@ -1,6 +1,5 @@
-import { vi } from 'vitest'
import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
-import path from 'path'
+import path from 'node:path'
import { createApp, ref } from 'vue'
describe('e2e: TransitionGroup', () => {
@@ -43,13 +42,13 @@ describe('e2e: TransitionGroup', () => {
const items = ref(['a', 'b', 'c'])
const click = () => items.value.push('d', 'e')
return { click, items }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
expect(await htmlWhenTransitionStart()).toBe(
@@ -57,7 +56,7 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
await nextFrame()
expect(await html('#container')).toBe(
@@ -65,7 +64,7 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
await transitionFinish()
expect(await html('#container')).toBe(
@@ -73,10 +72,10 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -97,30 +96,30 @@ describe('e2e: TransitionGroup', () => {
const items = ref(['a', 'b', 'c'])
const click = () => (items.value = ['b'])
return { click, items }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
expect(await htmlWhenTransitionStart()).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
await nextFrame()
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
await transitionFinish()
expect(await html('#container')).toBe(`
b
`)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -141,36 +140,36 @@ describe('e2e: TransitionGroup', () => {
const items = ref(['a', 'b', 'c'])
const click = () => (items.value = ['b', 'c', 'd'])
return { click, items }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
expect(await htmlWhenTransitionStart()).toBe(
`
a
` +
`
b
` +
`
c
` +
- `
d
`
+ `
d
`,
)
await nextFrame()
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
`
c
` +
- `
d
`
+ `
d
`,
)
await transitionFinish()
expect(await html('#container')).toBe(
`
b
` +
`
c
` +
- `
d
`
+ `
d
`,
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -195,7 +194,7 @@ describe('e2e: TransitionGroup', () => {
const items = ref(['a', 'b', 'c'])
const click = () => items.value.push('d', 'e')
return { click, items }
- }
+ },
}).mount('#app')
return Promise.resolve().then(() => {
return document.querySelector('#container')!.innerHTML
@@ -205,19 +204,19 @@ describe('e2e: TransitionGroup', () => {
expect(appearHtml).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
await nextFrame()
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
await transitionFinish()
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
// enter
@@ -226,7 +225,7 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
await nextFrame()
expect(await html('#container')).toBe(
@@ -234,7 +233,7 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
await transitionFinish()
expect(await html('#container')).toBe(
@@ -242,10 +241,10 @@ describe('e2e: TransitionGroup', () => {
`
b
` +
`
c
` +
`
d
` +
- `
e
`
+ `
e
`,
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -266,36 +265,36 @@ describe('e2e: TransitionGroup', () => {
const items = ref(['a', 'b', 'c'])
const click = () => (items.value = ['d', 'b', 'a'])
return { click, items }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
expect(await htmlWhenTransitionStart()).toBe(
`
d
` +
`
b
` +
`
a
` +
- `
c
`
+ `
c
`,
)
await nextFrame()
expect(await html('#container')).toBe(
`
d
` +
`
b
` +
`
a
` +
- `
c
`
+ `
c
`,
)
await transitionFinish(duration * 2)
expect(await html('#container')).toBe(
`
d
` +
`
b
` +
- `
a
`
+ `
a
`,
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -322,16 +321,16 @@ describe('e2e: TransitionGroup', () => {
items.value = ['a', 'b', 'c']
}
return { click, items, name, changeName }
- }
+ },
}).mount('#app')
})
expect(await html('#container')).toBe(
- `
a
` + `
b
` + `
c
`
+ `
a
` + `
b
` + `
c
`,
)
// invalid name
expect(await htmlWhenTransitionStart()).toBe(
- `
b
` + `
c
` + `
a
`
+ `
b
` + `
c
` + `
a
`,
)
// change name
const moveHtml = await page().evaluate(() => {
@@ -343,7 +342,7 @@ describe('e2e: TransitionGroup', () => {
expect(moveHtml).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
// not sure why but we just have to wait really long for this to
// pass consistently :/
@@ -351,10 +350,10 @@ describe('e2e: TransitionGroup', () => {
expect(await html('#container')).toBe(
`
a
` +
`
b
` +
- `
c
`
+ `
c
`,
)
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -390,7 +389,7 @@ describe('e2e: TransitionGroup', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
} = window as any
const { createApp, ref } = (window as any).Vue
createApp({
@@ -401,15 +400,15 @@ describe('e2e: TransitionGroup', () => {
appear-from-class="test-appear-from"
appear-to-class="test-appear-to"
appear-active-class="test-appear-active"
- @before-enter="beforeEnterSpy"
- @enter="onEnterSpy"
- @after-enter="afterEnterSpy"
- @before-leave="beforeLeaveSpy"
- @leave="onLeaveSpy"
- @after-leave="afterLeaveSpy"
- @before-appear="beforeAppearSpy"
- @appear="onAppearSpy"
- @after-appear="afterAppearSpy">
+ @before-enter="beforeEnterSpy()"
+ @enter="onEnterSpy()"
+ @after-enter="afterEnterSpy()"
+ @before-leave="beforeLeaveSpy()"
+ @leave="onLeaveSpy()"
+ @after-leave="afterLeaveSpy()"
+ @before-appear="beforeAppearSpy()"
+ @appear="onAppearSpy()"
+ @after-appear="afterAppearSpy()">
{{item}}
@@ -429,9 +428,9 @@ describe('e2e: TransitionGroup', () => {
afterEnterSpy,
beforeLeaveSpy,
onLeaveSpy,
- afterLeaveSpy
+ afterLeaveSpy,
}
- }
+ },
}).mount('#app')
return Promise.resolve().then(() => {
return document.querySelector('#container')!.innerHTML
@@ -443,21 +442,21 @@ describe('e2e: TransitionGroup', () => {
expect(appearHtml).toBe(
`a
` +
`b
` +
- `c
`
+ `c
`,
)
await nextFrame()
expect(afterAppearSpy).not.toBeCalled()
expect(await html('#container')).toBe(
`a
` +
`b
` +
- `c
`
+ `c
`,
)
await transitionFinish()
expect(afterAppearSpy).toBeCalled()
expect(await html('#container')).toBe(
`a
` +
`b
` +
- `c
`
+ `c
`,
)
// enter + leave
@@ -465,7 +464,7 @@ describe('e2e: TransitionGroup', () => {
`a
` +
`b
` +
`c
` +
- `d
`
+ `d
`,
)
expect(beforeLeaveSpy).toBeCalled()
expect(onLeaveSpy).toBeCalled()
@@ -478,7 +477,7 @@ describe('e2e: TransitionGroup', () => {
`a
` +
`b
` +
`c
` +
- `d
`
+ `d
`,
)
expect(afterLeaveSpy).not.toBeCalled()
expect(afterEnterSpy).not.toBeCalled()
@@ -486,12 +485,12 @@ describe('e2e: TransitionGroup', () => {
expect(await html('#container')).toBe(
`b
` +
`c
` +
- `d
`
+ `d
`,
)
expect(afterLeaveSpy).toBeCalled()
expect(afterEnterSpy).toBeCalled()
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test('warn unkeyed children', () => {
@@ -504,7 +503,7 @@ describe('e2e: TransitionGroup', () => {
setup: () => {
const items = ref(['a', 'b', 'c'])
return { items }
- }
+ },
}).mount(document.createElement('div'))
expect(` children must be keyed`).toHaveBeenWarned()
diff --git a/packages/vue/__tests__/e2e/commits.mock.ts b/packages/vue/__tests__/e2e/commits.mock.ts
index 8bcb8d8f97b..4a793e25aea 100644
--- a/packages/vue/__tests__/e2e/commits.mock.ts
+++ b/packages/vue/__tests__/e2e/commits.mock.ts
@@ -8,17 +8,17 @@ export default {
author: {
name: 'Haoqun Jiang',
email: 'haoqunjiang@gmail.com',
- date: '2019-12-09T19:52:20Z'
+ date: '2019-12-09T19:52:20Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2019-12-09T19:52:20Z'
+ date: '2019-12-09T19:52:20Z',
},
message: 'test: add test for runtime-dom/modules/class (#75)',
tree: {
sha: 'f53f761827af281db86c31d113086c068c1d0789',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/f53f761827af281db86c31d113086c068c1d0789'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/f53f761827af281db86c31d113086c068c1d0789',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
comment_count: 0,
@@ -26,8 +26,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
html_url:
@@ -55,7 +55,7 @@ export default {
received_events_url:
'https://api.github.com/users/sodatea/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -79,16 +79,16 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: '2383b45e322272ddc102d6914c149b284a25d04f',
url: 'https://api.github.com/repos/vuejs/core/commits/2383b45e322272ddc102d6914c149b284a25d04f',
html_url:
- 'https://github.com/vuejs/core/commit/2383b45e322272ddc102d6914c149b284a25d04f'
- }
- ]
+ 'https://github.com/vuejs/core/commit/2383b45e322272ddc102d6914c149b284a25d04f',
+ },
+ ],
},
{
sha: '2383b45e322272ddc102d6914c149b284a25d04f',
@@ -98,17 +98,17 @@ export default {
author: {
name: 'GCA',
email: 'gcaaa31928@gmail.com',
- date: '2019-12-09T19:23:57Z'
+ date: '2019-12-09T19:23:57Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2019-12-09T19:23:57Z'
+ date: '2019-12-09T19:23:57Z',
},
message: 'chore: fix typo (#530) [ci skip]',
tree: {
sha: '2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/2383b45e322272ddc102d6914c149b284a25d04f',
comment_count: 0,
@@ -116,8 +116,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/2383b45e322272ddc102d6914c149b284a25d04f',
html_url:
@@ -146,7 +146,7 @@ export default {
received_events_url:
'https://api.github.com/users/gcaaa31928/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -170,16 +170,16 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: 'e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
url: 'https://api.github.com/repos/vuejs/core/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
html_url:
- 'https://github.com/vuejs/core/commit/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad'
- }
- ]
+ 'https://github.com/vuejs/core/commit/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
+ },
+ ],
},
{
sha: 'e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
@@ -189,17 +189,17 @@ export default {
author: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2019-12-09T19:23:01Z'
+ date: '2019-12-09T19:23:01Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2019-12-09T19:23:01Z'
+ date: '2019-12-09T19:23:01Z',
},
message: 'test: fix warning',
tree: {
sha: 'd942b17681e2e2fbbcd2ee04092390c7f2cf534d',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/d942b17681e2e2fbbcd2ee04092390c7f2cf534d'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/d942b17681e2e2fbbcd2ee04092390c7f2cf534d',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
comment_count: 0,
@@ -207,8 +207,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
html_url:
@@ -237,7 +237,7 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -261,17 +261,17 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: '12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
url: 'https://api.github.com/repos/vuejs/core/commits/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
html_url:
- 'https://github.com/vuejs/core/commit/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e'
- }
- ]
- }
+ 'https://github.com/vuejs/core/commit/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
+ },
+ ],
+ },
],
'v2-compat': [
{
@@ -282,17 +282,17 @@ export default {
author: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-13T03:42:34Z'
+ date: '2018-11-13T03:42:34Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-13T03:54:01Z'
+ date: '2018-11-13T03:54:01Z',
},
message: 'chore: fix tests',
tree: {
sha: '6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
comment_count: 0,
@@ -300,8 +300,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
html_url:
@@ -330,7 +330,7 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -354,16 +354,16 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: 'ca296812d54aff123472d7147b83fddfb634d9bc',
url: 'https://api.github.com/repos/vuejs/core/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
html_url:
- 'https://github.com/vuejs/core/commit/ca296812d54aff123472d7147b83fddfb634d9bc'
- }
- ]
+ 'https://github.com/vuejs/core/commit/ca296812d54aff123472d7147b83fddfb634d9bc',
+ },
+ ],
},
{
sha: 'ca296812d54aff123472d7147b83fddfb634d9bc',
@@ -373,17 +373,17 @@ export default {
author: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-13T03:21:56Z'
+ date: '2018-11-13T03:21:56Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-13T03:46:06Z'
+ date: '2018-11-13T03:46:06Z',
},
message: 'refactor: bring back clone for reused nodes',
tree: {
sha: '2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
comment_count: 0,
@@ -391,8 +391,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
html_url:
@@ -421,7 +421,7 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -445,16 +445,16 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: 'e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
url: 'https://api.github.com/repos/vuejs/core/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
html_url:
- 'https://github.com/vuejs/core/commit/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b'
- }
- ]
+ 'https://github.com/vuejs/core/commit/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
+ },
+ ],
},
{
sha: 'e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
@@ -464,17 +464,17 @@ export default {
author: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-02T20:59:45Z'
+ date: '2018-11-02T20:59:45Z',
},
committer: {
name: 'Evan You',
email: 'yyx990803@gmail.com',
- date: '2018-11-02T20:59:45Z'
+ date: '2018-11-02T20:59:45Z',
},
message: 'chore: relax render type for tsx',
tree: {
sha: '7e2b3bb92ab91f755b2251e4a7903e6dd2042602',
- url: 'https://api.github.com/repos/vuejs/core/git/trees/7e2b3bb92ab91f755b2251e4a7903e6dd2042602'
+ url: 'https://api.github.com/repos/vuejs/core/git/trees/7e2b3bb92ab91f755b2251e4a7903e6dd2042602',
},
url: 'https://api.github.com/repos/vuejs/core/git/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
comment_count: 0,
@@ -482,8 +482,8 @@ export default {
verified: false,
reason: 'unsigned',
signature: null,
- payload: null
- }
+ payload: null,
+ },
},
url: 'https://api.github.com/repos/vuejs/core/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
html_url:
@@ -512,7 +512,7 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
committer: {
login: 'yyx990803',
@@ -536,16 +536,16 @@ export default {
received_events_url:
'https://api.github.com/users/yyx990803/received_events',
type: 'User',
- site_admin: false
+ site_admin: false,
},
parents: [
{
sha: 'ccc835caff0344baad3c92ce786ad4f804bf667b',
url: 'https://api.github.com/repos/vuejs/core/commits/ccc835caff0344baad3c92ce786ad4f804bf667b',
html_url:
- 'https://github.com/vuejs/core/commit/ccc835caff0344baad3c92ce786ad4f804bf667b'
- }
- ]
- }
- ]
+ 'https://github.com/vuejs/core/commit/ccc835caff0344baad3c92ce786ad4f804bf667b',
+ },
+ ],
+ },
+ ],
}
diff --git a/packages/vue/__tests__/e2e/commits.spec.ts b/packages/vue/__tests__/e2e/commits.spec.ts
index 1fe26bac2f1..178c918c21a 100644
--- a/packages/vue/__tests__/e2e/commits.spec.ts
+++ b/packages/vue/__tests__/e2e/commits.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
import mocks from './commits.mock'
describe('e2e: commits', () => {
@@ -8,7 +8,7 @@ describe('e2e: commits', () => {
async function testCommits(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/commits.html`
+ `../../examples/${apiType}/commits.html`,
)}`
// intercept and mock the response to avoid hitting the actual API
@@ -22,7 +22,7 @@ describe('e2e: commits', () => {
status: 200,
contentType: 'application/json',
headers: { 'Access-Control-Allow-Origin': '*' },
- body: JSON.stringify(mocks[match[1] as 'main' | 'v2-compat'])
+ body: JSON.stringify(mocks[match[1] as 'main' | 'v2-compat']),
})
}
})
@@ -51,7 +51,7 @@ describe('e2e: commits', () => {
async () => {
await testCommits('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -59,6 +59,6 @@ describe('e2e: commits', () => {
async () => {
await testCommits('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/e2eUtils.ts b/packages/vue/__tests__/e2e/e2eUtils.ts
index 182cf021f17..792e4452fe3 100644
--- a/packages/vue/__tests__/e2e/e2eUtils.ts
+++ b/packages/vue/__tests__/e2e/e2eUtils.ts
@@ -1,17 +1,23 @@
-import puppeteer, { Browser, Page, ClickOptions } from 'puppeteer'
+import puppeteer, {
+ type Browser,
+ type ClickOptions,
+ type Page,
+ type PuppeteerLaunchOptions,
+} from 'puppeteer'
export const E2E_TIMEOUT = 30 * 1000
-const puppeteerOptions = process.env.CI
- ? { args: ['--no-sandbox', '--disable-setuid-sandbox'] }
- : {}
+const puppeteerOptions: PuppeteerLaunchOptions = {
+ args: process.env.CI ? ['--no-sandbox', '--disable-setuid-sandbox'] : [],
+ headless: 'new',
+}
const maxTries = 30
export const timeout = (n: number) => new Promise(r => setTimeout(r, n))
export async function expectByPolling(
poll: () => Promise,
- expected: string
+ expected: string,
) {
for (let tries = 0; tries < maxTries; tries++) {
const actual = (await poll()) || ''
@@ -44,7 +50,7 @@ export function setupPuppeteer() {
const err = e.args()[0]
console.error(
`Error from Puppeteer-loaded page:\n`,
- err.remoteObject().description
+ err.remoteObject().description,
)
}
})
@@ -96,7 +102,7 @@ export function setupPuppeteer() {
async function isChecked(selector: string) {
return await page.$eval(
selector,
- node => (node as HTMLInputElement).checked
+ node => (node as HTMLInputElement).checked,
)
}
@@ -111,7 +117,7 @@ export function setupPuppeteer() {
;(node as HTMLInputElement).value = value as string
node.dispatchEvent(new Event('input'))
},
- value
+ value,
)
}
@@ -131,7 +137,7 @@ export function setupPuppeteer() {
async function clearValue(selector: string) {
return await page.$eval(
selector,
- node => ((node as HTMLInputElement).value = '')
+ node => ((node as HTMLInputElement).value = ''),
)
}
@@ -170,6 +176,6 @@ export function setupPuppeteer() {
enterValue,
clearValue,
timeout,
- nextFrame
+ nextFrame,
}
}
diff --git a/packages/vue/__tests__/e2e/grid.spec.ts b/packages/vue/__tests__/e2e/grid.spec.ts
index 728804e0b50..23b78130785 100644
--- a/packages/vue/__tests__/e2e/grid.spec.ts
+++ b/packages/vue/__tests__/e2e/grid.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
interface TableData {
name: string
@@ -15,7 +15,7 @@ describe('e2e: grid', () => {
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < columns.length; j++) {
expect(
- await text(`tr:nth-child(${i + 1}) td:nth-child(${j + 1})`)
+ await text(`tr:nth-child(${i + 1}) td:nth-child(${j + 1})`),
).toContain(`${data[i][columns[j]]}`)
}
}
@@ -24,7 +24,7 @@ describe('e2e: grid', () => {
async function testGrid(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/grid.html`
+ `../../examples/${apiType}/grid.html`,
)}`
await page().goto(baseUrl)
@@ -37,7 +37,7 @@ describe('e2e: grid', () => {
{ name: 'Chuck Norris', power: Infinity },
{ name: 'Bruce Lee', power: 9000 },
{ name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
+ { name: 'Jet Li', power: 8000 },
])
await click('th:nth-child(1)')
@@ -49,7 +49,7 @@ describe('e2e: grid', () => {
{ name: 'Jet Li', power: 8000 },
{ name: 'Jackie Chan', power: 7000 },
{ name: 'Chuck Norris', power: Infinity },
- { name: 'Bruce Lee', power: 9000 }
+ { name: 'Bruce Lee', power: 9000 },
])
await click('th:nth-child(2)')
@@ -61,7 +61,7 @@ describe('e2e: grid', () => {
{ name: 'Chuck Norris', power: Infinity },
{ name: 'Bruce Lee', power: 9000 },
{ name: 'Jet Li', power: 8000 },
- { name: 'Jackie Chan', power: 7000 }
+ { name: 'Jackie Chan', power: 7000 },
])
await click('th:nth-child(2)')
@@ -73,7 +73,7 @@ describe('e2e: grid', () => {
{ name: 'Jackie Chan', power: 7000 },
{ name: 'Jet Li', power: 8000 },
{ name: 'Bruce Lee', power: 9000 },
- { name: 'Chuck Norris', power: Infinity }
+ { name: 'Chuck Norris', power: Infinity },
])
await click('th:nth-child(1)')
@@ -85,13 +85,13 @@ describe('e2e: grid', () => {
{ name: 'Bruce Lee', power: 9000 },
{ name: 'Chuck Norris', power: Infinity },
{ name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
+ { name: 'Jet Li', power: 8000 },
])
await typeValue('input[name="query"]', 'j')
await assertTable([
{ name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
+ { name: 'Jet Li', power: 8000 },
])
await typeValue('input[name="query"]', 'infinity')
@@ -108,7 +108,7 @@ describe('e2e: grid', () => {
async () => {
await testGrid('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -116,6 +116,6 @@ describe('e2e: grid', () => {
async () => {
await testGrid('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/markdown.spec.ts b/packages/vue/__tests__/e2e/markdown.spec.ts
index 56c570e198f..8764e66266c 100644
--- a/packages/vue/__tests__/e2e/markdown.spec.ts
+++ b/packages/vue/__tests__/e2e/markdown.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, expectByPolling, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, expectByPolling, setupPuppeteer } from './e2eUtils'
describe('e2e: markdown', () => {
const { page, isVisible, value, html } = setupPuppeteer()
@@ -7,13 +7,13 @@ describe('e2e: markdown', () => {
async function testMarkdown(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/markdown.html#test`
+ `../../examples/${apiType}/markdown.html#test`,
)}`
await page().goto(baseUrl)
expect(await isVisible('#editor')).toBe(true)
expect(await value('textarea')).toBe('# hello')
- expect(await html('#editor div')).toBe('hello \n')
+ expect(await html('#editor div')).toBe('hello \n')
await page().type('textarea', '\n## foo\n\n- bar\n- baz')
@@ -23,9 +23,9 @@ describe('e2e: markdown', () => {
await expectByPolling(
() => html('#editor div'),
- 'hello \n' +
- 'foo \n' +
- '\n'
+ 'hello \n' +
+ 'foo \n' +
+ '\n',
)
}
@@ -34,7 +34,7 @@ describe('e2e: markdown', () => {
async () => {
await testMarkdown('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -42,6 +42,6 @@ describe('e2e: markdown', () => {
async () => {
await testMarkdown('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/svg.spec.ts b/packages/vue/__tests__/e2e/svg.spec.ts
index 09b5be81a91..37081e4c03c 100644
--- a/packages/vue/__tests__/e2e/svg.spec.ts
+++ b/packages/vue/__tests__/e2e/svg.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
declare const globalStats: {
label: string
@@ -9,7 +9,7 @@ declare const globalStats: {
declare function valueToPoint(
value: number,
index: number,
- total: number
+ total: number,
): {
x: number
y: number
@@ -33,8 +33,8 @@ describe('e2e: svg', () => {
document.querySelector('polygon')!.attributes[0].value === points
)
},
- [total]
- )
+ [total],
+ ),
).toBe(true)
}
@@ -47,12 +47,12 @@ describe('e2e: svg', () => {
return [point.x, point.y]
})
},
- [total]
+ [total],
)
for (let i = 0; i < total; i++) {
const textPosition = await page().$eval(
`text:nth-child(${i + 3})`,
- node => [+node.attributes[0].value, +node.attributes[1].value]
+ node => [+node.attributes[0].value, +node.attributes[1].value],
)
expect(textPosition).toEqual(positions[i])
}
@@ -73,7 +73,7 @@ describe('e2e: svg', () => {
async function testSvg(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/svg.html`
+ `../../examples/${apiType}/svg.html`,
)}`
await page().goto(baseUrl)
@@ -144,7 +144,7 @@ describe('e2e: svg', () => {
async () => {
await testSvg('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -152,6 +152,6 @@ describe('e2e: svg', () => {
async () => {
await testSvg('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/todomvc.spec.ts b/packages/vue/__tests__/e2e/todomvc.spec.ts
index 668f9d33390..bd3836282d2 100644
--- a/packages/vue/__tests__/e2e/todomvc.spec.ts
+++ b/packages/vue/__tests__/e2e/todomvc.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
describe('e2e: todomvc', () => {
const {
@@ -13,7 +13,7 @@ describe('e2e: todomvc', () => {
isFocused,
classList,
enterValue,
- clearValue
+ clearValue,
} = setupPuppeteer()
async function removeItemAt(n: number) {
@@ -26,7 +26,7 @@ describe('e2e: todomvc', () => {
async function testTodomvc(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/todomvc.html`
+ `../../examples/${apiType}/todomvc.html`,
)}`
await page().goto(baseUrl)
@@ -174,7 +174,7 @@ describe('e2e: todomvc', () => {
async () => {
await testTodomvc('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -182,6 +182,6 @@ describe('e2e: todomvc', () => {
async () => {
await testTodomvc('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/e2e/tree.spec.ts b/packages/vue/__tests__/e2e/tree.spec.ts
index 74a3df7b0da..8c12537aeb0 100644
--- a/packages/vue/__tests__/e2e/tree.spec.ts
+++ b/packages/vue/__tests__/e2e/tree.spec.ts
@@ -1,5 +1,5 @@
-import path from 'path'
-import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
+import path from 'node:path'
+import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
describe('e2e: tree', () => {
const { page, click, count, text, children, isVisible } = setupPuppeteer()
@@ -7,7 +7,7 @@ describe('e2e: tree', () => {
async function testTree(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
- `../../examples/${apiType}/tree.html`
+ `../../examples/${apiType}/tree.html`,
)}`
await page().goto(baseUrl)
@@ -23,57 +23,57 @@ describe('e2e: tree', () => {
expect((await children('#demo li ul')).length).toBe(4)
expect(await text('#demo li div span')).toContain('[-]')
expect(await text('#demo > .item > ul > .item:nth-child(1)')).toContain(
- 'hello'
+ 'hello',
)
expect(await text('#demo > .item > ul > .item:nth-child(2)')).toContain(
- 'wat'
+ 'wat',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- 'child folder'
+ 'child folder',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- '[+]'
+ '[+]',
)
// add items to root
await click('#demo > .item > ul > .add')
expect((await children('#demo li ul')).length).toBe(5)
expect(await text('#demo > .item > ul > .item:nth-child(1)')).toContain(
- 'hello'
+ 'hello',
)
expect(await text('#demo > .item > ul > .item:nth-child(2)')).toContain(
- 'wat'
+ 'wat',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- 'child folder'
+ 'child folder',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- '[+]'
+ '[+]',
)
expect(await text('#demo > .item > ul > .item:nth-child(4)')).toContain(
- 'new stuff'
+ 'new stuff',
)
// add another item
await click('#demo > .item > ul > .add')
expect((await children('#demo li ul')).length).toBe(6)
expect(await text('#demo > .item > ul > .item:nth-child(1)')).toContain(
- 'hello'
+ 'hello',
)
expect(await text('#demo > .item > ul > .item:nth-child(2)')).toContain(
- 'wat'
+ 'wat',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- 'child folder'
+ 'child folder',
)
expect(await text('#demo > .item > ul > .item:nth-child(3)')).toContain(
- '[+]'
+ '[+]',
)
expect(await text('#demo > .item > ul > .item:nth-child(4)')).toContain(
- 'new stuff'
+ 'new stuff',
)
expect(await text('#demo > .item > ul > .item:nth-child(5)')).toContain(
- 'new stuff'
+ 'new stuff',
)
await click('#demo ul .bold')
@@ -93,7 +93,7 @@ describe('e2e: tree', () => {
expect(await count('.item > ul')).toBe(5)
expect(await text('#demo ul > .item:nth-child(1)')).toContain('[-]')
expect((await children('#demo ul > .item:nth-child(1) > ul')).length).toBe(
- 2
+ 2,
)
}
@@ -102,7 +102,7 @@ describe('e2e: tree', () => {
async () => {
await testTree('classic')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
test(
@@ -110,6 +110,6 @@ describe('e2e: tree', () => {
async () => {
await testTree('composition')
},
- E2E_TIMEOUT
+ E2E_TIMEOUT,
)
})
diff --git a/packages/vue/__tests__/index.spec.ts b/packages/vue/__tests__/index.spec.ts
index f11ea0f022c..0c969f15981 100644
--- a/packages/vue/__tests__/index.spec.ts
+++ b/packages/vue/__tests__/index.spec.ts
@@ -1,6 +1,5 @@
-import { vi } from 'vitest'
import { EMPTY_ARR } from '@vue/shared'
-import { createApp, ref, nextTick, reactive } from '../src'
+import { createApp, nextTick, reactive, ref } from '../src'
describe('compiler + runtime integration', () => {
it('should support runtime template compilation', () => {
@@ -9,9 +8,9 @@ describe('compiler + runtime integration', () => {
template: `{{ count }}`,
data() {
return {
- count: 0
+ count: 0,
}
- }
+ },
}
createApp(App).mount(container)
expect(container.innerHTML).toBe(`0`)
@@ -26,7 +25,7 @@ describe('compiler + runtime integration', () => {
mounted: vi.fn(),
activated: vi.fn(),
deactivated: vi.fn(),
- unmounted: vi.fn()
+ unmounted: vi.fn(),
}
const toggle = ref(true)
@@ -39,12 +38,12 @@ describe('compiler + runtime integration', () => {
`,
data() {
return {
- toggle
+ toggle,
}
},
components: {
- One: one
- }
+ One: one,
+ },
}
createApp(App).mount(container)
expect(container.innerHTML).toBe(`one`)
@@ -84,9 +83,9 @@ describe('compiler + runtime integration', () => {
template: `#template`,
data() {
return {
- count: 0
+ count: 0,
}
- }
+ },
}
createApp(App).mount(container)
expect(container.innerHTML).toBe(`0`)
@@ -102,9 +101,9 @@ describe('compiler + runtime integration', () => {
template,
data() {
return {
- count: 0
+ count: 0,
}
- }
+ },
}
createApp(App).mount(container)
expect(container.innerHTML).toBe(`0`)
@@ -113,28 +112,28 @@ describe('compiler + runtime integration', () => {
it('should warn template compilation errors with codeframe', () => {
const container = document.createElement('div')
const App = {
- template: ``
+ template: `
`,
}
createApp(App).mount(container)
expect(
- `Template compilation error: Element is missing end tag`
+ `Template compilation error: Element is missing end tag`,
).toHaveBeenWarned()
expect(
`
1 |
- | ^`.trim()
+ | ^`.trim(),
).toHaveBeenWarned()
expect(`v-if/v-else-if is missing expression`).toHaveBeenWarned()
expect(
`
1 |
- | ^^^^`.trim()
+ | ^^^^`.trim(),
).toHaveBeenWarned()
})
it('should support custom element via config.isCustomElement (deprecated)', () => {
const app = createApp({
- template: '
'
+ template: '
',
})
const container = document.createElement('div')
app.config.isCustomElement = tag => tag === 'custom'
@@ -144,7 +143,7 @@ describe('compiler + runtime integration', () => {
it('should support custom element via config.compilerOptions.isCustomElement', () => {
const app = createApp({
- template: '
'
+ template: '
',
})
const container = document.createElement('div')
app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
@@ -155,8 +154,8 @@ describe('compiler + runtime integration', () => {
it('should support using element innerHTML as template', () => {
const app = createApp({
data: () => ({
- msg: 'hello'
- })
+ msg: 'hello',
+ }),
})
const container = document.createElement('div')
container.innerHTML = '{{msg}}'
@@ -173,9 +172,9 @@ describe('compiler + runtime integration', () => {
template: `{{ count }}`,
data() {
return {
- count: 0
+ count: 0,
}
- }
+ },
}
createApp(App).mount('#app')
expect(container.innerHTML).toBe(`0`)
@@ -184,7 +183,7 @@ describe('compiler + runtime integration', () => {
it('should warn when template is not available', () => {
const app = createApp({
- template: {}
+ template: {},
})
const container = document.createElement('div')
app.mount(container)
@@ -193,12 +192,12 @@ describe('compiler + runtime integration', () => {
it('should warn when template is is not found', () => {
const app = createApp({
- template: '#not-exist-id'
+ template: '#not-exist-id',
})
const container = document.createElement('div')
app.mount(container)
expect(
- '[Vue warn]: Template element not found or is empty: #not-exist-id'
+ '[Vue warn]: Template element not found or is empty: #not-exist-id',
).toHaveBeenWarned()
})
@@ -209,14 +208,14 @@ describe('compiler + runtime integration', () => {
template: `{{ count }}`,
data() {
return {
- count: 0
+ count: 0,
}
- }
+ },
}
createApp(App).mount('#not-exist-id')
expect(
- '[Vue warn]: Failed to mount app: mount target selector "#not-exist-id" returned null.'
+ '[Vue warn]: Failed to mount app: mount target selector "#not-exist-id" returned null.',
).toHaveBeenWarned()
document.querySelector = origin
})
@@ -239,9 +238,9 @@ describe('compiler + runtime integration', () => {
`,
data() {
return {
- count
+ count,
}
- }
+ },
}
createApp(App).mount(container)
expect(container.innerHTML).toBe(``)
@@ -266,7 +265,7 @@ describe('compiler + runtime integration', () => {
setup() {
return { ok }
},
- template: `
`
+ template: `
`,
}
const container = document.createElement('div')
createApp(App).mount(container)
@@ -283,7 +282,7 @@ describe('compiler + runtime integration', () => {
setup() {
return { list }
},
- template: `
`
+ template: `
`,
}
const container = document.createElement('div')
createApp(App).mount(container)
@@ -297,7 +296,7 @@ describe('compiler + runtime integration', () => {
// #2413
it('EMPTY_ARR should not change', () => {
const App = {
- template: `
{{ v }}
`
+ template: `
{{ v }}
`,
}
const container = document.createElement('div')
createApp(App).mount(container)
@@ -306,7 +305,7 @@ describe('compiler + runtime integration', () => {
test('BigInt support', () => {
const app = createApp({
- template: `
{{ BigInt(BigInt(100000111)) + BigInt(2000000000n) * 30000000n }}
`
+ template: `
{{ BigInt(BigInt(100000111)) + BigInt(2000000000n) * 30000000n }}
`,
})
const root = document.createElement('div')
app.mount(root)
diff --git a/packages/vue/__tests__/mathmlNamespace.spec.ts b/packages/vue/__tests__/mathmlNamespace.spec.ts
new file mode 100644
index 00000000000..c3f8ab7ab3e
--- /dev/null
+++ b/packages/vue/__tests__/mathmlNamespace.spec.ts
@@ -0,0 +1,80 @@
+// MathML logic is technically dom-specific, but the logic is placed in core
+// because splitting it out of core would lead to unnecessary complexity in both
+// the renderer and compiler implementations.
+// Related files:
+// - runtime-core/src/renderer.ts
+// - compiler-core/src/transforms/transformElement.ts
+
+import { vtcKey } from '../../runtime-dom/src/components/Transition'
+import { h, nextTick, ref, render } from '../src'
+
+describe('MathML support', () => {
+ afterEach(() => {
+ document.body.innerHTML = ''
+ })
+
+ test('should mount elements with correct html namespace', () => {
+ const root = document.createElement('div')
+ document.body.appendChild(root)
+ const App = {
+ template: `
+
+
+
+
+ x
+ 2
+
+ +
+ y
+
+
+
+
+
+
+
+
+ `,
+ }
+ render(h(App), root)
+ const e0 = document.getElementById('e0')!
+ expect(e0.namespaceURI).toMatch('Math')
+ expect(e0.querySelector('#e1')!.namespaceURI).toMatch('Math')
+ expect(e0.querySelector('#e2')!.namespaceURI).toMatch('Math')
+ expect(e0.querySelector('#e3')!.namespaceURI).toMatch('Math')
+ expect(e0.querySelector('#e4')!.namespaceURI).toMatch('xhtml')
+ expect(e0.querySelector('#e5')!.namespaceURI).toMatch('svg')
+ })
+
+ test('should patch elements with correct namespaces', async () => {
+ const root = document.createElement('div')
+ document.body.appendChild(root)
+ const cls = ref('foo')
+ const App = {
+ setup: () => ({ cls }),
+ template: `
+
+ `,
+ }
+ render(h(App), root)
+ const f1 = document.querySelector('#f1')!
+ const f2 = document.querySelector('#f2')!
+ expect(f1.getAttribute('class')).toBe('foo')
+ expect(f2.className).toBe('foo')
+
+ // set a transition class on the
- which is only respected on non-svg
+ // patches
+ ;(f2 as any)[vtcKey] = ['baz']
+ cls.value = 'bar'
+ await nextTick()
+ expect(f1.getAttribute('class')).toBe('bar')
+ expect(f2.className).toBe('bar baz')
+ })
+})
diff --git a/packages/vue/__tests__/runtimeCompilerOptions.spec.ts b/packages/vue/__tests__/runtimeCompilerOptions.spec.ts
index 3222462fea3..b144be448d2 100644
--- a/packages/vue/__tests__/runtimeCompilerOptions.spec.ts
+++ b/packages/vue/__tests__/runtimeCompilerOptions.spec.ts
@@ -3,7 +3,7 @@ import { createApp } from 'vue'
describe('config.compilerOptions', () => {
test('isCustomElement', () => {
const app = createApp({
- template: `
`
+ template: `
`,
})
app.config.compilerOptions.isCustomElement = (tag: string) => tag === 'foo'
const root = document.createElement('div')
@@ -13,7 +13,7 @@ describe('config.compilerOptions', () => {
test('comments', () => {
const app = createApp({
- template: `
`
+ template: `
`,
})
app.config.compilerOptions.comments = true
// the comments option is only relevant in production mode
@@ -26,7 +26,7 @@ describe('config.compilerOptions', () => {
test('whitespace', () => {
const app = createApp({
- template: `
\n
`
+ template: `
\n
`,
})
app.config.compilerOptions.whitespace = 'preserve'
const root = document.createElement('div')
@@ -38,7 +38,7 @@ describe('config.compilerOptions', () => {
test('delimiters', () => {
const app = createApp({
data: () => ({ foo: 'hi' }),
- template: `[[ foo ]]`
+ template: `[[ foo ]]`,
})
app.config.compilerOptions.delimiters = [`[[`, `]]`]
const root = document.createElement('div')
@@ -52,8 +52,8 @@ describe('per-component compilerOptions', () => {
const app = createApp({
template: `
`,
compilerOptions: {
- isCustomElement: (tag: string) => tag === 'foo'
- }
+ isCustomElement: (tag: string) => tag === 'foo',
+ },
})
const root = document.createElement('div')
app.mount(root)
@@ -64,8 +64,8 @@ describe('per-component compilerOptions', () => {
const app = createApp({
template: `
`,
compilerOptions: {
- comments: true
- }
+ comments: true,
+ },
})
app.config.compilerOptions.comments = false
// the comments option is only relevant in production mode
@@ -80,8 +80,8 @@ describe('per-component compilerOptions', () => {
const app = createApp({
template: `
\n
`,
compilerOptions: {
- whitespace: 'preserve'
- }
+ whitespace: 'preserve',
+ },
})
const root = document.createElement('div')
app.mount(root)
@@ -94,8 +94,8 @@ describe('per-component compilerOptions', () => {
data: () => ({ foo: 'hi' }),
template: `[[ foo ]]`,
compilerOptions: {
- delimiters: [`[[`, `]]`]
- }
+ delimiters: [`[[`, `]]`],
+ },
})
const root = document.createElement('div')
app.mount(root)
diff --git a/packages/vue/__tests__/svgNamespace.spec.ts b/packages/vue/__tests__/svgNamespace.spec.ts
index 433e8d36d4c..978f9bbb1fc 100644
--- a/packages/vue/__tests__/svgNamespace.spec.ts
+++ b/packages/vue/__tests__/svgNamespace.spec.ts
@@ -5,10 +5,15 @@
// - runtime-core/src/renderer.ts
// - compiler-core/src/transforms/transformElement.ts
-import { render, h, ref, nextTick } from '../src'
+import { vtcKey } from '../../runtime-dom/src/components/Transition'
+import { h, nextTick, ref, render } from '../src'
describe('SVG support', () => {
- test('should mount elements with correct namespaces', () => {
+ afterEach(() => {
+ document.body.innerHTML = ''
+ })
+
+ test('should mount elements with correct html namespace', () => {
const root = document.createElement('div')
document.body.appendChild(root)
const App = {
@@ -17,10 +22,12 @@ describe('SVG support', () => {
+
+
- `
+ `,
}
render(h(App), root)
const e0 = document.getElementById('e0')!
@@ -28,6 +35,8 @@ describe('SVG support', () => {
expect(e0.querySelector('#e1')!.namespaceURI).toMatch('svg')
expect(e0.querySelector('#e2')!.namespaceURI).toMatch('svg')
expect(e0.querySelector('#e3')!.namespaceURI).toMatch('xhtml')
+ expect(e0.querySelector('#e4')!.namespaceURI).toMatch('svg')
+ expect(e0.querySelector('#e5')!.namespaceURI).toMatch('Math')
})
test('should patch elements with correct namespaces', async () => {
@@ -44,7 +53,7 @@ describe('SVG support', () => {
- `
+ `,
}
render(h(App), root)
const f1 = document.querySelector('#f1')!
@@ -54,7 +63,7 @@ describe('SVG support', () => {
// set a transition class on the
- which is only respected on non-svg
// patches
- ;(f2 as any)._vtc = ['baz']
+ ;(f2 as any)[vtcKey] = ['baz']
cls.value = 'bar'
await nextTick()
expect(f1.getAttribute('class')).toBe('bar')
diff --git a/packages/vue/compiler-sfc/index.browser.js b/packages/vue/compiler-sfc/index.browser.js
new file mode 100644
index 00000000000..774f9da2742
--- /dev/null
+++ b/packages/vue/compiler-sfc/index.browser.js
@@ -0,0 +1 @@
+module.exports = require('@vue/compiler-sfc')
diff --git a/packages/vue/compiler-sfc/index.browser.mjs b/packages/vue/compiler-sfc/index.browser.mjs
new file mode 100644
index 00000000000..3c30abc8ccf
--- /dev/null
+++ b/packages/vue/compiler-sfc/index.browser.mjs
@@ -0,0 +1 @@
+export * from '@vue/compiler-sfc'
diff --git a/packages/vue/compiler-sfc/register-ts.js b/packages/vue/compiler-sfc/register-ts.js
index 87f61b64863..36de2a350d6 100644
--- a/packages/vue/compiler-sfc/register-ts.js
+++ b/packages/vue/compiler-sfc/register-ts.js
@@ -1,5 +1,3 @@
if (typeof require !== 'undefined') {
- try {
- require('@vue/compiler-sfc').registerTS(require('typescript'))
- } catch (e) {}
+ require('@vue/compiler-sfc').registerTS(() => require('typescript'))
}
diff --git a/packages/vue/index.mjs b/packages/vue/index.mjs
index 8b43612483a..fcb9204cbc7 100644
--- a/packages/vue/index.mjs
+++ b/packages/vue/index.mjs
@@ -1 +1 @@
-export * from './index.js'
\ No newline at end of file
+export * from './index.js'
diff --git a/packages/vue/jsx-runtime/index.d.ts b/packages/vue/jsx-runtime/index.d.ts
index a44382cfbb1..a52ac66a0df 100644
--- a/packages/vue/jsx-runtime/index.d.ts
+++ b/packages/vue/jsx-runtime/index.d.ts
@@ -1,9 +1,5 @@
-import type {
- VNode,
- IntrinsicElementAttributes,
- ReservedProps,
- NativeElements
-} from '@vue/runtime-dom'
+/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
+import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom'
/**
* JSX namespace for usage with @jsxImportsSource directive
diff --git a/packages/vue/jsx-runtime/index.mjs b/packages/vue/jsx-runtime/index.mjs
index 57dd60af68f..e2528cba447 100644
--- a/packages/vue/jsx-runtime/index.mjs
+++ b/packages/vue/jsx-runtime/index.mjs
@@ -9,9 +9,4 @@ function jsx(type, props, key) {
return h(type, props, children)
}
-export {
- Fragment,
- jsx,
- jsx as jsxs,
- jsx as jsxDEV
-}
+export { Fragment, jsx, jsx as jsxs, jsx as jsxDEV }
diff --git a/packages/vue/jsx.d.ts b/packages/vue/jsx.d.ts
index afc1039e46d..1fa1e326676 100644
--- a/packages/vue/jsx.d.ts
+++ b/packages/vue/jsx.d.ts
@@ -1,11 +1,7 @@
+/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
// global JSX namespace registration
// somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy
-import type {
- VNode,
- IntrinsicElementAttributes,
- ReservedProps,
- NativeElements
-} from '@vue/runtime-dom'
+import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom'
declare global {
namespace JSX {
diff --git a/packages/vue/macros-global.d.ts b/packages/vue/macros-global.d.ts
deleted file mode 100644
index 9b6f5a5392f..00000000000
--- a/packages/vue/macros-global.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- $ as _$,
- $$ as _$$,
- $ref as _$ref,
- $shallowRef as _$shallowRef,
- $computed as _$computed,
- $customRef as _$customRef,
- $toRef as _$toRef
-} from './macros'
-
-declare global {
- const $: typeof _$
- const $$: typeof _$$
- const $ref: typeof _$ref
- const $shallowRef: typeof _$shallowRef
- const $computed: typeof _$computed
- const $customRef: typeof _$customRef
- const $toRef: typeof _$toRef
-}
diff --git a/packages/vue/macros.d.ts b/packages/vue/macros.d.ts
index 68ccda6ee23..6e7a8a1dd4b 100644
--- a/packages/vue/macros.d.ts
+++ b/packages/vue/macros.d.ts
@@ -1,19 +1,19 @@
-import {
+import type {
+ ComputedRef,
+ CustomRefFactory,
+ DebuggerOptions,
Ref,
UnwrapRef,
- ComputedRef,
WritableComputedOptions,
- DebuggerOptions,
WritableComputedRef,
- CustomRefFactory
} from '@vue/runtime-dom'
export declare const RefType: unique symbol
-export declare const enum RefTypes {
+export declare enum RefTypes {
Ref = 1,
ComputedRef = 2,
- WritableComputedRef = 3
+ WritableComputedRef = 3,
}
type RefValue
= T extends null | undefined ? T : ReactiveVariable
@@ -39,7 +39,7 @@ type NormalObject = T & { [RefType]?: never }
*/
export declare function $(arg: ComputedRef): ComputedRefValue
export declare function $(
- arg: WritableComputedRef
+ arg: WritableComputedRef,
): WritableComputedRefValue
export declare function $(arg: Ref): RefValue
export declare function $(arg?: T): DestructureRefs
@@ -48,10 +48,10 @@ type DestructureRefs = {
[K in keyof T]: T[K] extends ComputedRef
? ComputedRefValue
: T[K] extends WritableComputedRef
- ? WritableComputedRefValue
- : T[K] extends Ref
- ? RefValue
- : T[K]
+ ? WritableComputedRefValue
+ : T[K] extends Ref
+ ? RefValue
+ : T[K]
}
/**
@@ -61,26 +61,26 @@ export declare function $$(arg: NormalObject): ToRawRefs
export declare function $$(value: RefValue): Ref
export declare function $$(value: ComputedRefValue): ComputedRef
export declare function $$(
- value: WritableComputedRefValue
+ value: WritableComputedRefValue,
): WritableComputedRef
type ToRawRefs = {
[K in keyof T]: T[K] extends RefValue
? Ref
: T[K] extends ComputedRefValue
- ? ComputedRef
- : T[K] extends WritableComputedRefValue
- ? WritableComputedRef
- : T[K] extends object
- ? T[K] extends
- | Function
- | Map
- | Set
- | WeakMap
- | WeakSet
- ? T[K]
- : ToRawRefs
- : T[K]
+ ? ComputedRef
+ : T[K] extends WritableComputedRefValue
+ ? WritableComputedRef
+ : T[K] extends object
+ ? T[K] extends
+ | Function
+ | Map
+ | Set
+ | WeakMap
+ | WeakSet
+ ? T[K]
+ : ToRawRefs
+ : T[K]
}
export declare function $ref(): RefValue
@@ -91,22 +91,22 @@ export declare function $shallowRef(arg: T): RefValue
export declare function $toRef(
object: T,
- key: K
+ key: K,
): RefValue
export declare function $toRef(
object: T,
key: K,
- defaultValue: T[K]
+ defaultValue: T[K],
): RefValue>
export declare function $customRef(factory: CustomRefFactory): RefValue
export declare function $computed(
getter: () => T,
- debuggerOptions?: DebuggerOptions
+ debuggerOptions?: DebuggerOptions,
): ComputedRefValue
export declare function $computed(
options: WritableComputedOptions,
- debuggerOptions?: DebuggerOptions
+ debuggerOptions?: DebuggerOptions,
): WritableComputedRefValue
diff --git a/packages/vue/package.json b/packages/vue/package.json
index 0f41b3f6220..6981d2f5c38 100644
--- a/packages/vue/package.json
+++ b/packages/vue/package.json
@@ -1,6 +1,6 @@
{
"name": "vue",
- "version": "3.3.4",
+ "version": "3.4.15",
"description": "The progressive JavaScript framework for building modern web UI.",
"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
@@ -14,10 +14,7 @@
"compiler-sfc",
"server-renderer",
"jsx-runtime",
- "jsx.d.ts",
- "macros.d.ts",
- "macros-global.d.ts",
- "ref-macros.d.ts"
+ "jsx.d.ts"
],
"exports": {
".": {
@@ -28,6 +25,11 @@
},
"require": {
"types": "./dist/vue.d.ts",
+ "node": {
+ "production": "./dist/vue.cjs.prod.js",
+ "development": "./dist/vue.cjs.js",
+ "default": "./index.js"
+ },
"default": "./index.js"
}
},
@@ -44,10 +46,12 @@
"./compiler-sfc": {
"import": {
"types": "./compiler-sfc/index.d.mts",
+ "browser": "./compiler-sfc/index.browser.mjs",
"default": "./compiler-sfc/index.mjs"
},
"require": {
"types": "./compiler-sfc/index.d.ts",
+ "browser": "./compiler-sfc/index.browser.js",
"default": "./compiler-sfc/index.js"
}
},
@@ -63,10 +67,7 @@
},
"./jsx": "./jsx.d.ts",
"./dist/*": "./dist/*",
- "./package.json": "./package.json",
- "./macros": "./macros.d.ts",
- "./macros-global": "./macros-global.d.ts",
- "./ref-macros": "./ref-macros.d.ts"
+ "./package.json": "./package.json"
},
"buildOptions": {
"name": "Vue",
@@ -94,10 +95,18 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue#readme",
"dependencies": {
- "@vue/shared": "3.3.4",
- "@vue/compiler-dom": "3.3.4",
- "@vue/runtime-dom": "3.3.4",
- "@vue/compiler-sfc": "3.3.4",
- "@vue/server-renderer": "3.3.4"
+ "@vue/shared": "workspace:*",
+ "@vue/compiler-dom": "workspace:*",
+ "@vue/runtime-dom": "workspace:*",
+ "@vue/compiler-sfc": "workspace:*",
+ "@vue/server-renderer": "workspace:*"
+ },
+ "peerDependencies": {
+ "typescript": "*"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
}
}
diff --git a/packages/vue/ref-macros.d.ts b/packages/vue/ref-macros.d.ts
deleted file mode 100644
index 206d0308a62..00000000000
--- a/packages/vue/ref-macros.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-// TODO remove in 3.4
-import './macros-global'
diff --git a/packages/vue/server-renderer/index.mjs b/packages/vue/server-renderer/index.mjs
index 3e081c15a23..ac614729c75 100644
--- a/packages/vue/server-renderer/index.mjs
+++ b/packages/vue/server-renderer/index.mjs
@@ -1 +1 @@
-export * from '@vue/server-renderer'
\ No newline at end of file
+export * from '@vue/server-renderer'
diff --git a/packages/vue/src/dev.ts b/packages/vue/src/dev.ts
index 79f233ed925..602079a20e2 100644
--- a/packages/vue/src/dev.ts
+++ b/packages/vue/src/dev.ts
@@ -6,7 +6,7 @@ export function initDev() {
if (!__ESM_BUNDLER__) {
console.info(
`You are running a development build of Vue.\n` +
- `Make sure to use the production build (*.prod.js) when deploying for production.`
+ `Make sure to use the production build (*.prod.js) when deploying for production.`,
)
}
diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts
index 8215be7476e..35077b3cf63 100644
--- a/packages/vue/src/index.ts
+++ b/packages/vue/src/index.ts
@@ -1,21 +1,47 @@
// This entry is the "full-build" that includes both the runtime
// and the compiler, and supports on-the-fly compilation of the template option.
import { initDev } from './dev'
-import { compile, CompilerOptions, CompilerError } from '@vue/compiler-dom'
-import { registerRuntimeCompiler, RenderFunction, warn } from '@vue/runtime-dom'
+import {
+ type CompilerError,
+ type CompilerOptions,
+ compile,
+} from '@vue/compiler-dom'
+import {
+ type RenderFunction,
+ registerRuntimeCompiler,
+ warn,
+} from '@vue/runtime-dom'
import * as runtimeDom from '@vue/runtime-dom'
-import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
-import { InternalRenderFunction } from 'packages/runtime-core/src/component'
+import {
+ EMPTY_OBJ,
+ NOOP,
+ extend,
+ generateCodeFrame,
+ isString,
+} from '@vue/shared'
+import type { InternalRenderFunction } from 'packages/runtime-core/src/component'
if (__DEV__) {
initDev()
}
-const compileCache: Record = Object.create(null)
+const compileCache = new WeakMap<
+ CompilerOptions,
+ Record
+>()
+
+function getCache(options?: CompilerOptions) {
+ let c = compileCache.get(options ?? EMPTY_OBJ)
+ if (!c) {
+ c = Object.create(null) as Record
+ compileCache.set(options ?? EMPTY_OBJ, c)
+ }
+ return c
+}
function compileToFunction(
template: string | HTMLElement,
- options?: CompilerOptions
+ options?: CompilerOptions,
): RenderFunction {
if (!isString(template)) {
if (template.nodeType) {
@@ -27,7 +53,8 @@ function compileToFunction(
}
const key = template
- const cached = compileCache[key]
+ const cache = getCache(options)
+ const cached = cache[key]
if (cached) {
return cached
}
@@ -48,9 +75,9 @@ function compileToFunction(
{
hoistStatic: true,
onError: __DEV__ ? onError : undefined,
- onWarn: __DEV__ ? e => onError(e, true) : NOOP
+ onWarn: __DEV__ ? e => onError(e, true) : NOOP,
} as CompilerOptions,
- options
+ options,
)
if (!opts.isCustomElement && typeof customElements !== 'undefined') {
@@ -68,7 +95,7 @@ function compileToFunction(
generateCodeFrame(
template as string,
err.loc.start.offset,
- err.loc.end.offset
+ err.loc.end.offset,
)
warn(codeFrame ? `${message}\n${codeFrame}` : message)
}
@@ -84,7 +111,7 @@ function compileToFunction(
// mark the function as runtime compiled
;(render as InternalRenderFunction)._rc = true
- return (compileCache[key] = render)
+ return (cache[key] = render)
}
registerRuntimeCompiler(compileToFunction)
diff --git a/packages/vue/src/runtime.ts b/packages/vue/src/runtime.ts
index 7fe70670a5e..a0332bf7989 100644
--- a/packages/vue/src/runtime.ts
+++ b/packages/vue/src/runtime.ts
@@ -16,10 +16,10 @@ export const compile = () => {
(__ESM_BUNDLER__
? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
: __ESM_BROWSER__
- ? ` Use "vue.esm-browser.js" instead.`
- : __GLOBAL__
- ? ` Use "vue.global.js" instead.`
- : ``) /* should not happen */
+ ? ` Use "vue.esm-browser.js" instead.`
+ : __GLOBAL__
+ ? ` Use "vue.global.js" instead.`
+ : ``) /* should not happen */,
)
}
}
diff --git a/packages/vue/types/jsx-register.d.ts b/packages/vue/types/jsx-register.d.ts
deleted file mode 100644
index a626f798c2a..00000000000
--- a/packages/vue/types/jsx-register.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// this is appended to the end of ../dist/vue.d.ts during build.
-// imports the global JSX namespace registration for compat.
-// TODO: remove in 3.4
-import '../jsx'
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 67268789aec..b2c4b2b2a8c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,153 +1,190 @@
lockfileVersion: '6.0'
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
importers:
.:
devDependencies:
'@babel/parser':
- specifier: ^7.21.3
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
'@babel/types':
- specifier: ^7.21.3
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
+ '@codspeed/vitest-plugin':
+ specifier: ^2.3.1
+ version: 2.3.1(vite@5.0.7)(vitest@1.2.0)
'@rollup/plugin-alias':
- specifier: ^4.0.3
- version: 4.0.3(rollup@3.20.2)
+ specifier: ^5.0.1
+ version: 5.0.1(rollup@4.4.1)
'@rollup/plugin-commonjs':
- specifier: ^24.0.1
- version: 24.0.1(rollup@3.20.2)
+ specifier: ^25.0.7
+ version: 25.0.7(rollup@4.4.1)
'@rollup/plugin-json':
- specifier: ^6.0.0
- version: 6.0.0(rollup@3.20.2)
+ specifier: ^6.0.1
+ version: 6.0.1(rollup@4.4.1)
'@rollup/plugin-node-resolve':
- specifier: ^15.0.1
- version: 15.0.1(rollup@3.20.2)
+ specifier: ^15.2.3
+ version: 15.2.3(rollup@4.4.1)
'@rollup/plugin-replace':
- specifier: ^5.0.2
- version: 5.0.2(rollup@3.20.2)
+ specifier: ^5.0.4
+ version: 5.0.4(rollup@4.4.1)
'@rollup/plugin-terser':
- specifier: ^0.4.0
- version: 0.4.0(rollup@3.20.2)
+ specifier: ^0.4.4
+ version: 0.4.4(rollup@4.4.1)
'@types/hash-sum':
- specifier: ^1.0.0
- version: 1.0.0
+ specifier: ^1.0.2
+ version: 1.0.2
+ '@types/minimist':
+ specifier: ^1.2.5
+ version: 1.2.5
'@types/node':
- specifier: ^16.4.7
- version: 16.18.11
+ specifier: ^20.11.1
+ version: 20.11.1
+ '@types/semver':
+ specifier: ^7.5.6
+ version: 7.5.6
+ '@typescript-eslint/eslint-plugin':
+ specifier: ^6.18.1
+ version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2)
'@typescript-eslint/parser':
- specifier: ^5.56.0
- version: 5.56.0(eslint@8.33.0)(typescript@5.0.2)
+ specifier: ^6.18.1
+ version: 6.18.1(eslint@8.56.0)(typescript@5.2.2)
'@vitest/coverage-istanbul':
- specifier: ^0.29.7
- version: 0.29.7(vitest@0.30.1)
+ specifier: ^1.2.0
+ version: 1.2.0(vitest@1.2.0)
'@vue/consolidate':
specifier: 0.17.3
version: 0.17.3
- chalk:
- specifier: ^4.1.0
- version: 4.1.2
conventional-changelog-cli:
- specifier: ^2.0.31
- version: 2.2.2
+ specifier: ^4.1.0
+ version: 4.1.0
enquirer:
- specifier: ^2.3.2
- version: 2.3.6
+ specifier: ^2.4.1
+ version: 2.4.1
esbuild:
- specifier: ^0.17.4
- version: 0.17.5
+ specifier: ^0.19.5
+ version: 0.19.10
esbuild-plugin-polyfill-node:
- specifier: ^0.2.0
- version: 0.2.0(esbuild@0.17.5)
+ specifier: ^0.3.0
+ version: 0.3.0(esbuild@0.19.10)
eslint:
- specifier: ^8.33.0
- version: 8.33.0
+ specifier: ^8.56.0
+ version: 8.56.0
+ eslint-define-config:
+ specifier: ^1.24.1
+ version: 1.24.1
+ eslint-plugin-import:
+ specifier: npm:eslint-plugin-i@^2.29.1
+ version: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)
eslint-plugin-jest:
- specifier: ^27.2.1
- version: 27.2.1(eslint@8.33.0)(typescript@5.0.2)
+ specifier: ^27.6.3
+ version: 27.6.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.2.2)
estree-walker:
specifier: ^2.0.2
version: 2.0.2
execa:
- specifier: ^4.0.2
- version: 4.1.0
+ specifier: ^8.0.1
+ version: 8.0.1
jsdom:
- specifier: ^21.1.0
- version: 21.1.0
+ specifier: ^23.2.0
+ version: 23.2.0
lint-staged:
- specifier: ^10.2.10
- version: 10.5.4
+ specifier: ^15.2.0
+ version: 15.2.0
lodash:
- specifier: ^4.17.15
+ specifier: ^4.17.21
version: 4.17.21
magic-string:
- specifier: ^0.30.0
- version: 0.30.0
+ specifier: ^0.30.5
+ version: 0.30.5
+ markdown-table:
+ specifier: ^3.0.3
+ version: 3.0.3
marked:
- specifier: ^4.0.10
- version: 4.2.12
+ specifier: ^11.1.1
+ version: 11.1.1
minimist:
- specifier: ^1.2.0
- version: 1.2.7
+ specifier: ^1.2.8
+ version: 1.2.8
npm-run-all:
specifier: ^4.1.5
version: 4.1.5
+ picocolors:
+ specifier: ^1.0.0
+ version: 1.0.0
prettier:
- specifier: ^2.7.1
- version: 2.8.3
+ specifier: ^3.2.2
+ version: 3.2.2
+ pretty-bytes:
+ specifier: ^6.1.1
+ version: 6.1.1
pug:
- specifier: ^3.0.1
+ specifier: ^3.0.2
version: 3.0.2
puppeteer:
- specifier: ~19.6.0
- version: 19.6.3
+ specifier: ~21.7.0
+ version: 21.7.0(typescript@5.2.2)
+ rimraf:
+ specifier: ^5.0.5
+ version: 5.0.5
rollup:
- specifier: ^3.20.2
- version: 3.20.2
+ specifier: ^4.1.4
+ version: 4.4.1
rollup-plugin-dts:
- specifier: ^5.3.0
- version: 5.3.0(rollup@3.20.2)(typescript@5.0.2)
+ specifier: ^6.1.0
+ version: 6.1.0(rollup@4.4.1)(typescript@5.2.2)
rollup-plugin-esbuild:
- specifier: ^5.0.0
- version: 5.0.0(esbuild@0.17.5)(rollup@3.20.2)
+ specifier: ^6.1.0
+ version: 6.1.0(esbuild@0.19.10)(rollup@4.4.1)
rollup-plugin-polyfill-node:
specifier: ^0.12.0
- version: 0.12.0(rollup@3.20.2)
+ version: 0.12.0(rollup@4.4.1)
semver:
- specifier: ^7.3.2
- version: 7.3.8
+ specifier: ^7.5.4
+ version: 7.5.4
serve:
- specifier: ^12.0.0
- version: 12.0.1
+ specifier: ^14.2.1
+ version: 14.2.1
simple-git-hooks:
- specifier: ^2.8.1
- version: 2.8.1
+ specifier: ^2.9.0
+ version: 2.9.0
terser:
- specifier: ^5.15.1
- version: 5.16.2
+ specifier: ^5.22.0
+ version: 5.22.0
todomvc-app-css:
- specifier: ^2.3.0
- version: 2.4.2
+ specifier: ^2.4.3
+ version: 2.4.3
tslib:
- specifier: ^2.5.0
- version: 2.5.0
+ specifier: ^2.6.2
+ version: 2.6.2
+ tsx:
+ specifier: ^4.7.0
+ version: 4.7.0
typescript:
- specifier: ^5.0.0
- version: 5.0.2
+ specifier: ^5.2.2
+ version: 5.2.2
vite:
- specifier: ^4.3.0
- version: 4.3.1(@types/node@16.18.11)(terser@5.16.2)
+ specifier: ^5.0.5
+ version: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
vitest:
- specifier: ^0.30.1
- version: 0.30.1(jsdom@21.1.0)(terser@5.16.2)
+ specifier: ^1.2.0
+ version: 1.2.0(@types/node@20.11.1)(jsdom@23.2.0)(terser@5.22.0)
packages/compiler-core:
dependencies:
'@babel/parser':
- specifier: ^7.21.3
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
+ entities:
+ specifier: ^4.5.0
+ version: 4.5.0
estree-walker:
specifier: ^2.0.2
version: 2.0.2
@@ -156,60 +193,51 @@ importers:
version: 1.0.2
devDependencies:
'@babel/types':
- specifier: ^7.21.3
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
packages/compiler-dom:
dependencies:
'@vue/compiler-core':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-core
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
packages/compiler-sfc:
dependencies:
'@babel/parser':
- specifier: ^7.20.15
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
'@vue/compiler-core':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-core
'@vue/compiler-dom':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-dom
'@vue/compiler-ssr':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-ssr
- '@vue/reactivity-transform':
- specifier: 3.3.4
- version: link:../reactivity-transform
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
estree-walker:
specifier: ^2.0.2
version: 2.0.2
magic-string:
- specifier: ^0.30.0
- version: 0.30.0
+ specifier: ^0.30.5
+ version: 0.30.5
postcss:
- specifier: ^8.1.10
- version: 8.4.21
+ specifier: ^8.4.33
+ version: 8.4.33
source-map-js:
specifier: ^1.0.2
version: 1.0.2
devDependencies:
'@babel/types':
- specifier: ^7.21.3
- version: 7.21.3
- '@types/estree':
- specifier: ^0.0.48
- version: 0.0.48
- '@types/lru-cache':
- specifier: ^5.1.0
- version: 5.1.1
+ specifier: ^7.23.6
+ version: 7.23.6
'@vue/consolidate':
specifier: ^0.17.3
version: 0.17.3
@@ -217,150 +245,134 @@ importers:
specifier: ^2.0.0
version: 2.0.0
lru-cache:
- specifier: ^5.1.1
- version: 5.1.1
+ specifier: ^10.1.0
+ version: 10.1.0
merge-source-map:
specifier: ^1.1.0
version: 1.1.0
minimatch:
- specifier: ^9.0.0
- version: 9.0.0
+ specifier: ^9.0.3
+ version: 9.0.3
postcss-modules:
- specifier: ^4.0.0
- version: 4.3.1(postcss@8.4.21)
+ specifier: ^6.0.0
+ version: 6.0.0(postcss@8.4.33)
postcss-selector-parser:
- specifier: ^6.0.4
- version: 6.0.11
+ specifier: ^6.0.15
+ version: 6.0.15
pug:
- specifier: ^3.0.1
+ specifier: ^3.0.2
version: 3.0.2
sass:
- specifier: ^1.26.9
- version: 1.58.0
+ specifier: ^1.69.7
+ version: 1.69.7
packages/compiler-ssr:
dependencies:
'@vue/compiler-dom':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-dom
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
- packages/dts-test:
+ packages/dts-built-test:
dependencies:
+ '@vue/reactivity':
+ specifier: workspace:*
+ version: link:../reactivity
+ '@vue/shared':
+ specifier: workspace:*
+ version: link:../shared
vue:
specifier: workspace:*
version: link:../vue
- packages/reactivity:
+ packages/dts-test:
dependencies:
- '@vue/shared':
- specifier: 3.3.4
- version: link:../shared
+ '@vue/dts-built-test':
+ specifier: workspace:*
+ version: link:../dts-built-test
+ vue:
+ specifier: workspace:*
+ version: link:../vue
- packages/reactivity-transform:
+ packages/reactivity:
dependencies:
- '@babel/parser':
- specifier: ^7.20.15
- version: 7.21.3
- '@vue/compiler-core':
- specifier: 3.3.4
- version: link:../compiler-core
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
- estree-walker:
- specifier: ^2.0.2
- version: 2.0.2
- magic-string:
- specifier: ^0.30.0
- version: 0.30.0
- devDependencies:
- '@babel/core':
- specifier: ^7.21.3
- version: 7.21.3
- '@babel/types':
- specifier: ^7.21.3
- version: 7.21.3
packages/runtime-core:
dependencies:
'@vue/reactivity':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../reactivity
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
packages/runtime-dom:
dependencies:
'@vue/runtime-core':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../runtime-core
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
csstype:
- specifier: ^3.1.1
- version: 3.1.1
+ specifier: ^3.1.3
+ version: 3.1.3
packages/runtime-test:
dependencies:
'@vue/runtime-core':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../runtime-core
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
packages/server-renderer:
dependencies:
'@vue/compiler-ssr':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-ssr
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
vue:
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../vue
packages/sfc-playground:
dependencies:
'@vue/repl':
- specifier: ^1.4.1
- version: 1.4.1(vue@packages+vue)
+ specifier: ^3.1.1
+ version: 3.1.1
file-saver:
specifier: ^2.0.5
version: 2.0.5
jszip:
- specifier: ^3.6.0
+ specifier: ^3.10.1
version: 3.10.1
vue:
specifier: workspace:*
version: link:../vue
devDependencies:
'@vitejs/plugin-vue':
- specifier: ^4.2.3
- version: 4.2.3(vite@4.3.1)(vue@packages+vue)
+ specifier: ^4.4.0
+ version: 4.4.0(vite@5.0.7)(vue@packages+vue)
vite:
- specifier: ^4.3.0
- version: 4.3.1(@types/node@16.18.11)(terser@5.16.2)
+ specifier: ^5.0.5
+ version: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
packages/shared: {}
- packages/size-check:
- dependencies:
- vue:
- specifier: workspace:*
- version: link:../vue
-
packages/template-explorer:
dependencies:
monaco-editor:
- specifier: ^0.20.0
- version: 0.20.0
+ specifier: ^0.45.0
+ version: 0.45.0
source-map-js:
specifier: ^1.0.2
version: 1.0.2
@@ -368,26 +380,29 @@ importers:
packages/vue:
dependencies:
'@vue/compiler-dom':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-dom
'@vue/compiler-sfc':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../compiler-sfc
'@vue/runtime-dom':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../runtime-dom
'@vue/server-renderer':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../server-renderer
'@vue/shared':
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../shared
+ typescript:
+ specifier: '*'
+ version: 5.2.2
packages/vue-compat:
dependencies:
'@babel/parser':
- specifier: ^7.21.3
- version: 7.21.3
+ specifier: ^7.23.6
+ version: 7.23.6
estree-walker:
specifier: ^2.0.2
version: 2.0.2
@@ -395,212 +410,250 @@ importers:
specifier: ^1.0.2
version: 1.0.2
vue:
- specifier: 3.3.4
+ specifier: workspace:*
version: link:../vue
packages:
- /@ampproject/remapping@2.2.0:
- resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==}
+ /@aashutoshrathi/word-wrap@1.2.6:
+ resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ /@ampproject/remapping@2.2.1:
+ resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
engines: {node: '>=6.0.0'}
dependencies:
- '@jridgewell/gen-mapping': 0.1.1
- '@jridgewell/trace-mapping': 0.3.17
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.20
dev: true
- /@babel/code-frame@7.18.6:
- resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==}
+ /@asamuzakjp/dom-selector@2.0.1:
+ resolution: {integrity: sha512-QJAJffmCiymkv6YyQ7voyQb5caCth6jzZsQncYCpHXrJ7RqdYG5y43+is8mnFcYubdOkr7cn1+na9BdFMxqw7w==}
+ dependencies:
+ bidi-js: 1.0.3
+ css-tree: 2.3.1
+ is-potential-custom-element-name: 1.0.1
+ dev: true
+
+ /@babel/code-frame@7.23.5:
+ resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/highlight': 7.18.6
+ '@babel/highlight': 7.23.4
+ chalk: 2.4.2
dev: true
- /@babel/compat-data@7.21.0:
- resolution: {integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==}
+ /@babel/compat-data@7.23.2:
+ resolution: {integrity: sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==}
engines: {node: '>=6.9.0'}
dev: true
- /@babel/core@7.21.3:
- resolution: {integrity: sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==}
+ /@babel/core@7.23.5:
+ resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==}
engines: {node: '>=6.9.0'}
dependencies:
- '@ampproject/remapping': 2.2.0
- '@babel/code-frame': 7.18.6
- '@babel/generator': 7.21.3
- '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.21.3)
- '@babel/helper-module-transforms': 7.21.2
- '@babel/helpers': 7.21.0
- '@babel/parser': 7.21.3
- '@babel/template': 7.20.7
- '@babel/traverse': 7.21.3
- '@babel/types': 7.21.3
- convert-source-map: 1.9.0
+ '@ampproject/remapping': 2.2.1
+ '@babel/code-frame': 7.23.5
+ '@babel/generator': 7.23.5
+ '@babel/helper-compilation-targets': 7.22.15
+ '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5)
+ '@babel/helpers': 7.23.5
+ '@babel/parser': 7.23.6
+ '@babel/template': 7.22.15
+ '@babel/traverse': 7.23.5
+ '@babel/types': 7.23.6
+ convert-source-map: 2.0.0
debug: 4.3.4
gensync: 1.0.0-beta.2
json5: 2.2.3
- semver: 6.3.0
+ semver: 6.3.1
transitivePeerDependencies:
- supports-color
dev: true
- /@babel/generator@7.21.3:
- resolution: {integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==}
+ /@babel/generator@7.23.5:
+ resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.21.3
- '@jridgewell/gen-mapping': 0.3.2
- '@jridgewell/trace-mapping': 0.3.17
+ '@babel/types': 7.23.6
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.20
jsesc: 2.5.2
dev: true
- /@babel/helper-compilation-targets@7.20.7(@babel/core@7.21.3):
- resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==}
+ /@babel/helper-compilation-targets@7.22.15:
+ resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0
dependencies:
- '@babel/compat-data': 7.21.0
- '@babel/core': 7.21.3
- '@babel/helper-validator-option': 7.21.0
- browserslist: 4.21.5
+ '@babel/compat-data': 7.23.2
+ '@babel/helper-validator-option': 7.22.15
+ browserslist: 4.22.1
lru-cache: 5.1.1
- semver: 6.3.0
+ semver: 6.3.1
dev: true
- /@babel/helper-environment-visitor@7.18.9:
- resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==}
+ /@babel/helper-environment-visitor@7.22.20:
+ resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==}
engines: {node: '>=6.9.0'}
dev: true
- /@babel/helper-function-name@7.21.0:
- resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==}
+ /@babel/helper-function-name@7.23.0:
+ resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/template': 7.20.7
- '@babel/types': 7.21.3
+ '@babel/template': 7.22.15
+ '@babel/types': 7.23.6
dev: true
- /@babel/helper-hoist-variables@7.18.6:
- resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==}
+ /@babel/helper-hoist-variables@7.22.5:
+ resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
dev: true
- /@babel/helper-module-imports@7.18.6:
- resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==}
+ /@babel/helper-module-imports@7.22.15:
+ resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
dev: true
- /@babel/helper-module-transforms@7.21.2:
- resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==}
+ /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5):
+ resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==}
engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
dependencies:
- '@babel/helper-environment-visitor': 7.18.9
- '@babel/helper-module-imports': 7.18.6
- '@babel/helper-simple-access': 7.20.2
- '@babel/helper-split-export-declaration': 7.18.6
- '@babel/helper-validator-identifier': 7.19.1
- '@babel/template': 7.20.7
- '@babel/traverse': 7.21.3
- '@babel/types': 7.21.3
- transitivePeerDependencies:
- - supports-color
+ '@babel/core': 7.23.5
+ '@babel/helper-environment-visitor': 7.22.20
+ '@babel/helper-module-imports': 7.22.15
+ '@babel/helper-simple-access': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/helper-validator-identifier': 7.22.20
dev: true
- /@babel/helper-simple-access@7.20.2:
- resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==}
+ /@babel/helper-simple-access@7.22.5:
+ resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
dev: true
- /@babel/helper-split-export-declaration@7.18.6:
- resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==}
+ /@babel/helper-split-export-declaration@7.22.6:
+ resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
dev: true
- /@babel/helper-string-parser@7.19.4:
- resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==}
+ /@babel/helper-string-parser@7.23.4:
+ resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==}
engines: {node: '>=6.9.0'}
- /@babel/helper-validator-identifier@7.19.1:
- resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
+ /@babel/helper-validator-identifier@7.22.20:
+ resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==}
engines: {node: '>=6.9.0'}
+ requiresBuild: true
- /@babel/helper-validator-option@7.21.0:
- resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==}
+ /@babel/helper-validator-option@7.22.15:
+ resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==}
engines: {node: '>=6.9.0'}
dev: true
- /@babel/helpers@7.21.0:
- resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==}
+ /@babel/helpers@7.23.5:
+ resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/template': 7.20.7
- '@babel/traverse': 7.21.3
- '@babel/types': 7.21.3
+ '@babel/template': 7.22.15
+ '@babel/traverse': 7.23.5
+ '@babel/types': 7.23.6
transitivePeerDependencies:
- supports-color
dev: true
- /@babel/highlight@7.18.6:
- resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==}
+ /@babel/highlight@7.23.4:
+ resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==}
engines: {node: '>=6.9.0'}
+ requiresBuild: true
dependencies:
- '@babel/helper-validator-identifier': 7.19.1
+ '@babel/helper-validator-identifier': 7.22.20
chalk: 2.4.2
js-tokens: 4.0.0
dev: true
- /@babel/parser@7.21.3:
- resolution: {integrity: sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==}
+ /@babel/parser@7.23.6:
+ resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
- /@babel/template@7.20.7:
- resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==}
+ /@babel/template@7.22.15:
+ resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/code-frame': 7.18.6
- '@babel/parser': 7.21.3
- '@babel/types': 7.21.3
+ '@babel/code-frame': 7.23.5
+ '@babel/parser': 7.23.6
+ '@babel/types': 7.23.6
dev: true
- /@babel/traverse@7.21.3:
- resolution: {integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==}
+ /@babel/traverse@7.23.5:
+ resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/code-frame': 7.18.6
- '@babel/generator': 7.21.3
- '@babel/helper-environment-visitor': 7.18.9
- '@babel/helper-function-name': 7.21.0
- '@babel/helper-hoist-variables': 7.18.6
- '@babel/helper-split-export-declaration': 7.18.6
- '@babel/parser': 7.21.3
- '@babel/types': 7.21.3
+ '@babel/code-frame': 7.23.5
+ '@babel/generator': 7.23.5
+ '@babel/helper-environment-visitor': 7.22.20
+ '@babel/helper-function-name': 7.23.0
+ '@babel/helper-hoist-variables': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/parser': 7.23.6
+ '@babel/types': 7.23.6
debug: 4.3.4
globals: 11.12.0
transitivePeerDependencies:
- supports-color
dev: true
- /@babel/types@7.21.3:
- resolution: {integrity: sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==}
+ /@babel/types@7.23.6:
+ resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/helper-string-parser': 7.19.4
- '@babel/helper-validator-identifier': 7.19.1
+ '@babel/helper-string-parser': 7.23.4
+ '@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0
- /@esbuild/android-arm64@0.17.5:
- resolution: {integrity: sha512-KHWkDqYAMmKZjY4RAN1PR96q6UOtfkWlTS8uEwWxdLtkRt/0F/csUhXIrVfaSIFxnscIBMPynGfhsMwQDRIBQw==}
+ /@codspeed/core@2.3.1:
+ resolution: {integrity: sha512-7KRwBX4iXK33gEQwh8jPWBF9srGIjewm3oc+A/66caiG/aOyHmxJCapjAZxT2f2vIVYqR7CghzqlxY2ik0DNBg==}
+ dependencies:
+ find-up: 6.3.0
+ node-gyp-build: 4.7.1
+ dev: true
+
+ /@codspeed/vitest-plugin@2.3.1(vite@5.0.7)(vitest@1.2.0):
+ resolution: {integrity: sha512-/e4G2B/onX/hG/EjUU/NpDxnIryeTDamVRTBeWfgQDoex3g7GDzTwoQktaU5l/Asw3ZjEErQg+oQVToQ6jYZlA==}
+ peerDependencies:
+ vite: ^4.2.0 || ^5.0.0
+ vitest: '>=1.0.0-beta.4 || >=1'
+ dependencies:
+ '@codspeed/core': 2.3.1
+ vite: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
+ vitest: 1.2.0(@types/node@20.11.1)(jsdom@23.2.0)(terser@5.22.0)
+ dev: true
+
+ /@esbuild/aix-ppc64@0.19.10:
+ resolution: {integrity: sha512-Q+mk96KJ+FZ30h9fsJl+67IjNJm3x2eX+GBWGmocAKgzp27cowCOOqSdscX80s0SpdFXZnIv/+1xD1EctFx96Q==}
+ engines: {node: '>=12'}
+ cpu: [ppc64]
+ os: [aix]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@esbuild/android-arm64@0.19.10:
+ resolution: {integrity: sha512-1X4CClKhDgC3by7k8aOWZeBXQX8dHT5QAMCAQDArCLaYfkppoARvh0fit3X2Qs+MXDngKcHv6XXyQCpY0hkK1Q==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
@@ -608,8 +661,8 @@ packages:
dev: true
optional: true
- /@esbuild/android-arm@0.17.5:
- resolution: {integrity: sha512-crmPUzgCmF+qZXfl1YkiFoUta2XAfixR1tEnr/gXIixE+WL8Z0BGqfydP5oox0EUOgQMMRgtATtakyAcClQVqQ==}
+ /@esbuild/android-arm@0.19.10:
+ resolution: {integrity: sha512-7W0bK7qfkw1fc2viBfrtAEkDKHatYfHzr/jKAHNr9BvkYDXPcC6bodtm8AyLJNNuqClLNaeTLuwURt4PRT9d7w==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
@@ -617,8 +670,8 @@ packages:
dev: true
optional: true
- /@esbuild/android-x64@0.17.5:
- resolution: {integrity: sha512-8fI/AnIdmWz/+1iza2WrCw8kwXK9wZp/yZY/iS8ioC+U37yJCeppi9EHY05ewJKN64ASoBIseufZROtcFnX5GA==}
+ /@esbuild/android-x64@0.19.10:
+ resolution: {integrity: sha512-O/nO/g+/7NlitUxETkUv/IvADKuZXyH4BHf/g/7laqKC4i/7whLpB0gvpPc2zpF0q9Q6FXS3TS75QHac9MvVWw==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
@@ -626,8 +679,8 @@ packages:
dev: true
optional: true
- /@esbuild/darwin-arm64@0.17.5:
- resolution: {integrity: sha512-EAvaoyIySV6Iif3NQCglUNpnMfHSUgC5ugt2efl3+QDntucJe5spn0udNZjTgNi6tKVqSceOw9tQ32liNZc1Xw==}
+ /@esbuild/darwin-arm64@0.19.10:
+ resolution: {integrity: sha512-YSRRs2zOpwypck+6GL3wGXx2gNP7DXzetmo5pHXLrY/VIMsS59yKfjPizQ4lLt5vEI80M41gjm2BxrGZ5U+VMA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
@@ -635,8 +688,8 @@ packages:
dev: true
optional: true
- /@esbuild/darwin-x64@0.17.5:
- resolution: {integrity: sha512-ha7QCJh1fuSwwCgoegfdaljowwWozwTDjBgjD3++WAy/qwee5uUi1gvOg2WENJC6EUyHBOkcd3YmLDYSZ2TPPA==}
+ /@esbuild/darwin-x64@0.19.10:
+ resolution: {integrity: sha512-alfGtT+IEICKtNE54hbvPg13xGBe4GkVxyGWtzr+yHO7HIiRJppPDhOKq3zstTcVf8msXb/t4eavW3jCDpMSmA==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
@@ -644,8 +697,8 @@ packages:
dev: true
optional: true
- /@esbuild/freebsd-arm64@0.17.5:
- resolution: {integrity: sha512-VbdXJkn2aI2pQ/wxNEjEcnEDwPpxt3CWWMFYmO7CcdFBoOsABRy2W8F3kjbF9F/pecEUDcI3b5i2w+By4VQFPg==}
+ /@esbuild/freebsd-arm64@0.19.10:
+ resolution: {integrity: sha512-dMtk1wc7FSH8CCkE854GyGuNKCewlh+7heYP/sclpOG6Cectzk14qdUIY5CrKDbkA/OczXq9WesqnPl09mj5dg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
@@ -653,8 +706,8 @@ packages:
dev: true
optional: true
- /@esbuild/freebsd-x64@0.17.5:
- resolution: {integrity: sha512-olgGYND1/XnnWxwhjtY3/ryjOG/M4WfcA6XH8dBTH1cxMeBemMODXSFhkw71Kf4TeZFFTN25YOomaNh0vq2iXg==}
+ /@esbuild/freebsd-x64@0.19.10:
+ resolution: {integrity: sha512-G5UPPspryHu1T3uX8WiOEUa6q6OlQh6gNl4CO4Iw5PS+Kg5bVggVFehzXBJY6X6RSOMS8iXDv2330VzaObm4Ag==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
@@ -662,8 +715,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-arm64@0.17.5:
- resolution: {integrity: sha512-8a0bqSwu3OlLCfu2FBbDNgQyBYdPJh1B9PvNX7jMaKGC9/KopgHs37t+pQqeMLzcyRqG6z55IGNQAMSlCpBuqg==}
+ /@esbuild/linux-arm64@0.19.10:
+ resolution: {integrity: sha512-QxaouHWZ+2KWEj7cGJmvTIHVALfhpGxo3WLmlYfJ+dA5fJB6lDEIg+oe/0//FuyVHuS3l79/wyBxbHr0NgtxJQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
@@ -671,8 +724,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-arm@0.17.5:
- resolution: {integrity: sha512-YBdCyQwA3OQupi6W2/WO4FnI+NWFWe79cZEtlbqSESOHEg7a73htBIRiE6uHPQe7Yp5E4aALv+JxkRLGEUL7tw==}
+ /@esbuild/linux-arm@0.19.10:
+ resolution: {integrity: sha512-j6gUW5aAaPgD416Hk9FHxn27On28H4eVI9rJ4az7oCGTFW48+LcgNDBN+9f8rKZz7EEowo889CPKyeaD0iw9Kg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
@@ -680,8 +733,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-ia32@0.17.5:
- resolution: {integrity: sha512-uCwm1r/+NdP7vndctgq3PoZrnmhmnecWAr114GWMRwg2QMFFX+kIWnp7IO220/JLgnXK/jP7VKAFBGmeOYBQYQ==}
+ /@esbuild/linux-ia32@0.19.10:
+ resolution: {integrity: sha512-4ub1YwXxYjj9h1UIZs2hYbnTZBtenPw5NfXCRgEkGb0b6OJ2gpkMvDqRDYIDRjRdWSe/TBiZltm3Y3Q8SN1xNg==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
@@ -689,8 +742,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-loong64@0.17.5:
- resolution: {integrity: sha512-3YxhSBl5Sb6TtBjJu+HP93poBruFzgXmf3PVfIe4xOXMj1XpxboYZyw3W8BhoX/uwxzZz4K1I99jTE/5cgDT1g==}
+ /@esbuild/linux-loong64@0.19.10:
+ resolution: {integrity: sha512-lo3I9k+mbEKoxtoIbM0yC/MZ1i2wM0cIeOejlVdZ3D86LAcFXFRdeuZmh91QJvUTW51bOK5W2BznGNIl4+mDaA==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
@@ -698,8 +751,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-mips64el@0.17.5:
- resolution: {integrity: sha512-Hy5Z0YVWyYHdtQ5mfmfp8LdhVwGbwVuq8mHzLqrG16BaMgEmit2xKO+iDakHs+OetEx0EN/2mUzDdfdktI+Nmg==}
+ /@esbuild/linux-mips64el@0.19.10:
+ resolution: {integrity: sha512-J4gH3zhHNbdZN0Bcr1QUGVNkHTdpijgx5VMxeetSk6ntdt+vR1DqGmHxQYHRmNb77tP6GVvD+K0NyO4xjd7y4A==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
@@ -707,8 +760,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-ppc64@0.17.5:
- resolution: {integrity: sha512-5dbQvBLbU/Y3Q4ABc9gi23hww1mQcM7KZ9KBqabB7qhJswYMf8WrDDOSw3gdf3p+ffmijMd28mfVMvFucuECyg==}
+ /@esbuild/linux-ppc64@0.19.10:
+ resolution: {integrity: sha512-tgT/7u+QhV6ge8wFMzaklOY7KqiyitgT1AUHMApau32ZlvTB/+efeCtMk4eXS+uEymYK249JsoiklZN64xt6oQ==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
@@ -716,8 +769,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-riscv64@0.17.5:
- resolution: {integrity: sha512-fp/KUB/ZPzEWGTEUgz9wIAKCqu7CjH1GqXUO2WJdik1UNBQ7Xzw7myIajpxztE4Csb9504ERiFMxZg5KZ6HlZQ==}
+ /@esbuild/linux-riscv64@0.19.10:
+ resolution: {integrity: sha512-0f/spw0PfBMZBNqtKe5FLzBDGo0SKZKvMl5PHYQr3+eiSscfJ96XEknCe+JoOayybWUFQbcJTrk946i3j9uYZA==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
@@ -725,8 +778,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-s390x@0.17.5:
- resolution: {integrity: sha512-kRV3yw19YDqHTp8SfHXfObUFXlaiiw4o2lvT1XjsPZ++22GqZwSsYWJLjMi1Sl7j9qDlDUduWDze/nQx0d6Lzw==}
+ /@esbuild/linux-s390x@0.19.10:
+ resolution: {integrity: sha512-pZFe0OeskMHzHa9U38g+z8Yx5FNCLFtUnJtQMpwhS+r4S566aK2ci3t4NCP4tjt6d5j5uo4h7tExZMjeKoehAA==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
@@ -734,8 +787,8 @@ packages:
dev: true
optional: true
- /@esbuild/linux-x64@0.17.5:
- resolution: {integrity: sha512-vnxuhh9e4pbtABNLbT2ANW4uwQ/zvcHRCm1JxaYkzSehugoFd5iXyC4ci1nhXU13mxEwCnrnTIiiSGwa/uAF1g==}
+ /@esbuild/linux-x64@0.19.10:
+ resolution: {integrity: sha512-SpYNEqg/6pZYoc+1zLCjVOYvxfZVZj6w0KROZ3Fje/QrM3nfvT2llI+wmKSrWuX6wmZeTapbarvuNNK/qepSgA==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
@@ -743,8 +796,8 @@ packages:
dev: true
optional: true
- /@esbuild/netbsd-x64@0.17.5:
- resolution: {integrity: sha512-cigBpdiSx/vPy7doUyImsQQBnBjV5f1M99ZUlaJckDAJjgXWl6y9W17FIfJTy8TxosEF6MXq+fpLsitMGts2nA==}
+ /@esbuild/netbsd-x64@0.19.10:
+ resolution: {integrity: sha512-ACbZ0vXy9zksNArWlk2c38NdKg25+L9pr/mVaj9SUq6lHZu/35nx2xnQVRGLrC1KKQqJKRIB0q8GspiHI3J80Q==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
@@ -752,8 +805,8 @@ packages:
dev: true
optional: true
- /@esbuild/openbsd-x64@0.17.5:
- resolution: {integrity: sha512-VdqRqPVIjjZfkf40LrqOaVuhw9EQiAZ/GNCSM2UplDkaIzYVsSnycxcFfAnHdWI8Gyt6dO15KHikbpxwx+xHbw==}
+ /@esbuild/openbsd-x64@0.19.10:
+ resolution: {integrity: sha512-PxcgvjdSjtgPMiPQrM3pwSaG4kGphP+bLSb+cihuP0LYdZv1epbAIecHVl5sD3npkfYBZ0ZnOjR878I7MdJDFg==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
@@ -761,8 +814,8 @@ packages:
dev: true
optional: true
- /@esbuild/sunos-x64@0.17.5:
- resolution: {integrity: sha512-ItxPaJ3MBLtI4nK+mALLEoUs6amxsx+J1ibnfcYMkqaCqHST1AkF4aENpBehty3czqw64r/XqL+W9WqU6kc2Qw==}
+ /@esbuild/sunos-x64@0.19.10:
+ resolution: {integrity: sha512-ZkIOtrRL8SEJjr+VHjmW0znkPs+oJXhlJbNwfI37rvgeMtk3sxOQevXPXjmAPZPigVTncvFqLMd+uV0IBSEzqA==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
@@ -770,8 +823,8 @@ packages:
dev: true
optional: true
- /@esbuild/win32-arm64@0.17.5:
- resolution: {integrity: sha512-4u2Q6qsJTYNFdS9zHoAi80spzf78C16m2wla4eJPh4kSbRv+BpXIfl6TmBSWupD8e47B1NrTfrOlEuco7mYQtg==}
+ /@esbuild/win32-arm64@0.19.10:
+ resolution: {integrity: sha512-+Sa4oTDbpBfGpl3Hn3XiUe4f8TU2JF7aX8cOfqFYMMjXp6ma6NJDztl5FDG8Ezx0OjwGikIHw+iA54YLDNNVfw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
@@ -779,8 +832,8 @@ packages:
dev: true
optional: true
- /@esbuild/win32-ia32@0.17.5:
- resolution: {integrity: sha512-KYlm+Xu9TXsfTWAcocLuISRtqxKp/Y9ZBVg6CEEj0O5J9mn7YvBKzAszo2j1ndyzUPk+op+Tie2PJeN+BnXGqQ==}
+ /@esbuild/win32-ia32@0.19.10:
+ resolution: {integrity: sha512-EOGVLK1oWMBXgfttJdPHDTiivYSjX6jDNaATeNOaCOFEVcfMjtbx7WVQwPSE1eIfCp/CaSF2nSrDtzc4I9f8TQ==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
@@ -788,8 +841,8 @@ packages:
dev: true
optional: true
- /@esbuild/win32-x64@0.17.5:
- resolution: {integrity: sha512-XgA9qWRqby7xdYXuF6KALsn37QGBMHsdhmnpjfZtYxKxbTOwfnDM6MYi2WuUku5poNaX2n9XGVr20zgT/2QwCw==}
+ /@esbuild/win32-x64@0.19.10:
+ resolution: {integrity: sha512-whqLG6Sc70AbU73fFYvuYzaE4MNMBIlR1Y/IrUeOXFrWHxBEjjbZaQ3IXIQS8wJdAzue2GwYZCjOrgrU1oUHoA==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
@@ -797,14 +850,29 @@ packages:
dev: true
optional: true
- /@eslint/eslintrc@1.4.1:
- resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==}
+ /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0):
+ resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
+ dependencies:
+ eslint: 8.56.0
+ eslint-visitor-keys: 3.4.3
+ dev: true
+
+ /@eslint-community/regexpp@4.9.1:
+ resolution: {integrity: sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+ dev: true
+
+ /@eslint/eslintrc@2.1.4:
+ resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
debug: 4.3.4
- espree: 9.4.1
- globals: 13.20.0
+ espree: 9.6.1
+ globals: 13.23.0
ignore: 5.2.4
import-fresh: 3.3.0
js-yaml: 4.1.0
@@ -814,11 +882,16 @@ packages:
- supports-color
dev: true
- /@humanwhocodes/config-array@0.11.8:
- resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==}
+ /@eslint/js@8.56.0:
+ resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: true
+
+ /@humanwhocodes/config-array@0.11.13:
+ resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==}
engines: {node: '>=10.10.0'}
dependencies:
- '@humanwhocodes/object-schema': 1.2.1
+ '@humanwhocodes/object-schema': 2.0.1
debug: 4.3.4
minimatch: 3.1.2
transitivePeerDependencies:
@@ -830,13 +903,25 @@ packages:
engines: {node: '>=12.22'}
dev: true
- /@humanwhocodes/object-schema@1.2.1:
- resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
+ /@humanwhocodes/object-schema@2.0.1:
+ resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==}
dev: true
- /@hutson/parse-repository-url@3.0.2:
- resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==}
- engines: {node: '>=6.9.0'}
+ /@hutson/parse-repository-url@5.0.0:
+ resolution: {integrity: sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==}
+ engines: {node: '>=10.13.0'}
+ dev: true
+
+ /@isaacs/cliui@8.0.2:
+ resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
+ engines: {node: '>=12'}
+ dependencies:
+ string-width: 5.1.2
+ string-width-cjs: /string-width@4.2.3
+ strip-ansi: 7.1.0
+ strip-ansi-cjs: /strip-ansi@6.0.1
+ wrap-ansi: 8.1.0
+ wrap-ansi-cjs: /wrap-ansi@7.0.0
dev: true
/@istanbuljs/schema@0.1.3:
@@ -844,25 +929,24 @@ packages:
engines: {node: '>=8'}
dev: true
- /@jridgewell/gen-mapping@0.1.1:
- resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==}
- engines: {node: '>=6.0.0'}
+ /@jest/schemas@29.6.3:
+ resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dependencies:
- '@jridgewell/set-array': 1.1.2
- '@jridgewell/sourcemap-codec': 1.4.14
+ '@sinclair/typebox': 0.27.8
dev: true
- /@jridgewell/gen-mapping@0.3.2:
- resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==}
+ /@jridgewell/gen-mapping@0.3.3:
+ resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
engines: {node: '>=6.0.0'}
dependencies:
'@jridgewell/set-array': 1.1.2
- '@jridgewell/sourcemap-codec': 1.4.14
- '@jridgewell/trace-mapping': 0.3.17
+ '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/trace-mapping': 0.3.20
dev: true
- /@jridgewell/resolve-uri@3.1.0:
- resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==}
+ /@jridgewell/resolve-uri@3.1.1:
+ resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
engines: {node: '>=6.0.0'}
dev: true
@@ -871,21 +955,21 @@ packages:
engines: {node: '>=6.0.0'}
dev: true
- /@jridgewell/source-map@0.3.2:
- resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==}
+ /@jridgewell/source-map@0.3.5:
+ resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==}
dependencies:
- '@jridgewell/gen-mapping': 0.3.2
- '@jridgewell/trace-mapping': 0.3.17
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.20
dev: true
- /@jridgewell/sourcemap-codec@1.4.14:
- resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
+ /@jridgewell/sourcemap-codec@1.4.15:
+ resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
- /@jridgewell/trace-mapping@0.3.17:
- resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==}
+ /@jridgewell/trace-mapping@0.3.20:
+ resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==}
dependencies:
- '@jridgewell/resolve-uri': 3.1.0
- '@jridgewell/sourcemap-codec': 1.4.14
+ '@jridgewell/resolve-uri': 3.1.1
+ '@jridgewell/sourcemap-codec': 1.4.15
dev: true
/@jspm/core@2.0.1:
@@ -913,242 +997,394 @@ packages:
fastq: 1.15.0
dev: true
- /@rollup/plugin-alias@4.0.3(rollup@3.20.2):
- resolution: {integrity: sha512-ZuDWE1q4PQDhvm/zc5Prun8sBpLJy41DMptYrS6MhAy9s9kL/doN1613BWfEchGVfKxzliJ3BjbOPizXX38DbQ==}
+ /@pkgjs/parseargs@0.11.0:
+ resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
+ engines: {node: '>=14'}
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@puppeteer/browsers@1.9.1:
+ resolution: {integrity: sha512-PuvK6xZzGhKPvlx3fpfdM2kYY3P/hB1URtK8wA7XUJ6prn6pp22zvJHu48th0SGcHL9SutbPHrFuQgfXTFobWA==}
+ engines: {node: '>=16.3.0'}
+ hasBin: true
+ dependencies:
+ debug: 4.3.4
+ extract-zip: 2.0.1
+ progress: 2.0.3
+ proxy-agent: 6.3.1
+ tar-fs: 3.0.4
+ unbzip2-stream: 1.4.3
+ yargs: 17.7.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@rollup/plugin-alias@5.0.1(rollup@4.4.1):
+ resolution: {integrity: sha512-JObvbWdOHoMy9W7SU0lvGhDtWq9PllP5mjpAy+TUslZG/WzOId9u80Hsqq1vCUn9pFJ0cxpdcnAv+QzU2zFH3Q==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- rollup: 3.20.2
+ rollup: 4.4.1
slash: 4.0.0
dev: true
- /@rollup/plugin-commonjs@24.0.1(rollup@3.20.2):
- resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==}
+ /@rollup/plugin-commonjs@25.0.7(rollup@4.4.1):
+ resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^2.68.0||^3.0.0
+ rollup: ^2.68.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
commondir: 1.0.1
estree-walker: 2.0.2
glob: 8.1.0
is-reference: 1.2.1
- magic-string: 0.27.0
- rollup: 3.20.2
+ magic-string: 0.30.5
+ rollup: 4.4.1
dev: true
- /@rollup/plugin-inject@5.0.3(rollup@3.20.2):
- resolution: {integrity: sha512-411QlbL+z2yXpRWFXSmw/teQRMkXcAAC8aYTemc15gwJRpvEVDQwoe+N/HTFD8RFG8+88Bme9DK2V9CVm7hJdA==}
+ /@rollup/plugin-inject@5.0.5(rollup@4.4.1):
+ resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
estree-walker: 2.0.2
- magic-string: 0.27.0
- rollup: 3.20.2
+ magic-string: 0.30.5
+ rollup: 4.4.1
dev: true
- /@rollup/plugin-json@6.0.0(rollup@3.20.2):
- resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==}
+ /@rollup/plugin-json@6.0.1(rollup@4.4.1):
+ resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
- rollup: 3.20.2
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
+ rollup: 4.4.1
dev: true
- /@rollup/plugin-node-resolve@15.0.1(rollup@3.20.2):
- resolution: {integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==}
+ /@rollup/plugin-node-resolve@15.2.3(rollup@4.4.1):
+ resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^2.78.0||^3.0.0
+ rollup: ^2.78.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
'@types/resolve': 1.20.2
- deepmerge: 4.3.0
+ deepmerge: 4.3.1
is-builtin-module: 3.2.1
is-module: 1.0.0
- resolve: 1.22.1
- rollup: 3.20.2
+ resolve: 1.22.8
+ rollup: 4.4.1
dev: true
- /@rollup/plugin-replace@5.0.2(rollup@3.20.2):
- resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==}
+ /@rollup/plugin-replace@5.0.4(rollup@4.4.1):
+ resolution: {integrity: sha512-E2hmRnlh09K8HGT0rOnnri9OTh+BILGr7NVJGB30S4E3cLRn3J0xjdiyOZ74adPs4NiAMgrjUMGAZNJDBgsdmQ==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
- magic-string: 0.27.0
- rollup: 3.20.2
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
+ magic-string: 0.30.5
+ rollup: 4.4.1
dev: true
- /@rollup/plugin-terser@0.4.0(rollup@3.20.2):
- resolution: {integrity: sha512-Ipcf3LPNerey1q9ZMjiaWHlNPEHNU/B5/uh9zXLltfEQ1lVSLLeZSgAtTPWGyw8Ip1guOeq+mDtdOlEj/wNxQw==}
+ /@rollup/plugin-terser@0.4.4(rollup@4.4.1):
+ resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^2.x || ^3.x
+ rollup: ^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- rollup: 3.20.2
+ rollup: 4.4.1
serialize-javascript: 6.0.1
- smob: 0.0.6
- terser: 5.16.2
+ smob: 1.4.1
+ terser: 5.22.0
dev: true
- /@rollup/pluginutils@5.0.2(rollup@3.20.2):
- resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
+ /@rollup/pluginutils@5.0.5(rollup@4.4.1):
+ resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==}
engines: {node: '>=14.0.0'}
peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
dependencies:
- '@types/estree': 1.0.0
+ '@types/estree': 1.0.3
estree-walker: 2.0.2
picomatch: 2.3.1
- rollup: 3.20.2
+ rollup: 4.4.1
dev: true
- /@tootallnate/once@2.0.0:
- resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
- engines: {node: '>= 10'}
+ /@rollup/rollup-android-arm-eabi@4.4.1:
+ resolution: {integrity: sha512-Ss4suS/sd+6xLRu+MLCkED2mUrAyqHmmvZB+zpzZ9Znn9S8wCkTQCJaQ8P8aHofnvG5L16u9MVnJjCqioPErwQ==}
+ cpu: [arm]
+ os: [android]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/chai-subset@1.3.3:
- resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==}
- dependencies:
- '@types/chai': 4.3.4
+ /@rollup/rollup-android-arm64@4.4.1:
+ resolution: {integrity: sha512-sRSkGTvGsARwWd7TzC8LKRf8FiPn7257vd/edzmvG4RIr9x68KBN0/Ek48CkuUJ5Pj/Dp9vKWv6PEupjKWjTYA==}
+ cpu: [arm64]
+ os: [android]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-darwin-arm64@4.4.1:
+ resolution: {integrity: sha512-nz0AiGrrXyaWpsmBXUGOBiRDU0wyfSXbFuF98pPvIO8O6auQsPG6riWsfQqmCCC5FNd8zKQ4JhgugRNAkBJ8mQ==}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-darwin-x64@4.4.1:
+ resolution: {integrity: sha512-Ogqvf4/Ve/faMaiPRvzsJEqajbqs00LO+8vtrPBVvLgdw4wBg6ZDXdkDAZO+4MLnrc8mhGV6VJAzYScZdPLtJg==}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm-gnueabihf@4.4.1:
+ resolution: {integrity: sha512-9zc2tqlr6HfO+hx9+wktUlWTRdje7Ub15iJqKcqg5uJZ+iKqmd2CMxlgPpXi7+bU7bjfDIuvCvnGk7wewFEhCg==}
+ cpu: [arm]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm64-gnu@4.4.1:
+ resolution: {integrity: sha512-phLb1fN3rq2o1j1v+nKxXUTSJnAhzhU0hLrl7Qzb0fLpwkGMHDem+o6d+ZI8+/BlTXfMU4kVWGvy6g9k/B8L6Q==}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm64-musl@4.4.1:
+ resolution: {integrity: sha512-M2sDtw4tf57VPSjbTAN/lz1doWUqO2CbQuX3L9K6GWIR5uw9j+ROKCvvUNBY8WUbMxwaoc8mH9HmmBKsLht7+w==}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/chai@4.3.4:
- resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==}
+ /@rollup/rollup-linux-x64-gnu@4.4.1:
+ resolution: {integrity: sha512-mHIlRLX+hx+30cD6c4BaBOsSqdnCE4ok7/KDvjHYAHoSuveoMMxIisZFvcLhUnyZcPBXDGZTuBoalcuh43UfQQ==}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/estree@0.0.48:
- resolution: {integrity: sha512-LfZwXoGUDo0C3me81HXgkBg5CTQYb6xzEl+fNmbO4JdRiSKQ8A0GD1OBBvKAIsbCUgoyAty7m99GqqMQe784ew==}
+ /@rollup/rollup-linux-x64-musl@4.4.1:
+ resolution: {integrity: sha512-tB+RZuDi3zxFx7vDrjTNGVLu2KNyzYv+UY8jz7e4TMEoAj7iEt8Qk6xVu6mo3pgjnsHj6jnq3uuRsHp97DLwOA==}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/estree@1.0.0:
- resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
+ /@rollup/rollup-win32-arm64-msvc@4.4.1:
+ resolution: {integrity: sha512-Hdn39PzOQowK/HZzYpCuZdJC91PE6EaGbTe2VCA9oq2u18evkisQfws0Smh9QQGNNRa/T7MOuGNQoLeXhhE3PQ==}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/hash-sum@1.0.0:
- resolution: {integrity: sha512-FdLBT93h3kcZ586Aee66HPCVJ6qvxVjBlDWNmxSGSbCZe9hTsjRKdSsl4y1T+3zfujxo9auykQMnFsfyHWD7wg==}
+ /@rollup/rollup-win32-ia32-msvc@4.4.1:
+ resolution: {integrity: sha512-tLpKb1Elm9fM8c5w3nl4N1eLTP4bCqTYw9tqUBxX8/hsxqHO3dxc2qPbZ9PNkdK4tg4iLEYn0pOUnVByRd2CbA==}
+ cpu: [ia32]
+ os: [win32]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/json-schema@7.0.11:
- resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
+ /@rollup/rollup-win32-x64-msvc@4.4.1:
+ resolution: {integrity: sha512-eAhItDX9yQtZVM3yvXS/VR3qPqcnXvnLyx1pLXl4JzyNMBNO3KC986t/iAg2zcMzpAp9JSvxB5VZGnBiNoA98w==}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
dev: true
+ optional: true
- /@types/lru-cache@5.1.1:
- resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==}
+ /@sinclair/typebox@0.27.8:
+ resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
dev: true
- /@types/minimist@1.2.2:
- resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
+ /@tootallnate/quickjs-emscripten@0.23.0:
+ resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==}
dev: true
- /@types/node@16.18.11:
- resolution: {integrity: sha512-3oJbGBUWuS6ahSnEq1eN2XrCyf4YsWI8OyCvo7c64zQJNplk3mO84t53o8lfTk+2ji59g5ycfc6qQ3fdHliHuA==}
+ /@types/estree@1.0.3:
+ resolution: {integrity: sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==}
dev: true
- /@types/normalize-package-data@2.4.1:
- resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
+ /@types/hash-sum@1.0.2:
+ resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==}
dev: true
- /@types/parse-json@4.0.0:
- resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
+ /@types/json-schema@7.0.14:
+ resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==}
+ dev: true
+
+ /@types/minimist@1.2.5:
+ resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==}
+ dev: true
+
+ /@types/node@20.11.1:
+ resolution: {integrity: sha512-DsXojJUES2M+FE8CpptJTKpg+r54moV9ZEncPstni1WHFmTcCzeFLnMFfyhCVS8XNOy/OQG+8lVxRLRrVHmV5A==}
+ dependencies:
+ undici-types: 5.26.5
+ dev: true
+
+ /@types/normalize-package-data@2.4.3:
+ resolution: {integrity: sha512-ehPtgRgaULsFG8x0NeYJvmyH1hmlfsNLujHe9dQEia/7MAJYdzMSi19JtchUHjmBA6XC/75dK55mzZH+RyieSg==}
dev: true
/@types/resolve@1.20.2:
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
dev: true
- /@types/semver@7.3.13:
- resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==}
+ /@types/semver@7.5.6:
+ resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==}
dev: true
- /@types/yauzl@2.10.0:
- resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==}
+ /@types/yauzl@2.10.2:
+ resolution: {integrity: sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==}
requiresBuild: true
dependencies:
- '@types/node': 16.18.11
+ '@types/node': 20.11.1
dev: true
optional: true
- /@typescript-eslint/parser@5.56.0(eslint@8.33.0)(typescript@5.0.2):
- resolution: {integrity: sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==}
+ engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
- eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
+ eslint: ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@eslint-community/regexpp': 4.9.1
+ '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.2.2)
+ '@typescript-eslint/scope-manager': 6.18.1
+ '@typescript-eslint/type-utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2)
+ '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2)
+ '@typescript-eslint/visitor-keys': 6.18.1
+ debug: 4.3.4
+ eslint: 8.56.0
+ graphemer: 1.4.0
+ ignore: 5.2.4
+ natural-compare: 1.4.0
+ semver: 7.5.4
+ ts-api-utils: 1.0.3(typescript@5.2.2)
+ typescript: 5.2.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ peerDependencies:
+ eslint: ^7.0.0 || ^8.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
- '@typescript-eslint/scope-manager': 5.56.0
- '@typescript-eslint/types': 5.56.0
- '@typescript-eslint/typescript-estree': 5.56.0(typescript@5.0.2)
+ '@typescript-eslint/scope-manager': 6.18.1
+ '@typescript-eslint/types': 6.18.1
+ '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2)
+ '@typescript-eslint/visitor-keys': 6.18.1
debug: 4.3.4
- eslint: 8.33.0
- typescript: 5.0.2
+ eslint: 8.56.0
+ typescript: 5.2.2
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/scope-manager@5.50.0:
- resolution: {integrity: sha512-rt03kaX+iZrhssaT974BCmoUikYtZI24Vp/kwTSy841XhiYShlqoshRFDvN1FKKvU2S3gK+kcBW1EA7kNUrogg==}
+ /@typescript-eslint/scope-manager@5.62.0:
+ resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- '@typescript-eslint/types': 5.50.0
- '@typescript-eslint/visitor-keys': 5.50.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
dev: true
- /@typescript-eslint/scope-manager@5.56.0:
- resolution: {integrity: sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ /@typescript-eslint/scope-manager@6.18.1:
+ resolution: {integrity: sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw==}
+ engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
- '@typescript-eslint/types': 5.56.0
- '@typescript-eslint/visitor-keys': 5.56.0
+ '@typescript-eslint/types': 6.18.1
+ '@typescript-eslint/visitor-keys': 6.18.1
dev: true
- /@typescript-eslint/types@5.50.0:
- resolution: {integrity: sha512-atruOuJpir4OtyNdKahiHZobPKFvZnBnfDiyEaBf6d9vy9visE7gDjlmhl+y29uxZ2ZDgvXijcungGFjGGex7w==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ /@typescript-eslint/type-utils@6.18.1(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ peerDependencies:
+ eslint: ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2)
+ '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2)
+ debug: 4.3.4
+ eslint: 8.56.0
+ ts-api-utils: 1.0.3(typescript@5.2.2)
+ typescript: 5.2.2
+ transitivePeerDependencies:
+ - supports-color
dev: true
- /@typescript-eslint/types@5.56.0:
- resolution: {integrity: sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==}
+ /@typescript-eslint/types@5.62.0:
+ resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /@typescript-eslint/typescript-estree@5.50.0(typescript@5.0.2):
- resolution: {integrity: sha512-Gq4zapso+OtIZlv8YNAStFtT6d05zyVCK7Fx3h5inlLBx2hWuc/0465C2mg/EQDDU2LKe52+/jN4f0g9bd+kow==}
+ /@typescript-eslint/types@6.18.1:
+ resolution: {integrity: sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ dev: true
+
+ /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2):
+ resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
typescript: '*'
@@ -1156,139 +1392,166 @@ packages:
typescript:
optional: true
dependencies:
- '@typescript-eslint/types': 5.50.0
- '@typescript-eslint/visitor-keys': 5.50.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
- semver: 7.3.8
- tsutils: 3.21.0(typescript@5.0.2)
- typescript: 5.0.2
+ semver: 7.5.4
+ tsutils: 3.21.0(typescript@5.2.2)
+ typescript: 5.2.2
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/typescript-estree@5.56.0(typescript@5.0.2):
- resolution: {integrity: sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ /@typescript-eslint/typescript-estree@6.18.1(typescript@5.2.2):
+ resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==}
+ engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
- '@typescript-eslint/types': 5.56.0
- '@typescript-eslint/visitor-keys': 5.56.0
+ '@typescript-eslint/types': 6.18.1
+ '@typescript-eslint/visitor-keys': 6.18.1
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
- semver: 7.3.8
- tsutils: 3.21.0(typescript@5.0.2)
- typescript: 5.0.2
+ minimatch: 9.0.3
+ semver: 7.5.4
+ ts-api-utils: 1.0.3(typescript@5.2.2)
+ typescript: 5.2.2
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/utils@5.50.0(eslint@8.33.0)(typescript@5.0.2):
- resolution: {integrity: sha512-v/AnUFImmh8G4PH0NDkf6wA8hujNNcrwtecqW4vtQ1UOSNBaZl49zP1SHoZ/06e+UiwzHpgb5zP5+hwlYYWYAw==}
+ /@typescript-eslint/utils@5.62.0(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
- '@types/json-schema': 7.0.11
- '@types/semver': 7.3.13
- '@typescript-eslint/scope-manager': 5.50.0
- '@typescript-eslint/types': 5.50.0
- '@typescript-eslint/typescript-estree': 5.50.0(typescript@5.0.2)
- eslint: 8.33.0
+ '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0)
+ '@types/json-schema': 7.0.14
+ '@types/semver': 7.5.6
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2)
+ eslint: 8.56.0
eslint-scope: 5.1.1
- eslint-utils: 3.0.0(eslint@8.33.0)
- semver: 7.3.8
+ semver: 7.5.4
transitivePeerDependencies:
- supports-color
- typescript
dev: true
- /@typescript-eslint/visitor-keys@5.50.0:
- resolution: {integrity: sha512-cdMeD9HGu6EXIeGOh2yVW6oGf9wq8asBgZx7nsR/D36gTfQ0odE5kcRYe5M81vjEFAcPeugXrHg78Imu55F6gg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ /@typescript-eslint/utils@6.18.1(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ peerDependencies:
+ eslint: ^7.0.0 || ^8.0.0
dependencies:
- '@typescript-eslint/types': 5.50.0
- eslint-visitor-keys: 3.3.0
+ '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0)
+ '@types/json-schema': 7.0.14
+ '@types/semver': 7.5.6
+ '@typescript-eslint/scope-manager': 6.18.1
+ '@typescript-eslint/types': 6.18.1
+ '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2)
+ eslint: 8.56.0
+ semver: 7.5.4
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
dev: true
- /@typescript-eslint/visitor-keys@5.56.0:
- resolution: {integrity: sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==}
+ /@typescript-eslint/visitor-keys@5.62.0:
+ resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- '@typescript-eslint/types': 5.56.0
- eslint-visitor-keys: 3.3.0
+ '@typescript-eslint/types': 5.62.0
+ eslint-visitor-keys: 3.4.3
+ dev: true
+
+ /@typescript-eslint/visitor-keys@6.18.1:
+ resolution: {integrity: sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ dependencies:
+ '@typescript-eslint/types': 6.18.1
+ eslint-visitor-keys: 3.4.3
+ dev: true
+
+ /@ungap/structured-clone@1.2.0:
+ resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
dev: true
- /@vitejs/plugin-vue@4.2.3(vite@4.3.1)(vue@packages+vue):
- resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==}
+ /@vitejs/plugin-vue@4.4.0(vite@5.0.7)(vue@packages+vue):
+ resolution: {integrity: sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^4.0.0
vue: ^3.2.25
dependencies:
- vite: 4.3.1(@types/node@16.18.11)(terser@5.16.2)
+ vite: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
vue: link:packages/vue
dev: true
- /@vitest/coverage-istanbul@0.29.7(vitest@0.30.1):
- resolution: {integrity: sha512-PPnvqEkwSSgjJ1cOgkm5g49/3UiPGPLC5qmWvrx2ITF9AfN2NejnjaEKxoYrX7oQQyBFgf/ph/BraxsqOOo+Kg==}
+ /@vitest/coverage-istanbul@1.2.0(vitest@1.2.0):
+ resolution: {integrity: sha512-hNN/pUR5la6P/L78+YcRl05Lpf6APXlH9ujkmCxxjVWtVG6WuKuqUMhHgYQBYfiOORBwDZ1MBgSUGCMPh4kpmQ==}
peerDependencies:
- vitest: '>=0.28.0 <1'
+ vitest: ^1.0.0
dependencies:
- istanbul-lib-coverage: 3.2.0
- istanbul-lib-instrument: 5.2.1
- istanbul-lib-report: 3.0.0
+ debug: 4.3.4
+ istanbul-lib-coverage: 3.2.2
+ istanbul-lib-instrument: 6.0.1
+ istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 4.0.1
- istanbul-reports: 3.1.5
+ istanbul-reports: 3.1.6
+ magicast: 0.3.2
+ picocolors: 1.0.0
test-exclude: 6.0.0
- vitest: 0.30.1(jsdom@21.1.0)(terser@5.16.2)
+ vitest: 1.2.0(@types/node@20.11.1)(jsdom@23.2.0)(terser@5.22.0)
transitivePeerDependencies:
- supports-color
dev: true
- /@vitest/expect@0.30.1:
- resolution: {integrity: sha512-c3kbEtN8XXJSeN81iDGq29bUzSjQhjES2WR3aColsS4lPGbivwLtas4DNUe0jD9gg/FYGIteqOenfU95EFituw==}
+ /@vitest/expect@1.2.0:
+ resolution: {integrity: sha512-H+2bHzhyvgp32o7Pgj2h9RTHN0pgYaoi26Oo3mE+dCi1PAqV31kIIVfTbqMO3Bvshd5mIrJLc73EwSRrbol9Lw==}
dependencies:
- '@vitest/spy': 0.30.1
- '@vitest/utils': 0.30.1
- chai: 4.3.7
+ '@vitest/spy': 1.2.0
+ '@vitest/utils': 1.2.0
+ chai: 4.3.10
dev: true
- /@vitest/runner@0.30.1:
- resolution: {integrity: sha512-W62kT/8i0TF1UBCNMRtRMOBWJKRnNyv9RrjIgdUryEe0wNpGZvvwPDLuzYdxvgSckzjp54DSpv1xUbv4BQ0qVA==}
+ /@vitest/runner@1.2.0:
+ resolution: {integrity: sha512-vaJkDoQaNUTroT70OhM0NPznP7H3WyRwt4LvGwCVYs/llLaqhoSLnlIhUClZpbF5RgAee29KRcNz0FEhYcgxqA==}
dependencies:
- '@vitest/utils': 0.30.1
- concordance: 5.0.4
- p-limit: 4.0.0
- pathe: 1.1.0
+ '@vitest/utils': 1.2.0
+ p-limit: 5.0.0
+ pathe: 1.1.1
dev: true
- /@vitest/snapshot@0.30.1:
- resolution: {integrity: sha512-fJZqKrE99zo27uoZA/azgWyWbFvM1rw2APS05yB0JaLwUIg9aUtvvnBf4q7JWhEcAHmSwbrxKFgyBUga6tq9Tw==}
+ /@vitest/snapshot@1.2.0:
+ resolution: {integrity: sha512-P33EE7TrVgB3HDLllrjK/GG6WSnmUtWohbwcQqmm7TAk9AVHpdgf7M3F3qRHKm6vhr7x3eGIln7VH052Smo6Kw==}
dependencies:
- magic-string: 0.30.0
- pathe: 1.1.0
- pretty-format: 27.5.1
+ magic-string: 0.30.5
+ pathe: 1.1.1
+ pretty-format: 29.7.0
dev: true
- /@vitest/spy@0.30.1:
- resolution: {integrity: sha512-YfJeIf37GvTZe04ZKxzJfnNNuNSmTEGnla2OdL60C8od16f3zOfv9q9K0nNii0NfjDJRt/CVN/POuY5/zTS+BA==}
+ /@vitest/spy@1.2.0:
+ resolution: {integrity: sha512-MNxSAfxUaCeowqyyGwC293yZgk7cECZU9wGb8N1pYQ0yOn/SIr8t0l9XnGRdQZvNV/ZHBYu6GO/W3tj5K3VN1Q==}
dependencies:
- tinyspy: 2.1.0
+ tinyspy: 2.2.0
dev: true
- /@vitest/utils@0.30.1:
- resolution: {integrity: sha512-/c8Xv2zUVc+rnNt84QF0Y0zkfxnaGhp87K2dYJMLtLOIckPzuxLVzAtFCicGFdB4NeBHNzTRr1tNn7rCtQcWFA==}
+ /@vitest/utils@1.2.0:
+ resolution: {integrity: sha512-FyD5bpugsXlwVpTcGLDf3wSPYy8g541fQt14qtzo8mJ4LdEpDKZ9mQy2+qdJm2TZRpjY5JLXihXCgIxiRJgi5g==}
dependencies:
- concordance: 5.0.4
- loupe: 2.3.6
- pretty-format: 27.5.1
+ diff-sequences: 29.6.3
+ estree-walker: 3.0.3
+ loupe: 2.3.7
+ pretty-format: 29.7.0
dev: true
/@vue/consolidate@0.17.3:
@@ -1296,16 +1559,12 @@ packages:
engines: {node: '>= 0.12.0'}
dev: true
- /@vue/repl@1.4.1(vue@packages+vue):
- resolution: {integrity: sha512-7ONz/o1OtS611jW6SdAOZXn4HdN8gfyatcOzcEu+3bDMvgbyr7ZUcbRV6Y4xdkxDARKDBzs+sb3/oz1Na5hAeQ==}
- peerDependencies:
- vue: ^3.2.13
- dependencies:
- vue: link:packages/vue
+ /@vue/repl@3.1.1:
+ resolution: {integrity: sha512-9nJImsUeywU2MTqvzf4ueqWC49UC3LVXVPk1HmoNnLVumfWXv+w5ytuSA//fxb/N/O5vCqE0UV63/dYvnCZpwQ==}
dev: false
- /@zeit/schemas@2.6.0:
- resolution: {integrity: sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==}
+ /@zeit/schemas@2.29.0:
+ resolution: {integrity: sha512-g5QiLIfbg3pLuYUJPlisNKY+epQJTcMDsOnVNkscrDP1oi7vmJnzOANYJI/1pZcVJ6umUkBv3aFtlg1UvUHGzA==}
dev: true
/JSONStream@1.3.5:
@@ -1316,10 +1575,6 @@ packages:
through: 2.3.8
dev: true
- /abab@2.0.6:
- resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
- dev: true
-
/accepts@1.3.8:
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
engines: {node: '>= 0.6'}
@@ -1328,23 +1583,16 @@ packages:
negotiator: 0.6.3
dev: true
- /acorn-globals@7.0.1:
- resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==}
- dependencies:
- acorn: 8.8.2
- acorn-walk: 8.2.0
- dev: true
-
- /acorn-jsx@5.3.2(acorn@8.8.2):
+ /acorn-jsx@5.3.2(acorn@8.10.0):
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
- acorn: 8.8.2
+ acorn: 8.10.0
dev: true
- /acorn-walk@8.2.0:
- resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
+ /acorn-walk@8.3.1:
+ resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==}
engines: {node: '>=0.4.0'}
dev: true
@@ -1354,8 +1602,8 @@ packages:
hasBin: true
dev: true
- /acorn@8.8.2:
- resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
+ /acorn@8.10.0:
+ resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==}
engines: {node: '>=0.4.0'}
hasBin: true
dev: true
@@ -1364,23 +1612,15 @@ packages:
resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==}
dev: true
- /agent-base@6.0.2:
- resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
- engines: {node: '>= 6.0.0'}
+ /agent-base@7.1.0:
+ resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
+ engines: {node: '>= 14'}
dependencies:
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: true
- /aggregate-error@3.1.0:
- resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
- engines: {node: '>=8'}
- dependencies:
- clean-stack: 2.2.0
- indent-string: 4.0.0
- dev: true
-
/ajv@6.12.6:
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
dependencies:
@@ -1390,10 +1630,19 @@ packages:
uri-js: 4.4.1
dev: true
- /ansi-align@2.0.0:
- resolution: {integrity: sha512-TdlOggdA/zURfMYa7ABC66j+oqfMew58KpJMbUlH3bcZP1b+cBHIHDDn5uH9INsxrHBPjsqM0tDB4jPTF/vgJA==}
+ /ajv@8.11.0:
+ resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==}
dependencies:
- string-width: 2.1.1
+ fast-deep-equal: 3.1.3
+ json-schema-traverse: 1.0.0
+ require-from-string: 2.0.2
+ uri-js: 4.4.1
+ dev: true
+
+ /ansi-align@3.0.1:
+ resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==}
+ dependencies:
+ string-width: 4.2.3
dev: true
/ansi-colors@4.1.3:
@@ -1401,16 +1650,11 @@ packages:
engines: {node: '>=6'}
dev: true
- /ansi-escapes@4.3.2:
- resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
- engines: {node: '>=8'}
+ /ansi-escapes@6.2.0:
+ resolution: {integrity: sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==}
+ engines: {node: '>=14.16'}
dependencies:
- type-fest: 0.21.3
- dev: true
-
- /ansi-regex@3.0.1:
- resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==}
- engines: {node: '>=4'}
+ type-fest: 3.13.1
dev: true
/ansi-regex@5.0.1:
@@ -1418,6 +1662,11 @@ packages:
engines: {node: '>=8'}
dev: true
+ /ansi-regex@6.0.1:
+ resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==}
+ engines: {node: '>=12'}
+ dev: true
+
/ansi-styles@3.2.1:
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
engines: {node: '>=4'}
@@ -1437,6 +1686,11 @@ packages:
engines: {node: '>=10'}
dev: true
+ /ansi-styles@6.2.1:
+ resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
+ engines: {node: '>=12'}
+ dev: true
+
/anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
@@ -1449,14 +1703,21 @@ packages:
resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==}
dev: true
- /arg@2.0.0:
- resolution: {integrity: sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==}
+ /arg@5.0.2:
+ resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
dev: true
/argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
dev: true
+ /array-buffer-byte-length@1.0.0:
+ resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==}
+ dependencies:
+ call-bind: 1.0.5
+ is-array-buffer: 3.0.2
+ dev: true
+
/array-ify@1.0.0:
resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==}
dev: true
@@ -1466,9 +1727,17 @@ packages:
engines: {node: '>=8'}
dev: true
- /arrify@1.0.1:
- resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==}
- engines: {node: '>=0.10.0'}
+ /arraybuffer.prototype.slice@1.0.2:
+ resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ array-buffer-byte-length: 1.0.0
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
+ get-intrinsic: 1.2.1
+ is-array-buffer: 3.0.2
+ is-shared-array-buffer: 1.0.2
dev: true
/asap@2.0.6:
@@ -1483,9 +1752,11 @@ packages:
resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
dev: true
- /astral-regex@2.0.0:
- resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
- engines: {node: '>=8'}
+ /ast-types@0.13.4:
+ resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==}
+ engines: {node: '>=4'}
+ dependencies:
+ tslib: 2.6.2
dev: true
/asynckit@0.4.0:
@@ -1497,11 +1768,15 @@ packages:
engines: {node: '>= 0.4'}
dev: true
+ /b4a@1.6.4:
+ resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==}
+ dev: true
+
/babel-walk@3.0.0-canary-5:
resolution: {integrity: sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw==}
engines: {node: '>= 10.0.0'}
dependencies:
- '@babel/types': 7.21.3
+ '@babel/types': 7.23.6
dev: true
/balanced-match@1.0.2:
@@ -1512,34 +1787,34 @@ packages:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: true
- /binary-extensions@2.2.0:
- resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
- engines: {node: '>=8'}
+ /basic-ftp@5.0.3:
+ resolution: {integrity: sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==}
+ engines: {node: '>=10.0.0'}
dev: true
- /bl@4.1.0:
- resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
+ /bidi-js@1.0.3:
+ resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==}
dependencies:
- buffer: 5.7.1
- inherits: 2.0.4
- readable-stream: 3.6.0
+ require-from-string: 2.0.2
dev: true
- /blueimp-md5@2.19.0:
- resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==}
+ /binary-extensions@2.2.0:
+ resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
+ engines: {node: '>=8'}
dev: true
- /boxen@1.3.0:
- resolution: {integrity: sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==}
- engines: {node: '>=4'}
+ /boxen@7.0.0:
+ resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==}
+ engines: {node: '>=14.16'}
dependencies:
- ansi-align: 2.0.0
- camelcase: 4.1.0
- chalk: 2.4.2
- cli-boxes: 1.0.0
- string-width: 2.1.1
- term-size: 1.2.0
- widest-line: 2.0.1
+ ansi-align: 3.0.1
+ camelcase: 7.0.1
+ chalk: 5.3.0
+ cli-boxes: 3.0.0
+ string-width: 5.1.2
+ type-fest: 2.19.0
+ widest-line: 4.0.1
+ wrap-ansi: 8.1.0
dev: true
/brace-expansion@1.1.11:
@@ -1562,15 +1837,15 @@ packages:
fill-range: 7.0.1
dev: true
- /browserslist@4.21.5:
- resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
+ /browserslist@4.22.1:
+ resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
- caniuse-lite: 1.0.30001467
- electron-to-chromium: 1.4.333
- node-releases: 2.0.10
- update-browserslist-db: 1.0.10(browserslist@4.21.5)
+ caniuse-lite: 1.0.30001551
+ electron-to-chromium: 1.4.561
+ node-releases: 2.0.13
+ update-browserslist-db: 1.0.13(browserslist@4.22.1)
dev: true
/buffer-crc32@0.2.13:
@@ -1603,11 +1878,12 @@ packages:
engines: {node: '>=8'}
dev: true
- /call-bind@1.0.2:
- resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
+ /call-bind@1.0.5:
+ resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==}
dependencies:
- function-bind: 1.1.1
- get-intrinsic: 1.2.0
+ function-bind: 1.1.2
+ get-intrinsic: 1.2.1
+ set-function-length: 1.1.1
dev: true
/callsites@3.1.0:
@@ -1615,49 +1891,33 @@ packages:
engines: {node: '>=6'}
dev: true
- /camelcase-keys@6.2.2:
- resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==}
- engines: {node: '>=8'}
- dependencies:
- camelcase: 5.3.1
- map-obj: 4.3.0
- quick-lru: 4.0.1
- dev: true
-
- /camelcase@4.1.0:
- resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==}
- engines: {node: '>=4'}
- dev: true
-
- /camelcase@5.3.1:
- resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
- engines: {node: '>=6'}
+ /camelcase@7.0.1:
+ resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==}
+ engines: {node: '>=14.16'}
dev: true
- /caniuse-lite@1.0.30001467:
- resolution: {integrity: sha512-cEdN/5e+RPikvl9AHm4uuLXxeCNq8rFsQ+lPHTfe/OtypP3WwnVVbjn+6uBV7PaFL6xUFzTh+sSCOz1rKhcO+Q==}
+ /caniuse-lite@1.0.30001551:
+ resolution: {integrity: sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==}
dev: true
- /chai@4.3.7:
- resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==}
+ /chai@4.3.10:
+ resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==}
engines: {node: '>=4'}
dependencies:
assertion-error: 1.1.0
- check-error: 1.0.2
+ check-error: 1.0.3
deep-eql: 4.1.3
- get-func-name: 2.0.0
- loupe: 2.3.6
+ get-func-name: 2.0.2
+ loupe: 2.3.7
pathval: 1.1.1
type-detect: 4.0.8
dev: true
- /chalk@2.4.1:
- resolution: {integrity: sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==}
- engines: {node: '>=4'}
+ /chalk-template@0.4.0:
+ resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==}
+ engines: {node: '>=12'}
dependencies:
- ansi-styles: 3.2.1
- escape-string-regexp: 1.0.5
- supports-color: 5.5.0
+ chalk: 4.1.2
dev: true
/chalk@2.4.2:
@@ -1677,14 +1937,26 @@ packages:
supports-color: 7.2.0
dev: true
+ /chalk@5.0.1:
+ resolution: {integrity: sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==}
+ engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
+ dev: true
+
+ /chalk@5.3.0:
+ resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==}
+ engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
+ dev: true
+
/character-parser@2.2.0:
resolution: {integrity: sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==}
dependencies:
is-regex: 1.1.4
dev: true
- /check-error@1.0.2:
- resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==}
+ /check-error@1.0.3:
+ resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==}
+ dependencies:
+ get-func-name: 2.0.2
dev: true
/chokidar@3.5.3:
@@ -1699,49 +1971,51 @@ packages:
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
- fsevents: 2.3.2
- dev: true
-
- /chownr@1.1.4:
- resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
+ fsevents: 2.3.3
dev: true
- /clean-stack@2.2.0:
- resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
- engines: {node: '>=6'}
+ /chromium-bidi@0.5.2(devtools-protocol@0.0.1203626):
+ resolution: {integrity: sha512-PbVOSddxgKyj+JByqavWMNqWPCoCaT6XK5Z1EFe168sxnB/BM51LnZEPXSbFcFAJv/+u2B4XNTs9uXxy4GW3cQ==}
+ peerDependencies:
+ devtools-protocol: '*'
+ dependencies:
+ devtools-protocol: 0.0.1203626
+ mitt: 3.0.1
+ urlpattern-polyfill: 9.0.0
dev: true
- /cli-boxes@1.0.0:
- resolution: {integrity: sha512-3Fo5wu8Ytle8q9iCzS4D2MWVL2X7JVWRiS1BnXbTFDhS9c/REkM9vd1AmabsoZoY5/dGi5TT9iKL8Kb6DeBRQg==}
- engines: {node: '>=0.10.0'}
+ /cli-boxes@3.0.0:
+ resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
+ engines: {node: '>=10'}
dev: true
- /cli-cursor@3.1.0:
- resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
- engines: {node: '>=8'}
+ /cli-cursor@4.0.0:
+ resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
- restore-cursor: 3.1.0
+ restore-cursor: 4.0.0
dev: true
- /cli-truncate@2.1.0:
- resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==}
- engines: {node: '>=8'}
+ /cli-truncate@4.0.0:
+ resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==}
+ engines: {node: '>=18'}
dependencies:
- slice-ansi: 3.0.0
- string-width: 4.2.3
+ slice-ansi: 5.0.0
+ string-width: 7.0.0
dev: true
- /clipboardy@2.3.0:
- resolution: {integrity: sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==}
- engines: {node: '>=8'}
+ /clipboardy@3.0.0:
+ resolution: {integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
arch: 2.2.0
- execa: 1.0.0
+ execa: 5.1.1
is-wsl: 2.2.0
dev: true
- /cliui@7.0.4:
- resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
+ /cliui@8.0.1:
+ resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
+ engines: {node: '>=12'}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
@@ -1769,8 +2043,8 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: true
- /colorette@2.0.19:
- resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==}
+ /colorette@2.0.20:
+ resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
dev: true
/combined-stream@1.0.8:
@@ -1780,13 +2054,13 @@ packages:
delayed-stream: 1.0.0
dev: true
- /commander@2.20.3:
- resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
+ /commander@11.1.0:
+ resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
+ engines: {node: '>=16'}
dev: true
- /commander@6.2.1:
- resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==}
- engines: {node: '>= 6'}
+ /commander@2.20.3:
+ resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
dev: true
/commondir@1.0.1:
@@ -1807,8 +2081,8 @@ packages:
mime-db: 1.52.0
dev: true
- /compression@1.7.3:
- resolution: {integrity: sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==}
+ /compression@1.7.4:
+ resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==}
engines: {node: '>= 0.8.0'}
dependencies:
accepts: 1.3.8
@@ -1823,28 +2097,14 @@ packages:
dev: true
/concat-map@0.0.1:
- resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
- dev: true
-
- /concordance@5.0.4:
- resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==}
- engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'}
- dependencies:
- date-time: 3.1.0
- esutils: 2.0.3
- fast-diff: 1.2.0
- js-string-escape: 1.0.1
- lodash: 4.17.21
- md5-hex: 3.0.1
- semver: 7.3.8
- well-known-symbols: 2.0.0
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
dev: true
/constantinople@4.0.1:
resolution: {integrity: sha512-vCrqcSIq4//Gx74TXXCGnHpulY1dskqLTFGDmhrGxzeXL8lF8kvXv6mpNWlJj1uD4DW23D4ljAqbY4RRaaUZIw==}
dependencies:
- '@babel/parser': 7.21.3
- '@babel/types': 7.21.3
+ '@babel/parser': 7.23.6
+ '@babel/types': 7.23.6
dev: true
/content-disposition@0.5.2:
@@ -1852,215 +2112,174 @@ packages:
engines: {node: '>= 0.6'}
dev: true
- /conventional-changelog-angular@5.0.13:
- resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==}
- engines: {node: '>=10'}
+ /conventional-changelog-angular@7.0.0:
+ resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==}
+ engines: {node: '>=16'}
dependencies:
compare-func: 2.0.0
- q: 1.5.1
dev: true
- /conventional-changelog-atom@2.0.8:
- resolution: {integrity: sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-atom@4.0.0:
+ resolution: {integrity: sha512-q2YtiN7rnT1TGwPTwjjBSIPIzDJCRE+XAUahWxnh+buKK99Kks4WLMHoexw38GXx9OUxAsrp44f9qXe5VEMYhw==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-cli@2.2.2:
- resolution: {integrity: sha512-8grMV5Jo8S0kP3yoMeJxV2P5R6VJOqK72IiSV9t/4H5r/HiRqEBQ83bYGuz4Yzfdj4bjaAEhZN/FFbsFXr5bOA==}
- engines: {node: '>=10'}
+ /conventional-changelog-cli@4.1.0:
+ resolution: {integrity: sha512-MscvILWZ6nWOoC+p/3Nn3D2cVLkjeQjyZPUr0bQ+vUORE/SPrkClJh8BOoMNpS4yk+zFJ5LlgXACxH6XGQoRXA==}
+ engines: {node: '>=16'}
hasBin: true
dependencies:
add-stream: 1.0.0
- conventional-changelog: 3.1.25
- lodash: 4.17.21
- meow: 8.1.2
- tempfile: 3.0.0
+ conventional-changelog: 5.1.0
+ meow: 12.1.1
+ tempfile: 5.0.0
dev: true
- /conventional-changelog-codemirror@2.0.8:
- resolution: {integrity: sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-codemirror@4.0.0:
+ resolution: {integrity: sha512-hQSojc/5imn1GJK3A75m9hEZZhc3urojA5gMpnar4JHmgLnuM3CUIARPpEk86glEKr3c54Po3WV/vCaO/U8g3Q==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-conventionalcommits@4.6.3:
- resolution: {integrity: sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==}
- engines: {node: '>=10'}
+ /conventional-changelog-conventionalcommits@7.0.2:
+ resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==}
+ engines: {node: '>=16'}
dependencies:
compare-func: 2.0.0
- lodash: 4.17.21
- q: 1.5.1
dev: true
- /conventional-changelog-core@4.2.4:
- resolution: {integrity: sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==}
- engines: {node: '>=10'}
+ /conventional-changelog-core@7.0.0:
+ resolution: {integrity: sha512-UYgaB1F/COt7VFjlYKVE/9tTzfU3VUq47r6iWf6lM5T7TlOxr0thI63ojQueRLIpVbrtHK4Ffw+yQGduw2Bhdg==}
+ engines: {node: '>=16'}
dependencies:
+ '@hutson/parse-repository-url': 5.0.0
add-stream: 1.0.0
- conventional-changelog-writer: 5.0.1
- conventional-commits-parser: 3.2.4
- dateformat: 3.0.3
- get-pkg-repo: 4.2.1
- git-raw-commits: 2.0.11
- git-remote-origin-url: 2.0.0
- git-semver-tags: 4.1.1
- lodash: 4.17.21
- normalize-package-data: 3.0.3
- q: 1.5.1
- read-pkg: 3.0.0
- read-pkg-up: 3.0.0
- through2: 4.0.2
+ conventional-changelog-writer: 7.0.1
+ conventional-commits-parser: 5.0.0
+ git-raw-commits: 4.0.0
+ git-semver-tags: 7.0.1
+ hosted-git-info: 7.0.1
+ normalize-package-data: 6.0.0
+ read-pkg: 8.1.0
+ read-pkg-up: 10.1.0
dev: true
- /conventional-changelog-ember@2.0.9:
- resolution: {integrity: sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-ember@4.0.0:
+ resolution: {integrity: sha512-D0IMhwcJUg1Y8FSry6XAplEJcljkHVlvAZddhhsdbL1rbsqRsMfGx/PIkPYq0ru5aDgn+OxhQ5N5yR7P9mfsvA==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-eslint@3.0.9:
- resolution: {integrity: sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-eslint@5.0.0:
+ resolution: {integrity: sha512-6JtLWqAQIeJLn/OzUlYmzd9fKeNSWmQVim9kql+v4GrZwLx807kAJl3IJVc3jTYfVKWLxhC3BGUxYiuVEcVjgA==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-express@2.0.6:
- resolution: {integrity: sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-express@4.0.0:
+ resolution: {integrity: sha512-yWyy5c7raP9v7aTvPAWzqrztACNO9+FEI1FSYh7UP7YT1AkWgv5UspUeB5v3Ibv4/o60zj2o9GF2tqKQ99lIsw==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-jquery@3.0.11:
- resolution: {integrity: sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==}
- engines: {node: '>=10'}
- dependencies:
- q: 1.5.1
+ /conventional-changelog-jquery@5.0.0:
+ resolution: {integrity: sha512-slLjlXLRNa/icMI3+uGLQbtrgEny3RgITeCxevJB+p05ExiTgHACP5p3XiMKzjBn80n+Rzr83XMYfRInEtCPPw==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-jshint@2.0.9:
- resolution: {integrity: sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==}
- engines: {node: '>=10'}
+ /conventional-changelog-jshint@4.0.0:
+ resolution: {integrity: sha512-LyXq1bbl0yG0Ai1SbLxIk8ZxUOe3AjnlwE6sVRQmMgetBk+4gY9EO3d00zlEt8Y8gwsITytDnPORl8al7InTjg==}
+ engines: {node: '>=16'}
dependencies:
compare-func: 2.0.0
- q: 1.5.1
dev: true
- /conventional-changelog-preset-loader@2.3.4:
- resolution: {integrity: sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==}
- engines: {node: '>=10'}
+ /conventional-changelog-preset-loader@4.1.0:
+ resolution: {integrity: sha512-HozQjJicZTuRhCRTq4rZbefaiCzRM2pr6u2NL3XhrmQm4RMnDXfESU6JKu/pnKwx5xtdkYfNCsbhN5exhiKGJA==}
+ engines: {node: '>=16'}
dev: true
- /conventional-changelog-writer@5.0.1:
- resolution: {integrity: sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==}
- engines: {node: '>=10'}
+ /conventional-changelog-writer@7.0.1:
+ resolution: {integrity: sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==}
+ engines: {node: '>=16'}
hasBin: true
dependencies:
- conventional-commits-filter: 2.0.7
- dateformat: 3.0.3
- handlebars: 4.7.7
+ conventional-commits-filter: 4.0.0
+ handlebars: 4.7.8
json-stringify-safe: 5.0.1
- lodash: 4.17.21
- meow: 8.1.2
- semver: 6.3.0
- split: 1.0.1
- through2: 4.0.2
+ meow: 12.1.1
+ semver: 7.5.4
+ split2: 4.2.0
dev: true
- /conventional-changelog@3.1.25:
- resolution: {integrity: sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ==}
- engines: {node: '>=10'}
- dependencies:
- conventional-changelog-angular: 5.0.13
- conventional-changelog-atom: 2.0.8
- conventional-changelog-codemirror: 2.0.8
- conventional-changelog-conventionalcommits: 4.6.3
- conventional-changelog-core: 4.2.4
- conventional-changelog-ember: 2.0.9
- conventional-changelog-eslint: 3.0.9
- conventional-changelog-express: 2.0.6
- conventional-changelog-jquery: 3.0.11
- conventional-changelog-jshint: 2.0.9
- conventional-changelog-preset-loader: 2.3.4
- dev: true
-
- /conventional-commits-filter@2.0.7:
- resolution: {integrity: sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==}
- engines: {node: '>=10'}
+ /conventional-changelog@5.1.0:
+ resolution: {integrity: sha512-aWyE/P39wGYRPllcCEZDxTVEmhyLzTc9XA6z6rVfkuCD2UBnhV/sgSOKbQrEG5z9mEZJjnopjgQooTKxEg8mAg==}
+ engines: {node: '>=16'}
dependencies:
- lodash.ismatch: 4.4.0
- modify-values: 1.0.1
+ conventional-changelog-angular: 7.0.0
+ conventional-changelog-atom: 4.0.0
+ conventional-changelog-codemirror: 4.0.0
+ conventional-changelog-conventionalcommits: 7.0.2
+ conventional-changelog-core: 7.0.0
+ conventional-changelog-ember: 4.0.0
+ conventional-changelog-eslint: 5.0.0
+ conventional-changelog-express: 4.0.0
+ conventional-changelog-jquery: 5.0.0
+ conventional-changelog-jshint: 4.0.0
+ conventional-changelog-preset-loader: 4.1.0
dev: true
- /conventional-commits-parser@3.2.4:
- resolution: {integrity: sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==}
- engines: {node: '>=10'}
+ /conventional-commits-filter@4.0.0:
+ resolution: {integrity: sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==}
+ engines: {node: '>=16'}
+ dev: true
+
+ /conventional-commits-parser@5.0.0:
+ resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==}
+ engines: {node: '>=16'}
hasBin: true
dependencies:
JSONStream: 1.3.5
- is-text-path: 1.0.1
- lodash: 4.17.21
- meow: 8.1.2
- split2: 3.2.2
- through2: 4.0.2
+ is-text-path: 2.0.0
+ meow: 12.1.1
+ split2: 4.2.0
dev: true
- /convert-source-map@1.9.0:
- resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
+ /convert-source-map@2.0.0:
+ resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
dev: true
/core-util-is@1.0.3:
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
+ dev: false
- /cosmiconfig@7.1.0:
- resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==}
- engines: {node: '>=10'}
- dependencies:
- '@types/parse-json': 4.0.0
- import-fresh: 3.3.0
- parse-json: 5.2.0
- path-type: 4.0.0
- yaml: 1.10.2
- dev: true
-
- /cosmiconfig@8.0.0:
- resolution: {integrity: sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==}
+ /cosmiconfig@8.3.6(typescript@5.2.2):
+ resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==}
engines: {node: '>=14'}
+ peerDependencies:
+ typescript: '>=4.9.5'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
dependencies:
import-fresh: 3.3.0
js-yaml: 4.1.0
parse-json: 5.2.0
path-type: 4.0.0
+ typescript: 5.2.2
dev: true
- /cross-fetch@3.1.5:
- resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==}
+ /cross-fetch@4.0.0:
+ resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==}
dependencies:
- node-fetch: 2.6.7
+ node-fetch: 2.7.0
transitivePeerDependencies:
- encoding
dev: true
- /cross-spawn@5.1.0:
- resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==}
- dependencies:
- lru-cache: 4.1.5
- shebang-command: 1.2.0
- which: 1.3.1
- dev: true
-
/cross-spawn@6.0.5:
resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==}
engines: {node: '>=4.8'}
dependencies:
nice-try: 1.0.5
path-key: 2.0.1
- semver: 5.7.1
+ semver: 5.7.2
shebang-command: 1.2.0
which: 1.3.1
dev: true
@@ -2074,54 +2293,47 @@ packages:
which: 2.0.2
dev: true
+ /css-tree@2.3.1:
+ resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
+ dependencies:
+ mdn-data: 2.0.30
+ source-map-js: 1.0.2
+ dev: true
+
/cssesc@3.0.0:
resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
engines: {node: '>=4'}
hasBin: true
dev: true
- /cssom@0.3.8:
- resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==}
- dev: true
-
- /cssom@0.5.0:
- resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==}
- dev: true
-
- /cssstyle@2.3.0:
- resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==}
- engines: {node: '>=8'}
+ /cssstyle@4.0.1:
+ resolution: {integrity: sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==}
+ engines: {node: '>=18'}
dependencies:
- cssom: 0.3.8
+ rrweb-cssom: 0.6.0
dev: true
- /csstype@3.1.1:
- resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
+ /csstype@3.1.3:
+ resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
dev: false
- /dargs@7.0.0:
- resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==}
- engines: {node: '>=8'}
- dev: true
-
- /data-urls@3.0.2:
- resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==}
+ /dargs@8.1.0:
+ resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==}
engines: {node: '>=12'}
- dependencies:
- abab: 2.0.6
- whatwg-mimetype: 3.0.0
- whatwg-url: 11.0.0
dev: true
- /date-time@3.1.0:
- resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==}
- engines: {node: '>=6'}
- dependencies:
- time-zone: 1.0.0
+ /data-uri-to-buffer@6.0.1:
+ resolution: {integrity: sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==}
+ engines: {node: '>= 14'}
dev: true
- /dateformat@3.0.3:
- resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==}
+ /data-urls@5.0.0:
+ resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}
+ engines: {node: '>=18'}
+ dependencies:
+ whatwg-mimetype: 4.0.0
+ whatwg-url: 14.0.0
dev: true
/debug@2.6.9:
@@ -2135,9 +2347,8 @@ packages:
ms: 2.0.0
dev: true
- /debug@4.3.4:
- resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
- engines: {node: '>=6.0'}
+ /debug@3.2.7:
+ resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
@@ -2147,27 +2358,22 @@ packages:
ms: 2.1.2
dev: true
- /decamelize-keys@1.1.1:
- resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==}
- engines: {node: '>=0.10.0'}
+ /debug@4.3.4:
+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
dependencies:
- decamelize: 1.2.0
- map-obj: 1.0.1
- dev: true
-
- /decamelize@1.2.0:
- resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
- engines: {node: '>=0.10.0'}
+ ms: 2.1.2
dev: true
/decimal.js@10.4.3:
resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
dev: true
- /dedent@0.7.0:
- resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==}
- dev: true
-
/deep-eql@4.1.3:
resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==}
engines: {node: '>=6'}
@@ -2184,26 +2390,50 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
dev: true
- /deepmerge@4.3.0:
- resolution: {integrity: sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==}
+ /deepmerge@4.3.1:
+ resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
engines: {node: '>=0.10.0'}
dev: true
- /define-properties@1.1.4:
- resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==}
+ /define-data-property@1.1.1:
+ resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ get-intrinsic: 1.2.1
+ gopd: 1.0.1
+ has-property-descriptors: 1.0.0
+ dev: true
+
+ /define-properties@1.2.1:
+ resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
engines: {node: '>= 0.4'}
dependencies:
+ define-data-property: 1.1.1
has-property-descriptors: 1.0.0
object-keys: 1.1.1
dev: true
+ /degenerator@5.0.1:
+ resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==}
+ engines: {node: '>= 14'}
+ dependencies:
+ ast-types: 0.13.4
+ escodegen: 2.1.0
+ esprima: 4.0.1
+ dev: true
+
/delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: true
- /devtools-protocol@0.0.1082910:
- resolution: {integrity: sha512-RqoZ2GmqaNxyx+99L/RemY5CkwG9D0WEfOKxekwCRXOGrDCep62ngezEJUVMq6rISYQ+085fJnWDQqGHlxVNww==}
+ /devtools-protocol@0.0.1203626:
+ resolution: {integrity: sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==}
+ dev: true
+
+ /diff-sequences@29.6.3:
+ resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dev: true
/dir-glob@3.0.1:
@@ -2224,13 +2454,6 @@ packages:
resolution: {integrity: sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==}
dev: true
- /domexception@4.0.0:
- resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==}
- engines: {node: '>=12'}
- dependencies:
- webidl-conversions: 7.0.0
- dev: true
-
/dot-prop@5.3.0:
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
engines: {node: '>=8'}
@@ -2238,31 +2461,43 @@ packages:
is-obj: 2.0.0
dev: true
- /electron-to-chromium@1.4.333:
- resolution: {integrity: sha512-YyE8+GKyGtPEP1/kpvqsdhD6rA/TP1DUFDN4uiU/YI52NzDxmwHkEb3qjId8hLBa5siJvG0sfC3O66501jMruQ==}
+ /eastasianwidth@0.2.0:
+ resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
+ dev: true
+
+ /electron-to-chromium@1.4.561:
+ resolution: {integrity: sha512-eS5t4ulWOBfVHdq9SW2dxEaFarj1lPjvJ8PaYMOjY0DecBaj/t4ARziL2IPpDr4atyWwjLFGQ2vo/VCgQFezVQ==}
+ dev: true
+
+ /emoji-regex@10.3.0:
+ resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==}
dev: true
/emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
dev: true
+ /emoji-regex@9.2.2:
+ resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
+ dev: true
+
/end-of-stream@1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
dependencies:
once: 1.4.0
dev: true
- /enquirer@2.3.6:
- resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}
+ /enquirer@2.4.1:
+ resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==}
engines: {node: '>=8.6'}
dependencies:
ansi-colors: 4.1.3
+ strip-ansi: 6.0.1
dev: true
- /entities@4.4.0:
- resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==}
+ /entities@4.5.0:
+ resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
- dev: true
/error-ex@1.3.2:
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
@@ -2270,55 +2505,61 @@ packages:
is-arrayish: 0.2.1
dev: true
- /es-abstract@1.21.1:
- resolution: {integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==}
+ /es-abstract@1.22.2:
+ resolution: {integrity: sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==}
engines: {node: '>= 0.4'}
dependencies:
+ array-buffer-byte-length: 1.0.0
+ arraybuffer.prototype.slice: 1.0.2
available-typed-arrays: 1.0.5
- call-bind: 1.0.2
+ call-bind: 1.0.5
es-set-tostringtag: 2.0.1
es-to-primitive: 1.2.1
- function-bind: 1.1.1
- function.prototype.name: 1.1.5
- get-intrinsic: 1.2.0
+ function.prototype.name: 1.1.6
+ get-intrinsic: 1.2.1
get-symbol-description: 1.0.0
globalthis: 1.0.3
gopd: 1.0.1
- has: 1.0.3
+ has: 1.0.4
has-property-descriptors: 1.0.0
has-proto: 1.0.1
has-symbols: 1.0.3
- internal-slot: 1.0.4
- is-array-buffer: 3.0.1
+ internal-slot: 1.0.5
+ is-array-buffer: 3.0.2
is-callable: 1.2.7
is-negative-zero: 2.0.2
is-regex: 1.1.4
is-shared-array-buffer: 1.0.2
is-string: 1.0.7
- is-typed-array: 1.1.10
+ is-typed-array: 1.1.12
is-weakref: 1.0.2
- object-inspect: 1.12.3
+ object-inspect: 1.13.1
object-keys: 1.1.1
object.assign: 4.1.4
- regexp.prototype.flags: 1.4.3
+ regexp.prototype.flags: 1.5.1
+ safe-array-concat: 1.0.1
safe-regex-test: 1.0.0
- string.prototype.trimend: 1.0.6
- string.prototype.trimstart: 1.0.6
+ string.prototype.trim: 1.2.8
+ string.prototype.trimend: 1.0.7
+ string.prototype.trimstart: 1.0.7
+ typed-array-buffer: 1.0.0
+ typed-array-byte-length: 1.0.0
+ typed-array-byte-offset: 1.0.0
typed-array-length: 1.0.4
unbox-primitive: 1.0.2
- which-typed-array: 1.1.9
+ which-typed-array: 1.1.13
dev: true
- /es-module-lexer@1.1.0:
- resolution: {integrity: sha512-fJg+1tiyEeS8figV+fPcPpm8WqJEflG3yPU0NOm5xMvrNkuiy7HzX/Ljng4Y0hAoiw4/3hQTCFYw+ub8+a2pRA==}
+ /es-module-lexer@1.3.1:
+ resolution: {integrity: sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==}
dev: true
/es-set-tostringtag@2.0.1:
resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==}
engines: {node: '>= 0.4'}
dependencies:
- get-intrinsic: 1.2.0
- has: 1.0.3
+ get-intrinsic: 1.2.1
+ has: 1.0.4
has-tostringtag: 1.0.0
dev: true
@@ -2331,44 +2572,45 @@ packages:
is-symbol: 1.0.4
dev: true
- /esbuild-plugin-polyfill-node@0.2.0(esbuild@0.17.5):
- resolution: {integrity: sha512-rpCoK4mag0nehBtFlFMLSuL9bNBLEh8h3wZ/FsrJEDompA/AwOqInx6Xow01+CXAcvZYhkoJ0SIZiS37qkecDA==}
+ /esbuild-plugin-polyfill-node@0.3.0(esbuild@0.19.10):
+ resolution: {integrity: sha512-SHG6CKUfWfYyYXGpW143NEZtcVVn8S/WHcEOxk62LuDXnY4Zpmc+WmxJKN6GMTgTClXJXhEM5KQlxKY6YjbucQ==}
peerDependencies:
esbuild: '*'
dependencies:
'@jspm/core': 2.0.1
- esbuild: 0.17.5
- import-meta-resolve: 2.2.2
+ esbuild: 0.19.10
+ import-meta-resolve: 3.0.0
dev: true
- /esbuild@0.17.5:
- resolution: {integrity: sha512-Bu6WLCc9NMsNoMJUjGl3yBzTjVLXdysMltxQWiLAypP+/vQrf+3L1Xe8fCXzxaECus2cEJ9M7pk4yKatEwQMqQ==}
+ /esbuild@0.19.10:
+ resolution: {integrity: sha512-S1Y27QGt/snkNYrRcswgRFqZjaTG5a5xM3EQo97uNBnH505pdzSNe/HLBq1v0RO7iK/ngdbhJB6mDAp0OK+iUA==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
- '@esbuild/android-arm': 0.17.5
- '@esbuild/android-arm64': 0.17.5
- '@esbuild/android-x64': 0.17.5
- '@esbuild/darwin-arm64': 0.17.5
- '@esbuild/darwin-x64': 0.17.5
- '@esbuild/freebsd-arm64': 0.17.5
- '@esbuild/freebsd-x64': 0.17.5
- '@esbuild/linux-arm': 0.17.5
- '@esbuild/linux-arm64': 0.17.5
- '@esbuild/linux-ia32': 0.17.5
- '@esbuild/linux-loong64': 0.17.5
- '@esbuild/linux-mips64el': 0.17.5
- '@esbuild/linux-ppc64': 0.17.5
- '@esbuild/linux-riscv64': 0.17.5
- '@esbuild/linux-s390x': 0.17.5
- '@esbuild/linux-x64': 0.17.5
- '@esbuild/netbsd-x64': 0.17.5
- '@esbuild/openbsd-x64': 0.17.5
- '@esbuild/sunos-x64': 0.17.5
- '@esbuild/win32-arm64': 0.17.5
- '@esbuild/win32-ia32': 0.17.5
- '@esbuild/win32-x64': 0.17.5
+ '@esbuild/aix-ppc64': 0.19.10
+ '@esbuild/android-arm': 0.19.10
+ '@esbuild/android-arm64': 0.19.10
+ '@esbuild/android-x64': 0.19.10
+ '@esbuild/darwin-arm64': 0.19.10
+ '@esbuild/darwin-x64': 0.19.10
+ '@esbuild/freebsd-arm64': 0.19.10
+ '@esbuild/freebsd-x64': 0.19.10
+ '@esbuild/linux-arm': 0.19.10
+ '@esbuild/linux-arm64': 0.19.10
+ '@esbuild/linux-ia32': 0.19.10
+ '@esbuild/linux-loong64': 0.19.10
+ '@esbuild/linux-mips64el': 0.19.10
+ '@esbuild/linux-ppc64': 0.19.10
+ '@esbuild/linux-riscv64': 0.19.10
+ '@esbuild/linux-s390x': 0.19.10
+ '@esbuild/linux-x64': 0.19.10
+ '@esbuild/netbsd-x64': 0.19.10
+ '@esbuild/openbsd-x64': 0.19.10
+ '@esbuild/sunos-x64': 0.19.10
+ '@esbuild/win32-arm64': 0.19.10
+ '@esbuild/win32-ia32': 0.19.10
+ '@esbuild/win32-x64': 0.19.10
dev: true
/escalade@3.1.1:
@@ -2386,24 +2628,89 @@ packages:
engines: {node: '>=10'}
dev: true
- /escodegen@2.0.0:
- resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==}
+ /escodegen@2.1.0:
+ resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==}
engines: {node: '>=6.0'}
hasBin: true
dependencies:
esprima: 4.0.1
estraverse: 5.3.0
esutils: 2.0.3
- optionator: 0.8.3
optionalDependencies:
source-map: 0.6.1
dev: true
- /eslint-plugin-jest@27.2.1(eslint@8.33.0)(typescript@5.0.2):
- resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==}
+ /eslint-define-config@1.24.1:
+ resolution: {integrity: sha512-o36vBhPSWyIQlHoMqGhhcGmOOm2A2ccBVIdLTG/AWdm9YmjpsLpf+5ntf9LlHR6dduLREgxtGwvwPwSt7vnXJg==}
+ engines: {node: '>=18.0.0', npm: '>=9.0.0', pnpm: '>= 8.6.0'}
+ dev: true
+
+ /eslint-import-resolver-node@0.3.9:
+ resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
+ dependencies:
+ debug: 3.2.7
+ is-core-module: 2.13.1
+ resolve: 1.22.8
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0):
+ resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ '@typescript-eslint/parser': '*'
+ eslint: '*'
+ eslint-import-resolver-node: '*'
+ eslint-import-resolver-typescript: '*'
+ eslint-import-resolver-webpack: '*'
+ peerDependenciesMeta:
+ '@typescript-eslint/parser':
+ optional: true
+ eslint:
+ optional: true
+ eslint-import-resolver-node:
+ optional: true
+ eslint-import-resolver-typescript:
+ optional: true
+ eslint-import-resolver-webpack:
+ optional: true
+ dependencies:
+ '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.2.2)
+ debug: 3.2.7
+ eslint: 8.56.0
+ eslint-import-resolver-node: 0.3.9
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0):
+ resolution: {integrity: sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ==}
+ engines: {node: '>=12'}
+ peerDependencies:
+ eslint: ^7.2.0 || ^8
+ dependencies:
+ debug: 4.3.4
+ doctrine: 3.0.0
+ eslint: 8.56.0
+ eslint-import-resolver-node: 0.3.9
+ eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0)
+ get-tsconfig: 4.7.2
+ is-glob: 4.0.3
+ minimatch: 3.1.2
+ semver: 7.5.4
+ transitivePeerDependencies:
+ - '@typescript-eslint/parser'
+ - eslint-import-resolver-typescript
+ - eslint-import-resolver-webpack
+ - supports-color
+ dev: true
+
+ /eslint-plugin-jest@27.6.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.2.2):
+ resolution: {integrity: sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
peerDependencies:
- '@typescript-eslint/eslint-plugin': ^5.0.0
+ '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0
eslint: ^7.0.0 || ^8.0.0
jest: '*'
peerDependenciesMeta:
@@ -2412,8 +2719,9 @@ packages:
jest:
optional: true
dependencies:
- '@typescript-eslint/utils': 5.50.0(eslint@8.33.0)(typescript@5.0.2)
- eslint: 8.33.0
+ '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2)
+ '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2)
+ eslint: 8.56.0
transitivePeerDependencies:
- supports-color
- typescript
@@ -2427,89 +2735,73 @@ packages:
estraverse: 4.3.0
dev: true
- /eslint-scope@7.1.1:
- resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==}
+ /eslint-scope@7.2.2:
+ resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
esrecurse: 4.3.0
estraverse: 5.3.0
dev: true
- /eslint-utils@3.0.0(eslint@8.33.0):
- resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
- engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
- peerDependencies:
- eslint: '>=5'
- dependencies:
- eslint: 8.33.0
- eslint-visitor-keys: 2.1.0
- dev: true
-
- /eslint-visitor-keys@2.1.0:
- resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}
- engines: {node: '>=10'}
- dev: true
-
- /eslint-visitor-keys@3.3.0:
- resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==}
+ /eslint-visitor-keys@3.4.3:
+ resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /eslint@8.33.0:
- resolution: {integrity: sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==}
+ /eslint@8.56.0:
+ resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
dependencies:
- '@eslint/eslintrc': 1.4.1
- '@humanwhocodes/config-array': 0.11.8
+ '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0)
+ '@eslint-community/regexpp': 4.9.1
+ '@eslint/eslintrc': 2.1.4
+ '@eslint/js': 8.56.0
+ '@humanwhocodes/config-array': 0.11.13
'@humanwhocodes/module-importer': 1.0.1
'@nodelib/fs.walk': 1.2.8
+ '@ungap/structured-clone': 1.2.0
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
debug: 4.3.4
doctrine: 3.0.0
escape-string-regexp: 4.0.0
- eslint-scope: 7.1.1
- eslint-utils: 3.0.0(eslint@8.33.0)
- eslint-visitor-keys: 3.3.0
- espree: 9.4.1
- esquery: 1.4.0
+ eslint-scope: 7.2.2
+ eslint-visitor-keys: 3.4.3
+ espree: 9.6.1
+ esquery: 1.5.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
file-entry-cache: 6.0.1
find-up: 5.0.0
glob-parent: 6.0.2
- globals: 13.20.0
- grapheme-splitter: 1.0.4
+ globals: 13.23.0
+ graphemer: 1.4.0
ignore: 5.2.4
- import-fresh: 3.3.0
imurmurhash: 0.1.4
is-glob: 4.0.3
is-path-inside: 3.0.3
- js-sdsl: 4.3.0
js-yaml: 4.1.0
json-stable-stringify-without-jsonify: 1.0.1
levn: 0.4.1
lodash.merge: 4.6.2
minimatch: 3.1.2
natural-compare: 1.4.0
- optionator: 0.9.1
- regexpp: 3.2.0
+ optionator: 0.9.3
strip-ansi: 6.0.1
- strip-json-comments: 3.1.1
text-table: 0.2.0
transitivePeerDependencies:
- supports-color
dev: true
- /espree@9.4.1:
- resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==}
+ /espree@9.6.1:
+ resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- acorn: 8.8.2
- acorn-jsx: 5.3.2(acorn@8.8.2)
- eslint-visitor-keys: 3.3.0
+ acorn: 8.10.0
+ acorn-jsx: 5.3.2(acorn@8.10.0)
+ eslint-visitor-keys: 3.4.3
dev: true
/esprima@4.0.1:
@@ -2518,8 +2810,8 @@ packages:
hasBin: true
dev: true
- /esquery@1.4.0:
- resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}
+ /esquery@1.5.0:
+ resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
engines: {node: '>=0.10'}
dependencies:
estraverse: 5.3.0
@@ -2545,44 +2837,28 @@ packages:
/estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
+ /estree-walker@3.0.3:
+ resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
+ dependencies:
+ '@types/estree': 1.0.3
+ dev: true
+
/esutils@2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
dev: true
- /execa@0.7.0:
- resolution: {integrity: sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==}
- engines: {node: '>=4'}
- dependencies:
- cross-spawn: 5.1.0
- get-stream: 3.0.0
- is-stream: 1.1.0
- npm-run-path: 2.0.2
- p-finally: 1.0.0
- signal-exit: 3.0.7
- strip-eof: 1.0.0
- dev: true
-
- /execa@1.0.0:
- resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==}
- engines: {node: '>=6'}
- dependencies:
- cross-spawn: 6.0.5
- get-stream: 4.1.0
- is-stream: 1.1.0
- npm-run-path: 2.0.2
- p-finally: 1.0.0
- signal-exit: 3.0.7
- strip-eof: 1.0.0
+ /eventemitter3@5.0.1:
+ resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
dev: true
- /execa@4.1.0:
- resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==}
+ /execa@5.1.1:
+ resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
engines: {node: '>=10'}
dependencies:
cross-spawn: 7.0.3
- get-stream: 5.2.0
- human-signals: 1.1.1
+ get-stream: 6.0.1
+ human-signals: 2.1.0
is-stream: 2.0.1
merge-stream: 2.0.0
npm-run-path: 4.0.1
@@ -2591,6 +2867,21 @@ packages:
strip-final-newline: 2.0.0
dev: true
+ /execa@8.0.1:
+ resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==}
+ engines: {node: '>=16.17'}
+ dependencies:
+ cross-spawn: 7.0.3
+ get-stream: 8.0.1
+ human-signals: 5.0.0
+ is-stream: 3.0.0
+ merge-stream: 2.0.0
+ npm-run-path: 5.1.0
+ onetime: 6.0.0
+ signal-exit: 4.1.0
+ strip-final-newline: 3.0.0
+ dev: true
+
/extract-zip@2.0.1:
resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
engines: {node: '>= 10.17.0'}
@@ -2600,7 +2891,7 @@ packages:
get-stream: 5.2.0
yauzl: 2.10.0
optionalDependencies:
- '@types/yauzl': 2.10.0
+ '@types/yauzl': 2.10.2
transitivePeerDependencies:
- supports-color
dev: true
@@ -2609,12 +2900,12 @@ packages:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
dev: true
- /fast-diff@1.2.0:
- resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
+ /fast-fifo@1.3.2:
+ resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==}
dev: true
- /fast-glob@3.2.12:
- resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
+ /fast-glob@3.3.1:
+ resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==}
engines: {node: '>=8.6.0'}
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -2633,7 +2924,7 @@ packages:
dev: true
/fast-url-parser@1.1.3:
- resolution: {integrity: sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=}
+ resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==}
dependencies:
punycode: 1.4.1
dev: true
@@ -2654,7 +2945,7 @@ packages:
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
- flat-cache: 3.0.4
+ flat-cache: 3.1.1
dev: true
/file-saver@2.0.5:
@@ -2668,21 +2959,6 @@ packages:
to-regex-range: 5.0.1
dev: true
- /find-up@2.1.0:
- resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==}
- engines: {node: '>=4'}
- dependencies:
- locate-path: 2.0.0
- dev: true
-
- /find-up@4.1.0:
- resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
- engines: {node: '>=8'}
- dependencies:
- locate-path: 5.0.0
- path-exists: 4.0.0
- dev: true
-
/find-up@5.0.0:
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
engines: {node: '>=10'}
@@ -2691,16 +2967,25 @@ packages:
path-exists: 4.0.0
dev: true
- /flat-cache@3.0.4:
- resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
- engines: {node: ^10.12.0 || >=12.0.0}
+ /find-up@6.3.0:
+ resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ locate-path: 7.2.0
+ path-exists: 5.0.0
+ dev: true
+
+ /flat-cache@3.1.1:
+ resolution: {integrity: sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==}
+ engines: {node: '>=12.0.0'}
dependencies:
- flatted: 3.2.7
+ flatted: 3.2.9
+ keyv: 4.5.4
rimraf: 3.0.2
dev: true
- /flatted@3.2.7:
- resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
+ /flatted@3.2.9:
+ resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
dev: true
/for-each@0.3.3:
@@ -2709,6 +2994,14 @@ packages:
is-callable: 1.2.7
dev: true
+ /foreground-child@3.1.1:
+ resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==}
+ engines: {node: '>=14'}
+ dependencies:
+ cross-spawn: 7.0.3
+ signal-exit: 4.1.0
+ dev: true
+
/form-data@4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
@@ -2718,33 +3011,38 @@ packages:
mime-types: 2.1.35
dev: true
- /fs-constants@1.0.0:
- resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
+ /fs-extra@8.1.0:
+ resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
+ engines: {node: '>=6 <7 || >=8'}
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 4.0.0
+ universalify: 0.1.2
dev: true
/fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
dev: true
- /fsevents@2.3.2:
- resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ /fsevents@2.3.3:
+ resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
dev: true
optional: true
- /function-bind@1.1.1:
- resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
+ /function-bind@1.1.2:
+ resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
dev: true
- /function.prototype.name@1.1.5:
- resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
+ /function.prototype.name@1.1.6:
+ resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
- es-abstract: 1.21.1
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
functions-have-names: 1.2.3
dev: true
@@ -2768,43 +3066,22 @@ packages:
engines: {node: 6.* || 8.* || >= 10.*}
dev: true
- /get-func-name@2.0.0:
- resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==}
- dev: true
-
- /get-intrinsic@1.2.0:
- resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==}
- dependencies:
- function-bind: 1.1.1
- has: 1.0.3
- has-symbols: 1.0.3
- dev: true
-
- /get-own-enumerable-property-symbols@3.0.2:
- resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==}
- dev: true
-
- /get-pkg-repo@4.2.1:
- resolution: {integrity: sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==}
- engines: {node: '>=6.9.0'}
- hasBin: true
- dependencies:
- '@hutson/parse-repository-url': 3.0.2
- hosted-git-info: 4.1.0
- through2: 2.0.5
- yargs: 16.2.0
+ /get-east-asian-width@1.2.0:
+ resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==}
+ engines: {node: '>=18'}
dev: true
- /get-stream@3.0.0:
- resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==}
- engines: {node: '>=4'}
+ /get-func-name@2.0.2:
+ resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==}
dev: true
- /get-stream@4.1.0:
- resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==}
- engines: {node: '>=6'}
+ /get-intrinsic@1.2.1:
+ resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==}
dependencies:
- pump: 3.0.0
+ function-bind: 1.1.2
+ has: 1.0.4
+ has-proto: 1.0.1
+ has-symbols: 1.0.3
dev: true
/get-stream@5.2.0:
@@ -2814,47 +3091,59 @@ packages:
pump: 3.0.0
dev: true
+ /get-stream@6.0.1:
+ resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
+ engines: {node: '>=10'}
+ dev: true
+
+ /get-stream@8.0.1:
+ resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
+ engines: {node: '>=16'}
+ dev: true
+
/get-symbol-description@1.0.0:
resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.0
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
dev: true
- /git-raw-commits@2.0.11:
- resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==}
- engines: {node: '>=10'}
- hasBin: true
+ /get-tsconfig@4.7.2:
+ resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==}
dependencies:
- dargs: 7.0.0
- lodash: 4.17.21
- meow: 8.1.2
- split2: 3.2.2
- through2: 4.0.2
+ resolve-pkg-maps: 1.0.0
dev: true
- /git-remote-origin-url@2.0.0:
- resolution: {integrity: sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==}
- engines: {node: '>=4'}
+ /get-uri@6.0.2:
+ resolution: {integrity: sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==}
+ engines: {node: '>= 14'}
dependencies:
- gitconfiglocal: 1.0.0
- pify: 2.3.0
+ basic-ftp: 5.0.3
+ data-uri-to-buffer: 6.0.1
+ debug: 4.3.4
+ fs-extra: 8.1.0
+ transitivePeerDependencies:
+ - supports-color
dev: true
- /git-semver-tags@4.1.1:
- resolution: {integrity: sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==}
- engines: {node: '>=10'}
+ /git-raw-commits@4.0.0:
+ resolution: {integrity: sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==}
+ engines: {node: '>=16'}
hasBin: true
dependencies:
- meow: 8.1.2
- semver: 6.3.0
+ dargs: 8.1.0
+ meow: 12.1.1
+ split2: 4.2.0
dev: true
- /gitconfiglocal@1.0.0:
- resolution: {integrity: sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==}
+ /git-semver-tags@7.0.1:
+ resolution: {integrity: sha512-NY0ZHjJzyyNXHTDZmj+GG7PyuAKtMsyWSwh07CR2hOZFa+/yoTsXci/nF2obzL8UDhakFNkD9gNdt/Ed+cxh2Q==}
+ engines: {node: '>=16'}
+ hasBin: true
dependencies:
- ini: 1.3.8
+ meow: 12.1.1
+ semver: 7.5.4
dev: true
/glob-parent@5.1.2:
@@ -2871,6 +3160,18 @@ packages:
is-glob: 4.0.3
dev: true
+ /glob@10.3.10:
+ resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ hasBin: true
+ dependencies:
+ foreground-child: 3.1.1
+ jackspeak: 2.3.6
+ minimatch: 9.0.3
+ minipass: 7.0.4
+ path-scurry: 1.10.1
+ dev: true
+
/glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
dependencies:
@@ -2898,8 +3199,8 @@ packages:
engines: {node: '>=4'}
dev: true
- /globals@13.20.0:
- resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==}
+ /globals@13.23.0:
+ resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==}
engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
@@ -2909,7 +3210,7 @@ packages:
resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==}
engines: {node: '>= 0.4'}
dependencies:
- define-properties: 1.1.4
+ define-properties: 1.2.1
dev: true
/globby@11.1.0:
@@ -2918,7 +3219,7 @@ packages:
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
- fast-glob: 3.2.12
+ fast-glob: 3.3.1
ignore: 5.2.4
merge2: 1.4.1
slash: 3.0.0
@@ -2927,23 +3228,23 @@ packages:
/gopd@1.0.1:
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
dependencies:
- get-intrinsic: 1.2.0
+ get-intrinsic: 1.2.1
dev: true
- /graceful-fs@4.2.10:
- resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
+ /graceful-fs@4.2.11:
+ resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
dev: true
- /grapheme-splitter@1.0.4:
- resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}
+ /graphemer@1.4.0:
+ resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
dev: true
- /handlebars@4.7.7:
- resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==}
+ /handlebars@4.7.8:
+ resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==}
engines: {node: '>=0.4.7'}
hasBin: true
dependencies:
- minimist: 1.2.7
+ minimist: 1.2.8
neo-async: 2.6.2
source-map: 0.6.1
wordwrap: 1.0.0
@@ -2951,11 +3252,6 @@ packages:
uglify-js: 3.17.4
dev: true
- /hard-rejection@2.1.0:
- resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==}
- engines: {node: '>=6'}
- dev: true
-
/has-bigints@1.0.2:
resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
dev: true
@@ -2973,7 +3269,7 @@ packages:
/has-property-descriptors@1.0.0:
resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
dependencies:
- get-intrinsic: 1.2.0
+ get-intrinsic: 1.2.1
dev: true
/has-proto@1.0.1:
@@ -2993,63 +3289,72 @@ packages:
has-symbols: 1.0.3
dev: true
- /has@1.0.3:
- resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
+ /has@1.0.4:
+ resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==}
engines: {node: '>= 0.4.0'}
- dependencies:
- function-bind: 1.1.1
dev: true
/hash-sum@2.0.0:
resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==}
dev: true
+ /hasown@2.0.0:
+ resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ function-bind: 1.1.2
+ dev: true
+
/hosted-git-info@2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
dev: true
- /hosted-git-info@4.1.0:
- resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}
- engines: {node: '>=10'}
+ /hosted-git-info@7.0.1:
+ resolution: {integrity: sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==}
+ engines: {node: ^16.14.0 || >=18.0.0}
dependencies:
- lru-cache: 6.0.0
+ lru-cache: 10.1.0
dev: true
- /html-encoding-sniffer@3.0.0:
- resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==}
- engines: {node: '>=12'}
+ /html-encoding-sniffer@4.0.0:
+ resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==}
+ engines: {node: '>=18'}
dependencies:
- whatwg-encoding: 2.0.0
+ whatwg-encoding: 3.1.1
dev: true
/html-escaper@2.0.2:
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
dev: true
- /http-proxy-agent@5.0.0:
- resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
- engines: {node: '>= 6'}
+ /http-proxy-agent@7.0.0:
+ resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==}
+ engines: {node: '>= 14'}
dependencies:
- '@tootallnate/once': 2.0.0
- agent-base: 6.0.2
+ agent-base: 7.1.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: true
- /https-proxy-agent@5.0.1:
- resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
- engines: {node: '>= 6'}
+ /https-proxy-agent@7.0.2:
+ resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==}
+ engines: {node: '>= 14'}
dependencies:
- agent-base: 6.0.2
+ agent-base: 7.1.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: true
- /human-signals@1.1.1:
- resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==}
- engines: {node: '>=8.12.0'}
+ /human-signals@2.1.0:
+ resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
+ engines: {node: '>=10.17.0'}
+ dev: true
+
+ /human-signals@5.0.0:
+ resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
+ engines: {node: '>=16.17.0'}
dev: true
/iconv-lite@0.6.3:
@@ -3059,17 +3364,13 @@ packages:
safer-buffer: 2.1.2
dev: true
- /icss-replace-symbols@1.1.0:
- resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==}
- dev: true
-
- /icss-utils@5.1.0(postcss@8.4.21):
+ /icss-utils@5.1.0(postcss@8.4.33):
resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==}
engines: {node: ^10 || ^12 || >= 14}
peerDependencies:
postcss: ^8.1.0
dependencies:
- postcss: 8.4.21
+ postcss: 8.4.33
dev: true
/ieee754@1.2.1:
@@ -3085,8 +3386,8 @@ packages:
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
dev: false
- /immutable@4.2.3:
- resolution: {integrity: sha512-IHpmvaOIX4VLJwPOuQr1NpeBr2ZG6vpIj3blsLVxXRWJscLioaJRStqC+NcBsLeCDsnGlPpXd5/WZmnE7MbsKA==}
+ /immutable@4.3.4:
+ resolution: {integrity: sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==}
dev: true
/import-fresh@3.3.0:
@@ -3097,8 +3398,8 @@ packages:
resolve-from: 4.0.0
dev: true
- /import-meta-resolve@2.2.2:
- resolution: {integrity: sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA==}
+ /import-meta-resolve@3.0.0:
+ resolution: {integrity: sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg==}
dev: true
/imurmurhash@0.1.4:
@@ -3106,11 +3407,6 @@ packages:
engines: {node: '>=0.8.19'}
dev: true
- /indent-string@4.0.0:
- resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
- engines: {node: '>=8'}
- dev: true
-
/inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
dependencies:
@@ -3125,21 +3421,29 @@ packages:
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
dev: true
- /internal-slot@1.0.4:
- resolution: {integrity: sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==}
+ /internal-slot@1.0.5:
+ resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
engines: {node: '>= 0.4'}
dependencies:
- get-intrinsic: 1.2.0
- has: 1.0.3
+ get-intrinsic: 1.2.1
+ has: 1.0.4
side-channel: 1.0.4
dev: true
- /is-array-buffer@3.0.1:
- resolution: {integrity: sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==}
+ /ip@1.1.8:
+ resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==}
+ dev: true
+
+ /ip@2.0.0:
+ resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==}
+ dev: true
+
+ /is-array-buffer@3.0.2:
+ resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==}
dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.0
- is-typed-array: 1.1.10
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
+ is-typed-array: 1.1.12
dev: true
/is-arrayish@0.2.1:
@@ -3163,7 +3467,7 @@ packages:
resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: 1.0.5
has-tostringtag: 1.0.0
dev: true
@@ -3179,10 +3483,10 @@ packages:
engines: {node: '>= 0.4'}
dev: true
- /is-core-module@2.11.0:
- resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==}
+ /is-core-module@2.13.1:
+ resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==}
dependencies:
- has: 1.0.3
+ hasown: 2.0.0
dev: true
/is-date-object@1.0.5:
@@ -3210,16 +3514,23 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /is-fullwidth-code-point@2.0.0:
- resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==}
- engines: {node: '>=4'}
- dev: true
-
/is-fullwidth-code-point@3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
dev: true
+ /is-fullwidth-code-point@4.0.0:
+ resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==}
+ engines: {node: '>=12'}
+ dev: true
+
+ /is-fullwidth-code-point@5.0.0:
+ resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==}
+ engines: {node: '>=18'}
+ dependencies:
+ get-east-asian-width: 1.2.0
+ dev: true
+
/is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
@@ -3248,11 +3559,6 @@ packages:
engines: {node: '>=0.12.0'}
dev: true
- /is-obj@1.0.1:
- resolution: {integrity: sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==}
- engines: {node: '>=0.10.0'}
- dev: true
-
/is-obj@2.0.0:
resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
engines: {node: '>=8'}
@@ -3263,9 +3569,9 @@ packages:
engines: {node: '>=8'}
dev: true
- /is-plain-obj@1.1.0:
- resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==}
- engines: {node: '>=0.10.0'}
+ /is-port-reachable@4.0.0:
+ resolution: {integrity: sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: true
/is-potential-custom-element-name@1.0.1:
@@ -3279,31 +3585,21 @@ packages:
/is-reference@1.2.1:
resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
dependencies:
- '@types/estree': 1.0.0
+ '@types/estree': 1.0.3
dev: true
/is-regex@1.1.4:
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: 1.0.5
has-tostringtag: 1.0.0
dev: true
- /is-regexp@1.0.0:
- resolution: {integrity: sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==}
- engines: {node: '>=0.10.0'}
- dev: true
-
/is-shared-array-buffer@1.0.2:
resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
dependencies:
- call-bind: 1.0.2
- dev: true
-
- /is-stream@1.1.0:
- resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==}
- engines: {node: '>=0.10.0'}
+ call-bind: 1.0.5
dev: true
/is-stream@2.0.1:
@@ -3311,6 +3607,11 @@ packages:
engines: {node: '>=8'}
dev: true
+ /is-stream@3.0.0:
+ resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dev: true
+
/is-string@1.0.7:
resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
engines: {node: '>= 0.4'}
@@ -3325,33 +3626,24 @@ packages:
has-symbols: 1.0.3
dev: true
- /is-text-path@1.0.1:
- resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==}
- engines: {node: '>=0.10.0'}
+ /is-text-path@2.0.0:
+ resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==}
+ engines: {node: '>=8'}
dependencies:
- text-extensions: 1.9.0
+ text-extensions: 2.4.0
dev: true
- /is-typed-array@1.1.10:
- resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==}
+ /is-typed-array@1.1.12:
+ resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==}
engines: {node: '>= 0.4'}
dependencies:
- available-typed-arrays: 1.0.5
- call-bind: 1.0.2
- for-each: 0.3.3
- gopd: 1.0.1
- has-tostringtag: 1.0.0
- dev: true
-
- /is-unicode-supported@0.1.0:
- resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
- engines: {node: '>=10'}
+ which-typed-array: 1.1.13
dev: true
/is-weakref@1.0.2:
resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
dependencies:
- call-bind: 1.0.2
+ call-bind: 1.0.5
dev: true
/is-wsl@2.2.0:
@@ -3363,35 +3655,40 @@ packages:
/isarray@1.0.0:
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
+ dev: false
+
+ /isarray@2.0.5:
+ resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
+ dev: true
/isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
dev: true
- /istanbul-lib-coverage@3.2.0:
- resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==}
+ /istanbul-lib-coverage@3.2.2:
+ resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}
engines: {node: '>=8'}
dev: true
- /istanbul-lib-instrument@5.2.1:
- resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==}
- engines: {node: '>=8'}
+ /istanbul-lib-instrument@6.0.1:
+ resolution: {integrity: sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==}
+ engines: {node: '>=10'}
dependencies:
- '@babel/core': 7.21.3
- '@babel/parser': 7.21.3
+ '@babel/core': 7.23.5
+ '@babel/parser': 7.23.6
'@istanbuljs/schema': 0.1.3
- istanbul-lib-coverage: 3.2.0
- semver: 6.3.0
+ istanbul-lib-coverage: 3.2.2
+ semver: 7.5.4
transitivePeerDependencies:
- supports-color
dev: true
- /istanbul-lib-report@3.0.0:
- resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==}
- engines: {node: '>=8'}
+ /istanbul-lib-report@3.0.1:
+ resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==}
+ engines: {node: '>=10'}
dependencies:
- istanbul-lib-coverage: 3.2.0
- make-dir: 3.1.0
+ istanbul-lib-coverage: 3.2.2
+ make-dir: 4.0.0
supports-color: 7.2.0
dev: true
@@ -3400,32 +3697,27 @@ packages:
engines: {node: '>=10'}
dependencies:
debug: 4.3.4
- istanbul-lib-coverage: 3.2.0
+ istanbul-lib-coverage: 3.2.2
source-map: 0.6.1
transitivePeerDependencies:
- supports-color
dev: true
- /istanbul-reports@3.1.5:
- resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==}
+ /istanbul-reports@3.1.6:
+ resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==}
engines: {node: '>=8'}
dependencies:
html-escaper: 2.0.2
- istanbul-lib-report: 3.0.0
- dev: true
-
- /joycon@3.1.1:
- resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
- engines: {node: '>=10'}
- dev: true
-
- /js-sdsl@4.3.0:
- resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==}
+ istanbul-lib-report: 3.0.1
dev: true
- /js-string-escape@1.0.1:
- resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==}
- engines: {node: '>= 0.8'}
+ /jackspeak@2.3.6:
+ resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
+ engines: {node: '>=14'}
+ dependencies:
+ '@isaacs/cliui': 8.0.2
+ optionalDependencies:
+ '@pkgjs/parseargs': 0.11.0
dev: true
/js-stringify@1.0.2:
@@ -3434,6 +3726,7 @@ packages:
/js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+ requiresBuild: true
dev: true
/js-yaml@4.1.0:
@@ -3443,41 +3736,36 @@ packages:
argparse: 2.0.1
dev: true
- /jsdom@21.1.0:
- resolution: {integrity: sha512-m0lzlP7qOtthD918nenK3hdItSd2I+V3W9IrBcB36sqDwG+KnUs66IF5GY7laGWUnlM9vTsD0W1QwSEBYWWcJg==}
- engines: {node: '>=14'}
+ /jsdom@23.2.0:
+ resolution: {integrity: sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==}
+ engines: {node: '>=18'}
peerDependencies:
- canvas: ^2.5.0
+ canvas: ^2.11.2
peerDependenciesMeta:
canvas:
optional: true
dependencies:
- abab: 2.0.6
- acorn: 8.8.2
- acorn-globals: 7.0.1
- cssom: 0.5.0
- cssstyle: 2.3.0
- data-urls: 3.0.2
+ '@asamuzakjp/dom-selector': 2.0.1
+ cssstyle: 4.0.1
+ data-urls: 5.0.0
decimal.js: 10.4.3
- domexception: 4.0.0
- escodegen: 2.0.0
form-data: 4.0.0
- html-encoding-sniffer: 3.0.0
- http-proxy-agent: 5.0.0
- https-proxy-agent: 5.0.1
+ html-encoding-sniffer: 4.0.0
+ http-proxy-agent: 7.0.0
+ https-proxy-agent: 7.0.2
is-potential-custom-element-name: 1.0.1
- nwsapi: 2.2.2
parse5: 7.1.2
+ rrweb-cssom: 0.6.0
saxes: 6.0.0
symbol-tree: 3.2.4
- tough-cookie: 4.1.2
- w3c-xmlserializer: 4.0.0
+ tough-cookie: 4.1.3
+ w3c-xmlserializer: 5.0.0
webidl-conversions: 7.0.0
- whatwg-encoding: 2.0.0
- whatwg-mimetype: 3.0.0
- whatwg-url: 11.0.0
- ws: 8.12.0
- xml-name-validator: 4.0.0
+ whatwg-encoding: 3.1.1
+ whatwg-mimetype: 4.0.0
+ whatwg-url: 14.0.0
+ ws: 8.16.0
+ xml-name-validator: 5.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -3490,6 +3778,10 @@ packages:
hasBin: true
dev: true
+ /json-buffer@3.0.1:
+ resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
+ dev: true
+
/json-parse-better-errors@1.0.2:
resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
dev: true
@@ -3498,10 +3790,19 @@ packages:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
+ /json-parse-even-better-errors@3.0.0:
+ resolution: {integrity: sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==}
+ engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ dev: true
+
/json-schema-traverse@0.4.1:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
dev: true
+ /json-schema-traverse@1.0.0:
+ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+ dev: true
+
/json-stable-stringify-without-jsonify@1.0.1:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
dev: true
@@ -3520,13 +3821,19 @@ packages:
resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
dev: true
+ /jsonfile@4.0.0:
+ resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
+ optionalDependencies:
+ graceful-fs: 4.2.11
+ dev: true
+
/jsonparse@1.3.1:
resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==}
engines: {'0': node >= 0.2.0}
dev: true
/jstransformer@1.0.0:
- resolution: {integrity: sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM=}
+ resolution: {integrity: sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==}
dependencies:
is-promise: 2.2.2
promise: 7.3.1
@@ -3537,21 +3844,14 @@ packages:
dependencies:
lie: 3.3.0
pako: 1.0.11
- readable-stream: 2.3.7
+ readable-stream: 2.3.8
setimmediate: 1.0.5
dev: false
- /kind-of@6.0.3:
- resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- /levn@0.3.0:
- resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==}
- engines: {node: '>= 0.8.0'}
+ /keyv@4.5.4:
+ resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
dependencies:
- prelude-ls: 1.1.2
- type-check: 0.3.2
+ json-buffer: 3.0.1
dev: true
/levn@0.4.1:
@@ -3568,58 +3868,56 @@ packages:
immediate: 3.0.6
dev: false
+ /lilconfig@3.0.0:
+ resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==}
+ engines: {node: '>=14'}
+ dev: true
+
/lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
dev: true
- /lint-staged@10.5.4:
- resolution: {integrity: sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==}
+ /lines-and-columns@2.0.3:
+ resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dev: true
+
+ /lint-staged@15.2.0:
+ resolution: {integrity: sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==}
+ engines: {node: '>=18.12.0'}
hasBin: true
dependencies:
- chalk: 4.1.2
- cli-truncate: 2.1.0
- commander: 6.2.1
- cosmiconfig: 7.1.0
+ chalk: 5.3.0
+ commander: 11.1.0
debug: 4.3.4
- dedent: 0.7.0
- enquirer: 2.3.6
- execa: 4.1.0
- listr2: 3.14.0(enquirer@2.3.6)
- log-symbols: 4.1.0
+ execa: 8.0.1
+ lilconfig: 3.0.0
+ listr2: 8.0.0
micromatch: 4.0.5
- normalize-path: 3.0.0
- please-upgrade-node: 3.2.0
- string-argv: 0.3.1
- stringify-object: 3.3.0
+ pidtree: 0.6.0
+ string-argv: 0.3.2
+ yaml: 2.3.4
transitivePeerDependencies:
- supports-color
dev: true
- /listr2@3.14.0(enquirer@2.3.6):
- resolution: {integrity: sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==}
- engines: {node: '>=10.0.0'}
- peerDependencies:
- enquirer: '>= 2.3.0 < 3'
- peerDependenciesMeta:
- enquirer:
- optional: true
+ /listr2@8.0.0:
+ resolution: {integrity: sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==}
+ engines: {node: '>=18.0.0'}
dependencies:
- cli-truncate: 2.1.0
- colorette: 2.0.19
- enquirer: 2.3.6
- log-update: 4.0.0
- p-map: 4.0.0
+ cli-truncate: 4.0.0
+ colorette: 2.0.20
+ eventemitter3: 5.0.1
+ log-update: 6.0.0
rfdc: 1.3.0
- rxjs: 7.8.0
- through: 2.3.8
- wrap-ansi: 7.0.0
+ wrap-ansi: 9.0.0
dev: true
/load-json-file@4.0.0:
resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==}
engines: {node: '>=4'}
dependencies:
- graceful-fs: 4.2.10
+ graceful-fs: 4.2.11
parse-json: 4.0.0
pify: 3.0.0
strip-bom: 3.0.0
@@ -3630,24 +3928,12 @@ packages:
engines: {node: '>= 12.13.0'}
dev: true
- /local-pkg@0.4.3:
- resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
+ /local-pkg@0.5.0:
+ resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==}
engines: {node: '>=14'}
- dev: true
-
- /locate-path@2.0.0:
- resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==}
- engines: {node: '>=4'}
- dependencies:
- p-locate: 2.0.0
- path-exists: 3.0.0
- dev: true
-
- /locate-path@5.0.0:
- resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
- engines: {node: '>=8'}
dependencies:
- p-locate: 4.1.0
+ mlly: 1.4.2
+ pkg-types: 1.0.3
dev: true
/locate-path@6.0.0:
@@ -3657,12 +3943,15 @@ packages:
p-locate: 5.0.0
dev: true
- /lodash.camelcase@4.3.0:
- resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
+ /locate-path@7.2.0:
+ resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ p-locate: 6.0.0
dev: true
- /lodash.ismatch@4.4.0:
- resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==}
+ /lodash.camelcase@4.3.0:
+ resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
dev: true
/lodash.merge@4.6.2:
@@ -3673,35 +3962,26 @@ packages:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
dev: true
- /log-symbols@4.1.0:
- resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
- engines: {node: '>=10'}
- dependencies:
- chalk: 4.1.2
- is-unicode-supported: 0.1.0
- dev: true
-
- /log-update@4.0.0:
- resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==}
- engines: {node: '>=10'}
+ /log-update@6.0.0:
+ resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==}
+ engines: {node: '>=18'}
dependencies:
- ansi-escapes: 4.3.2
- cli-cursor: 3.1.0
- slice-ansi: 4.0.0
- wrap-ansi: 6.2.0
+ ansi-escapes: 6.2.0
+ cli-cursor: 4.0.0
+ slice-ansi: 7.1.0
+ strip-ansi: 7.1.0
+ wrap-ansi: 9.0.0
dev: true
- /loupe@2.3.6:
- resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
+ /loupe@2.3.7:
+ resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==}
dependencies:
- get-func-name: 2.0.0
+ get-func-name: 2.0.2
dev: true
- /lru-cache@4.1.5:
- resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
- dependencies:
- pseudomap: 1.0.2
- yallist: 2.1.2
+ /lru-cache@10.1.0:
+ resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==}
+ engines: {node: 14 || >=16.14}
dev: true
/lru-cache@5.1.1:
@@ -3717,47 +3997,44 @@ packages:
yallist: 4.0.0
dev: true
- /magic-string@0.27.0:
- resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
+ /lru-cache@7.18.3:
+ resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==}
engines: {node: '>=12'}
- dependencies:
- '@jridgewell/sourcemap-codec': 1.4.14
dev: true
- /magic-string@0.30.0:
- resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==}
+ /magic-string@0.30.5:
+ resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==}
engines: {node: '>=12'}
dependencies:
- '@jridgewell/sourcemap-codec': 1.4.14
+ '@jridgewell/sourcemap-codec': 1.4.15
- /make-dir@3.1.0:
- resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
- engines: {node: '>=8'}
+ /magicast@0.3.2:
+ resolution: {integrity: sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==}
dependencies:
- semver: 6.3.0
+ '@babel/parser': 7.23.6
+ '@babel/types': 7.23.6
+ source-map-js: 1.0.2
dev: true
- /map-obj@1.0.1:
- resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==}
- engines: {node: '>=0.10.0'}
+ /make-dir@4.0.0:
+ resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
+ engines: {node: '>=10'}
+ dependencies:
+ semver: 7.5.4
dev: true
- /map-obj@4.3.0:
- resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==}
- engines: {node: '>=8'}
+ /markdown-table@3.0.3:
+ resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==}
dev: true
- /marked@4.2.12:
- resolution: {integrity: sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==}
- engines: {node: '>= 12'}
+ /marked@11.1.1:
+ resolution: {integrity: sha512-EgxRjgK9axsQuUa/oKMx5DEY8oXpKJfk61rT5iY3aRlgU6QJtUcxU5OAymdhCvWvhYcd9FKmO5eQoX8m9VGJXg==}
+ engines: {node: '>= 18'}
hasBin: true
dev: true
- /md5-hex@3.0.1:
- resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==}
- engines: {node: '>=8'}
- dependencies:
- blueimp-md5: 2.19.0
+ /mdn-data@2.0.30:
+ resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
dev: true
/memorystream@0.3.1:
@@ -3765,21 +4042,9 @@ packages:
engines: {node: '>= 0.10.0'}
dev: true
- /meow@8.1.2:
- resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==}
- engines: {node: '>=10'}
- dependencies:
- '@types/minimist': 1.2.2
- camelcase-keys: 6.2.2
- decamelize-keys: 1.1.1
- hard-rejection: 2.1.0
- minimist-options: 4.1.0
- normalize-package-data: 3.0.3
- read-pkg-up: 7.0.1
- redent: 3.0.0
- trim-newlines: 3.0.1
- type-fest: 0.18.1
- yargs-parser: 20.2.9
+ /meow@12.1.1:
+ resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==}
+ engines: {node: '>=16.10'}
dev: true
/merge-source-map@1.1.0:
@@ -3834,15 +4099,9 @@ packages:
engines: {node: '>=6'}
dev: true
- /min-indent@1.0.1:
- resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
- engines: {node: '>=4'}
- dev: true
-
- /minimatch@3.0.4:
- resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==}
- dependencies:
- brace-expansion: 1.1.11
+ /mimic-fn@4.0.0:
+ resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==}
+ engines: {node: '>=12'}
dev: true
/minimatch@3.1.2:
@@ -3858,46 +4117,41 @@ packages:
brace-expansion: 2.0.1
dev: true
- /minimatch@9.0.0:
- resolution: {integrity: sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==}
+ /minimatch@9.0.3:
+ resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
engines: {node: '>=16 || 14 >=14.17'}
dependencies:
brace-expansion: 2.0.1
dev: true
- /minimist-options@4.1.0:
- resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==}
- engines: {node: '>= 6'}
- dependencies:
- arrify: 1.0.1
- is-plain-obj: 1.1.0
- kind-of: 6.0.3
+ /minimist@1.2.8:
+ resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
dev: true
- /minimist@1.2.7:
- resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==}
+ /minipass@7.0.4:
+ resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ dev: true
+
+ /mitt@3.0.1:
+ resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==}
dev: true
/mkdirp-classic@0.5.3:
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
dev: true
- /mlly@1.2.0:
- resolution: {integrity: sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==}
+ /mlly@1.4.2:
+ resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==}
dependencies:
- acorn: 8.8.2
- pathe: 1.1.0
- pkg-types: 1.0.2
- ufo: 1.1.1
- dev: true
-
- /modify-values@1.0.1:
- resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==}
- engines: {node: '>=0.10.0'}
+ acorn: 8.10.0
+ pathe: 1.1.1
+ pkg-types: 1.0.3
+ ufo: 1.3.1
dev: true
- /monaco-editor@0.20.0:
- resolution: {integrity: sha512-hkvf4EtPJRMQlPC3UbMoRs0vTAFAYdzFQ+gpMb8A+9znae1c43q8Mab9iVsgTcg/4PNiLGGn3SlDIa8uvK1FIQ==}
+ /monaco-editor@0.45.0:
+ resolution: {integrity: sha512-mjv1G1ZzfEE3k9HZN0dQ2olMdwIfaeAAjFiwNprLfYNRSz7ctv9XuCT7gPtBGrMUeV1/iZzYKj17Khu1hxoHOA==}
dev: false
/ms@2.0.0:
@@ -3908,8 +4162,8 @@ packages:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: true
- /nanoid@3.3.4:
- resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==}
+ /nanoid@3.3.7:
+ resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
@@ -3926,12 +4180,17 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
dev: true
+ /netmask@2.0.2:
+ resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==}
+ engines: {node: '>= 0.4.0'}
+ dev: true
+
/nice-try@1.0.5:
resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==}
dev: true
- /node-fetch@2.6.7:
- resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
+ /node-fetch@2.7.0:
+ resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
@@ -3942,26 +4201,31 @@ packages:
whatwg-url: 5.0.0
dev: true
- /node-releases@2.0.10:
- resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==}
+ /node-gyp-build@4.7.1:
+ resolution: {integrity: sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==}
+ hasBin: true
+ dev: true
+
+ /node-releases@2.0.13:
+ resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
dev: true
/normalize-package-data@2.5.0:
resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
dependencies:
hosted-git-info: 2.8.9
- resolve: 1.22.1
- semver: 5.7.1
+ resolve: 1.22.8
+ semver: 5.7.2
validate-npm-package-license: 3.0.4
dev: true
- /normalize-package-data@3.0.3:
- resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==}
- engines: {node: '>=10'}
+ /normalize-package-data@6.0.0:
+ resolution: {integrity: sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==}
+ engines: {node: ^16.14.0 || >=18.0.0}
dependencies:
- hosted-git-info: 4.1.0
- is-core-module: 2.11.0
- semver: 7.3.8
+ hosted-git-info: 7.0.1
+ is-core-module: 2.13.1
+ semver: 7.5.4
validate-npm-package-license: 3.0.4
dev: true
@@ -3982,15 +4246,8 @@ packages:
minimatch: 3.1.2
pidtree: 0.3.1
read-pkg: 3.0.0
- shell-quote: 1.8.0
- string.prototype.padend: 3.1.4
- dev: true
-
- /npm-run-path@2.0.2:
- resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==}
- engines: {node: '>=4'}
- dependencies:
- path-key: 2.0.1
+ shell-quote: 1.8.1
+ string.prototype.padend: 3.1.5
dev: true
/npm-run-path@4.0.1:
@@ -4000,8 +4257,11 @@ packages:
path-key: 3.1.1
dev: true
- /nwsapi@2.2.2:
- resolution: {integrity: sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==}
+ /npm-run-path@5.1.0:
+ resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ path-key: 4.0.0
dev: true
/object-assign@4.1.1:
@@ -4009,8 +4269,8 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /object-inspect@1.12.3:
- resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==}
+ /object-inspect@1.13.1:
+ resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==}
dev: true
/object-keys@1.1.1:
@@ -4022,8 +4282,8 @@ packages:
resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
+ call-bind: 1.0.5
+ define-properties: 1.2.1
has-symbols: 1.0.3
object-keys: 1.1.1
dev: true
@@ -4046,47 +4306,23 @@ packages:
mimic-fn: 2.1.0
dev: true
- /optionator@0.8.3:
- resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
- engines: {node: '>= 0.8.0'}
+ /onetime@6.0.0:
+ resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==}
+ engines: {node: '>=12'}
dependencies:
- deep-is: 0.1.4
- fast-levenshtein: 2.0.6
- levn: 0.3.0
- prelude-ls: 1.1.2
- type-check: 0.3.2
- word-wrap: 1.2.3
+ mimic-fn: 4.0.0
dev: true
- /optionator@0.9.1:
- resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}
+ /optionator@0.9.3:
+ resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
engines: {node: '>= 0.8.0'}
dependencies:
+ '@aashutoshrathi/word-wrap': 1.2.6
deep-is: 0.1.4
fast-levenshtein: 2.0.6
levn: 0.4.1
prelude-ls: 1.2.1
type-check: 0.4.0
- word-wrap: 1.2.3
- dev: true
-
- /p-finally@1.0.0:
- resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
- engines: {node: '>=4'}
- dev: true
-
- /p-limit@1.3.0:
- resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==}
- engines: {node: '>=4'}
- dependencies:
- p-try: 1.0.0
- dev: true
-
- /p-limit@2.3.0:
- resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
- engines: {node: '>=6'}
- dependencies:
- p-try: 2.2.0
dev: true
/p-limit@3.1.0:
@@ -4103,18 +4339,11 @@ packages:
yocto-queue: 1.0.0
dev: true
- /p-locate@2.0.0:
- resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==}
- engines: {node: '>=4'}
- dependencies:
- p-limit: 1.3.0
- dev: true
-
- /p-locate@4.1.0:
- resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
- engines: {node: '>=8'}
+ /p-limit@5.0.0:
+ resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==}
+ engines: {node: '>=18'}
dependencies:
- p-limit: 2.3.0
+ yocto-queue: 1.0.0
dev: true
/p-locate@5.0.0:
@@ -4124,21 +4353,36 @@ packages:
p-limit: 3.1.0
dev: true
- /p-map@4.0.0:
- resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
- engines: {node: '>=10'}
+ /p-locate@6.0.0:
+ resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
- aggregate-error: 3.1.0
+ p-limit: 4.0.0
dev: true
- /p-try@1.0.0:
- resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==}
- engines: {node: '>=4'}
+ /pac-proxy-agent@7.0.1:
+ resolution: {integrity: sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==}
+ engines: {node: '>= 14'}
+ dependencies:
+ '@tootallnate/quickjs-emscripten': 0.23.0
+ agent-base: 7.1.0
+ debug: 4.3.4
+ get-uri: 6.0.2
+ http-proxy-agent: 7.0.0
+ https-proxy-agent: 7.0.2
+ pac-resolver: 7.0.0
+ socks-proxy-agent: 8.0.2
+ transitivePeerDependencies:
+ - supports-color
dev: true
- /p-try@2.2.0:
- resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
- engines: {node: '>=6'}
+ /pac-resolver@7.0.0:
+ resolution: {integrity: sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==}
+ engines: {node: '>= 14'}
+ dependencies:
+ degenerator: 5.0.1
+ ip: 1.1.8
+ netmask: 2.0.2
dev: true
/pako@1.0.11:
@@ -4164,21 +4408,27 @@ packages:
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
engines: {node: '>=8'}
dependencies:
- '@babel/code-frame': 7.18.6
+ '@babel/code-frame': 7.23.5
error-ex: 1.3.2
json-parse-even-better-errors: 2.3.1
lines-and-columns: 1.2.4
dev: true
- /parse5@7.1.2:
- resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
+ /parse-json@7.1.0:
+ resolution: {integrity: sha512-ihtdrgbqdONYD156Ap6qTcaGcGdkdAxodO1wLqQ/j7HP1u2sFYppINiq4jyC8F+Nm+4fVufylCV00QmkTHkSUg==}
+ engines: {node: '>=16'}
dependencies:
- entities: 4.4.0
+ '@babel/code-frame': 7.23.5
+ error-ex: 1.3.2
+ json-parse-even-better-errors: 3.0.0
+ lines-and-columns: 2.0.3
+ type-fest: 3.13.1
dev: true
- /path-exists@3.0.0:
- resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==}
- engines: {node: '>=4'}
+ /parse5@7.1.2:
+ resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
+ dependencies:
+ entities: 4.5.0
dev: true
/path-exists@4.0.0:
@@ -4186,6 +4436,11 @@ packages:
engines: {node: '>=8'}
dev: true
+ /path-exists@5.0.0:
+ resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dev: true
+
/path-is-absolute@1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
@@ -4205,10 +4460,23 @@ packages:
engines: {node: '>=8'}
dev: true
+ /path-key@4.0.0:
+ resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}
+ engines: {node: '>=12'}
+ dev: true
+
/path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
dev: true
+ /path-scurry@1.10.1:
+ resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ dependencies:
+ lru-cache: 10.1.0
+ minipass: 7.0.4
+ dev: true
+
/path-to-regexp@2.2.1:
resolution: {integrity: sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==}
dev: true
@@ -4225,8 +4493,8 @@ packages:
engines: {node: '>=8'}
dev: true
- /pathe@1.1.0:
- resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==}
+ /pathe@1.1.1:
+ resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==}
dev: true
/pathval@1.1.1:
@@ -4251,9 +4519,10 @@ packages:
hasBin: true
dev: true
- /pify@2.3.0:
- resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
- engines: {node: '>=0.10.0'}
+ /pidtree@0.6.0:
+ resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
+ engines: {node: '>=0.10'}
+ hasBin: true
dev: true
/pify@3.0.0:
@@ -4261,79 +4530,73 @@ packages:
engines: {node: '>=4'}
dev: true
- /pkg-types@1.0.2:
- resolution: {integrity: sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ==}
+ /pkg-types@1.0.3:
+ resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==}
dependencies:
jsonc-parser: 3.2.0
- mlly: 1.2.0
- pathe: 1.1.0
- dev: true
-
- /please-upgrade-node@3.2.0:
- resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==}
- dependencies:
- semver-compare: 1.0.0
+ mlly: 1.4.2
+ pathe: 1.1.1
dev: true
- /postcss-modules-extract-imports@3.0.0(postcss@8.4.21):
+ /postcss-modules-extract-imports@3.0.0(postcss@8.4.33):
resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==}
engines: {node: ^10 || ^12 || >= 14}
peerDependencies:
postcss: ^8.1.0
dependencies:
- postcss: 8.4.21
+ postcss: 8.4.33
dev: true
- /postcss-modules-local-by-default@4.0.0(postcss@8.4.21):
- resolution: {integrity: sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==}
+ /postcss-modules-local-by-default@4.0.3(postcss@8.4.33):
+ resolution: {integrity: sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==}
engines: {node: ^10 || ^12 || >= 14}
peerDependencies:
postcss: ^8.1.0
dependencies:
- icss-utils: 5.1.0(postcss@8.4.21)
- postcss: 8.4.21
- postcss-selector-parser: 6.0.11
+ icss-utils: 5.1.0(postcss@8.4.33)
+ postcss: 8.4.33
+ postcss-selector-parser: 6.0.15
postcss-value-parser: 4.2.0
dev: true
- /postcss-modules-scope@3.0.0(postcss@8.4.21):
+ /postcss-modules-scope@3.0.0(postcss@8.4.33):
resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==}
engines: {node: ^10 || ^12 || >= 14}
peerDependencies:
postcss: ^8.1.0
dependencies:
- postcss: 8.4.21
- postcss-selector-parser: 6.0.11
+ postcss: 8.4.33
+ postcss-selector-parser: 6.0.15
dev: true
- /postcss-modules-values@4.0.0(postcss@8.4.21):
+ /postcss-modules-values@4.0.0(postcss@8.4.33):
resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==}
engines: {node: ^10 || ^12 || >= 14}
peerDependencies:
postcss: ^8.1.0
dependencies:
- icss-utils: 5.1.0(postcss@8.4.21)
- postcss: 8.4.21
+ icss-utils: 5.1.0(postcss@8.4.33)
+ postcss: 8.4.33
dev: true
- /postcss-modules@4.3.1(postcss@8.4.21):
- resolution: {integrity: sha512-ItUhSUxBBdNamkT3KzIZwYNNRFKmkJrofvC2nWab3CPKhYBQ1f27XXh1PAPE27Psx58jeelPsxWB/+og+KEH0Q==}
+ /postcss-modules@6.0.0(postcss@8.4.33):
+ resolution: {integrity: sha512-7DGfnlyi/ju82BRzTIjWS5C4Tafmzl3R79YP/PASiocj+aa6yYphHhhKUOEoXQToId5rgyFgJ88+ccOUydjBXQ==}
peerDependencies:
postcss: ^8.0.0
dependencies:
generic-names: 4.0.0
- icss-replace-symbols: 1.1.0
+ icss-utils: 5.1.0(postcss@8.4.33)
lodash.camelcase: 4.3.0
- postcss: 8.4.21
- postcss-modules-extract-imports: 3.0.0(postcss@8.4.21)
- postcss-modules-local-by-default: 4.0.0(postcss@8.4.21)
- postcss-modules-scope: 3.0.0(postcss@8.4.21)
- postcss-modules-values: 4.0.0(postcss@8.4.21)
+ postcss: 8.4.33
+ postcss-modules-extract-imports: 3.0.0(postcss@8.4.33)
+ postcss-modules-local-by-default: 4.0.3(postcss@8.4.33)
+ postcss-modules-scope: 3.0.0(postcss@8.4.33)
+ postcss-modules-values: 4.0.0(postcss@8.4.33)
string-hash: 1.1.3
dev: true
- /postcss-selector-parser@6.0.11:
- resolution: {integrity: sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==}
+ /postcss-selector-parser@6.0.15:
+ resolution: {integrity: sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==}
engines: {node: '>=4'}
dependencies:
cssesc: 3.0.0
@@ -4344,41 +4607,42 @@ packages:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
dev: true
- /postcss@8.4.21:
- resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==}
+ /postcss@8.4.33:
+ resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
- nanoid: 3.3.4
+ nanoid: 3.3.7
picocolors: 1.0.0
source-map-js: 1.0.2
- /prelude-ls@1.1.2:
- resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
- engines: {node: '>= 0.8.0'}
- dev: true
-
/prelude-ls@1.2.1:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
dev: true
- /prettier@2.8.3:
- resolution: {integrity: sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==}
- engines: {node: '>=10.13.0'}
+ /prettier@3.2.2:
+ resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==}
+ engines: {node: '>=14'}
hasBin: true
dev: true
- /pretty-format@27.5.1:
- resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
- engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ /pretty-bytes@6.1.1:
+ resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==}
+ engines: {node: ^14.13.1 || >=16.0.0}
+ dev: true
+
+ /pretty-format@29.7.0:
+ resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dependencies:
- ansi-regex: 5.0.1
+ '@jest/schemas': 29.6.3
ansi-styles: 5.2.0
- react-is: 17.0.2
+ react-is: 18.2.0
dev: true
/process-nextick-args@2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
+ dev: false
/progress@2.0.3:
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
@@ -4388,17 +4652,29 @@ packages:
/promise@7.3.1:
resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==}
dependencies:
- asap: 2.0.6
+ asap: 2.0.6
+ dev: true
+
+ /proxy-agent@6.3.1:
+ resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==}
+ engines: {node: '>= 14'}
+ dependencies:
+ agent-base: 7.1.0
+ debug: 4.3.4
+ http-proxy-agent: 7.0.0
+ https-proxy-agent: 7.0.2
+ lru-cache: 7.18.3
+ pac-proxy-agent: 7.0.1
+ proxy-from-env: 1.1.0
+ socks-proxy-agent: 8.0.2
+ transitivePeerDependencies:
+ - supports-color
dev: true
/proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: true
- /pseudomap@1.0.2:
- resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
- dev: true
-
/psl@1.9.0:
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
dev: true
@@ -4435,7 +4711,7 @@ packages:
jstransformer: 1.0.0
pug-error: 2.0.0
pug-walk: 2.0.0
- resolve: 1.22.1
+ resolve: 1.22.8
dev: true
/pug-lexer@5.0.1:
@@ -4505,25 +4781,21 @@ packages:
resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==}
dev: true
- /punycode@2.3.0:
- resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
+ /punycode@2.3.1:
+ resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
dev: true
- /puppeteer-core@19.6.3:
- resolution: {integrity: sha512-8MbhioSlkDaHkmolpQf9Z7ui7jplFfOFTnN8d5kPsCazRRTNIH6/bVxPskn0v5Gh9oqOBlknw0eHH0/OBQAxpQ==}
- engines: {node: '>=14.1.0'}
+ /puppeteer-core@21.7.0:
+ resolution: {integrity: sha512-elPYPozrgiM3phSy7VDUJCVWQ07SPnOm78fpSaaSNFoQx5sur/MqhTSro9Wz8lOEjqCykGC6WRkwxDgmqcy1dQ==}
+ engines: {node: '>=16.13.2'}
dependencies:
- cross-fetch: 3.1.5
+ '@puppeteer/browsers': 1.9.1
+ chromium-bidi: 0.5.2(devtools-protocol@0.0.1203626)
+ cross-fetch: 4.0.0
debug: 4.3.4
- devtools-protocol: 0.0.1082910
- extract-zip: 2.0.1
- https-proxy-agent: 5.0.1
- proxy-from-env: 1.1.0
- rimraf: 3.0.2
- tar-fs: 2.1.1
- unbzip2-stream: 1.4.3
- ws: 8.11.0
+ devtools-protocol: 0.0.1203626
+ ws: 8.16.0
transitivePeerDependencies:
- bufferutil
- encoding
@@ -4531,28 +4803,23 @@ packages:
- utf-8-validate
dev: true
- /puppeteer@19.6.3:
- resolution: {integrity: sha512-K03xTtGDwS6cBXX/EoqoZxglCUKcX2SLIl92fMnGMRjYpPGXoAV2yKEh3QXmXzKqfZXd8TxjjFww+tEttWv8kw==}
- engines: {node: '>=14.1.0'}
+ /puppeteer@21.7.0(typescript@5.2.2):
+ resolution: {integrity: sha512-Yy+UUy0b9siJezbhHO/heYUoZQUwyqDK1yOQgblTt0l97tspvDVFkcW9toBlnSvSfkDmMI3Dx9cZL6R8bDArHA==}
+ engines: {node: '>=16.13.2'}
+ hasBin: true
requiresBuild: true
dependencies:
- cosmiconfig: 8.0.0
- https-proxy-agent: 5.0.1
- progress: 2.0.3
- proxy-from-env: 1.1.0
- puppeteer-core: 19.6.3
+ '@puppeteer/browsers': 1.9.1
+ cosmiconfig: 8.3.6(typescript@5.2.2)
+ puppeteer-core: 21.7.0
transitivePeerDependencies:
- bufferutil
- encoding
- supports-color
+ - typescript
- utf-8-validate
dev: true
- /q@1.5.1:
- resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==}
- engines: {node: '>=0.6.0', teleport: '>=0.2.0'}
- dev: true
-
/querystringify@2.2.0:
resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
dev: true
@@ -4561,9 +4828,8 @@ packages:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
dev: true
- /quick-lru@4.0.1:
- resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==}
- engines: {node: '>=8'}
+ /queue-tick@1.0.1:
+ resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==}
dev: true
/randombytes@2.1.0:
@@ -4583,29 +4849,21 @@ packages:
dependencies:
deep-extend: 0.6.0
ini: 1.3.8
- minimist: 1.2.7
+ minimist: 1.2.8
strip-json-comments: 2.0.1
dev: true
- /react-is@17.0.2:
- resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
- dev: true
-
- /read-pkg-up@3.0.0:
- resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==}
- engines: {node: '>=4'}
- dependencies:
- find-up: 2.1.0
- read-pkg: 3.0.0
+ /react-is@18.2.0:
+ resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
dev: true
- /read-pkg-up@7.0.1:
- resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==}
- engines: {node: '>=8'}
+ /read-pkg-up@10.1.0:
+ resolution: {integrity: sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==}
+ engines: {node: '>=16'}
dependencies:
- find-up: 4.1.0
- read-pkg: 5.2.0
- type-fest: 0.8.1
+ find-up: 6.3.0
+ read-pkg: 8.1.0
+ type-fest: 4.5.0
dev: true
/read-pkg@3.0.0:
@@ -4617,18 +4875,18 @@ packages:
path-type: 3.0.0
dev: true
- /read-pkg@5.2.0:
- resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}
- engines: {node: '>=8'}
+ /read-pkg@8.1.0:
+ resolution: {integrity: sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==}
+ engines: {node: '>=16'}
dependencies:
- '@types/normalize-package-data': 2.4.1
- normalize-package-data: 2.5.0
- parse-json: 5.2.0
- type-fest: 0.6.0
+ '@types/normalize-package-data': 2.4.3
+ normalize-package-data: 6.0.0
+ parse-json: 7.1.0
+ type-fest: 4.5.0
dev: true
- /readable-stream@2.3.7:
- resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==}
+ /readable-stream@2.3.8:
+ resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
dependencies:
core-util-is: 1.0.3
inherits: 2.0.4
@@ -4637,15 +4895,7 @@ packages:
safe-buffer: 5.1.2
string_decoder: 1.1.1
util-deprecate: 1.0.2
-
- /readable-stream@3.6.0:
- resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==}
- engines: {node: '>= 6'}
- dependencies:
- inherits: 2.0.4
- string_decoder: 1.3.0
- util-deprecate: 1.0.2
- dev: true
+ dev: false
/readdirp@3.6.0:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
@@ -4654,26 +4904,13 @@ packages:
picomatch: 2.3.1
dev: true
- /redent@3.0.0:
- resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
- engines: {node: '>=8'}
- dependencies:
- indent-string: 4.0.0
- strip-indent: 3.0.0
- dev: true
-
- /regexp.prototype.flags@1.4.3:
- resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==}
+ /regexp.prototype.flags@1.5.1:
+ resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
- functions-have-names: 1.2.3
- dev: true
-
- /regexpp@3.2.0:
- resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==}
- engines: {node: '>=8'}
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ set-function-name: 2.0.1
dev: true
/registry-auth-token@3.3.2:
@@ -4695,6 +4932,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
+ /require-from-string@2.0.2:
+ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
/requires-port@1.0.0:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
dev: true
@@ -4704,18 +4946,22 @@ packages:
engines: {node: '>=4'}
dev: true
- /resolve@1.22.1:
- resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
+ /resolve-pkg-maps@1.0.0:
+ resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
+ dev: true
+
+ /resolve@1.22.8:
+ resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
hasBin: true
dependencies:
- is-core-module: 2.11.0
+ is-core-module: 2.13.1
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
dev: true
- /restore-cursor@3.1.0:
- resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
- engines: {node: '>=8'}
+ /restore-cursor@4.0.0:
+ resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
onetime: 5.1.2
signal-exit: 3.0.7
@@ -4737,53 +4983,76 @@ packages:
glob: 7.2.3
dev: true
- /rollup-plugin-dts@5.3.0(rollup@3.20.2)(typescript@5.0.2):
- resolution: {integrity: sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==}
- engines: {node: '>=v14'}
+ /rimraf@5.0.5:
+ resolution: {integrity: sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==}
+ engines: {node: '>=14'}
+ hasBin: true
+ dependencies:
+ glob: 10.3.10
+ dev: true
+
+ /rollup-plugin-dts@6.1.0(rollup@4.4.1)(typescript@5.2.2):
+ resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==}
+ engines: {node: '>=16'}
peerDependencies:
- rollup: ^3.0.0
- typescript: ^4.1 || ^5.0
+ rollup: ^3.29.4 || ^4
+ typescript: ^4.5 || ^5.0
dependencies:
- magic-string: 0.30.0
- rollup: 3.20.2
- typescript: 5.0.2
+ magic-string: 0.30.5
+ rollup: 4.4.1
+ typescript: 5.2.2
optionalDependencies:
- '@babel/code-frame': 7.18.6
+ '@babel/code-frame': 7.23.5
dev: true
- /rollup-plugin-esbuild@5.0.0(esbuild@0.17.5)(rollup@3.20.2):
- resolution: {integrity: sha512-1cRIOHAPh8WQgdQQyyvFdeOdxuiyk+zB5zJ5+YOwrZP4cJ0MT3Fs48pQxrZeyZHcn+klFherytILVfE4aYrneg==}
- engines: {node: '>=14.18.0', npm: '>=8.0.0'}
+ /rollup-plugin-esbuild@6.1.0(esbuild@0.19.10)(rollup@4.4.1):
+ resolution: {integrity: sha512-HPpXU65V8bSpW8eSYPahtUJaJHmbxJGybuf/M8B3bz/6i11YaYHlNNJIQ38gSEV0FyohQOgVxJ2YMEEZtEmwvA==}
+ engines: {node: '>=14.18.0'}
peerDependencies:
- esbuild: '>=0.10.1'
- rollup: ^1.20.0 || ^2.0.0 || ^3.0.0
+ esbuild: '>=0.18.0'
+ rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0
dependencies:
- '@rollup/pluginutils': 5.0.2(rollup@3.20.2)
+ '@rollup/pluginutils': 5.0.5(rollup@4.4.1)
debug: 4.3.4
- es-module-lexer: 1.1.0
- esbuild: 0.17.5
- joycon: 3.1.1
- jsonc-parser: 3.2.0
- rollup: 3.20.2
+ es-module-lexer: 1.3.1
+ esbuild: 0.19.10
+ get-tsconfig: 4.7.2
+ rollup: 4.4.1
transitivePeerDependencies:
- supports-color
dev: true
- /rollup-plugin-polyfill-node@0.12.0(rollup@3.20.2):
+ /rollup-plugin-polyfill-node@0.12.0(rollup@4.4.1):
resolution: {integrity: sha512-PWEVfDxLEKt8JX1nZ0NkUAgXpkZMTb85rO/Ru9AQ69wYW8VUCfDgP4CGRXXWYni5wDF0vIeR1UoF3Jmw/Lt3Ug==}
peerDependencies:
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0
dependencies:
- '@rollup/plugin-inject': 5.0.3(rollup@3.20.2)
- rollup: 3.20.2
+ '@rollup/plugin-inject': 5.0.5(rollup@4.4.1)
+ rollup: 4.4.1
dev: true
- /rollup@3.20.2:
- resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==}
- engines: {node: '>=14.18.0', npm: '>=8.0.0'}
+ /rollup@4.4.1:
+ resolution: {integrity: sha512-idZzrUpWSblPJX66i+GzrpjKE3vbYrlWirUHteoAbjKReZwa0cohAErOYA5efoMmNCdvG9yrJS+w9Kl6csaH4w==}
+ engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
- fsevents: 2.3.2
+ '@rollup/rollup-android-arm-eabi': 4.4.1
+ '@rollup/rollup-android-arm64': 4.4.1
+ '@rollup/rollup-darwin-arm64': 4.4.1
+ '@rollup/rollup-darwin-x64': 4.4.1
+ '@rollup/rollup-linux-arm-gnueabihf': 4.4.1
+ '@rollup/rollup-linux-arm64-gnu': 4.4.1
+ '@rollup/rollup-linux-arm64-musl': 4.4.1
+ '@rollup/rollup-linux-x64-gnu': 4.4.1
+ '@rollup/rollup-linux-x64-musl': 4.4.1
+ '@rollup/rollup-win32-arm64-msvc': 4.4.1
+ '@rollup/rollup-win32-ia32-msvc': 4.4.1
+ '@rollup/rollup-win32-x64-msvc': 4.4.1
+ fsevents: 2.3.3
+ dev: true
+
+ /rrweb-cssom@0.6.0:
+ resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
dev: true
/run-parallel@1.2.0:
@@ -4792,10 +5061,14 @@ packages:
queue-microtask: 1.2.3
dev: true
- /rxjs@7.8.0:
- resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==}
+ /safe-array-concat@1.0.1:
+ resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==}
+ engines: {node: '>=0.4'}
dependencies:
- tslib: 2.5.0
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
+ has-symbols: 1.0.3
+ isarray: 2.0.5
dev: true
/safe-buffer@5.1.2:
@@ -4808,8 +5081,8 @@ packages:
/safe-regex-test@1.0.0:
resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.0
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
is-regex: 1.1.4
dev: true
@@ -4817,13 +5090,13 @@ packages:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
dev: true
- /sass@1.58.0:
- resolution: {integrity: sha512-PiMJcP33DdKtZ/1jSjjqVIKihoDc6yWmYr9K/4r3fVVIEDAluD0q7XZiRKrNJcPK3qkLRF/79DND1H5q1LBjgg==}
- engines: {node: '>=12.0.0'}
+ /sass@1.69.7:
+ resolution: {integrity: sha512-rzj2soDeZ8wtE2egyLXgOOHQvaC2iosZrkF6v3EUG+tBwEvhqUCzm0VP3k9gHF9LXbSrRhT5SksoI56Iw8NPnQ==}
+ engines: {node: '>=14.0.0'}
hasBin: true
dependencies:
chokidar: 3.5.3
- immutable: 4.2.3
+ immutable: 4.3.4
source-map-js: 1.0.2
dev: true
@@ -4834,22 +5107,18 @@ packages:
xmlchars: 2.2.0
dev: true
- /semver-compare@1.0.0:
- resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}
- dev: true
-
- /semver@5.7.1:
- resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
+ /semver@5.7.2:
+ resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
hasBin: true
dev: true
- /semver@6.3.0:
- resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==}
+ /semver@6.3.1:
+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
hasBin: true
dev: true
- /semver@7.3.8:
- resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
+ /semver@7.5.4:
+ resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
engines: {node: '>=10'}
hasBin: true
dependencies:
@@ -4862,36 +5131,58 @@ packages:
randombytes: 2.1.0
dev: true
- /serve-handler@6.1.3:
- resolution: {integrity: sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==}
+ /serve-handler@6.1.5:
+ resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==}
dependencies:
bytes: 3.0.0
content-disposition: 0.5.2
fast-url-parser: 1.1.3
mime-types: 2.1.18
- minimatch: 3.0.4
+ minimatch: 3.1.2
path-is-inside: 1.0.2
path-to-regexp: 2.2.1
range-parser: 1.2.0
dev: true
- /serve@12.0.1:
- resolution: {integrity: sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==}
+ /serve@14.2.1:
+ resolution: {integrity: sha512-48er5fzHh7GCShLnNyPBRPEjs2I6QBozeGr02gaacROiyS/8ARADlj595j39iZXAqBbJHH/ivJJyPRWY9sQWZA==}
+ engines: {node: '>= 14'}
hasBin: true
dependencies:
- '@zeit/schemas': 2.6.0
- ajv: 6.12.6
- arg: 2.0.0
- boxen: 1.3.0
- chalk: 2.4.1
- clipboardy: 2.3.0
- compression: 1.7.3
- serve-handler: 6.1.3
- update-check: 1.5.2
+ '@zeit/schemas': 2.29.0
+ ajv: 8.11.0
+ arg: 5.0.2
+ boxen: 7.0.0
+ chalk: 5.0.1
+ chalk-template: 0.4.0
+ clipboardy: 3.0.0
+ compression: 1.7.4
+ is-port-reachable: 4.0.0
+ serve-handler: 6.1.5
+ update-check: 1.5.4
transitivePeerDependencies:
- supports-color
dev: true
+ /set-function-length@1.1.1:
+ resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ define-data-property: 1.1.1
+ get-intrinsic: 1.2.1
+ gopd: 1.0.1
+ has-property-descriptors: 1.0.0
+ dev: true
+
+ /set-function-name@2.0.1:
+ resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ define-data-property: 1.1.1
+ functions-have-names: 1.2.3
+ has-property-descriptors: 1.0.0
+ dev: true
+
/setimmediate@1.0.5:
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
dev: false
@@ -4920,16 +5211,16 @@ packages:
engines: {node: '>=8'}
dev: true
- /shell-quote@1.8.0:
- resolution: {integrity: sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ==}
+ /shell-quote@1.8.1:
+ resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
dev: true
/side-channel@1.0.4:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.0
- object-inspect: 1.12.3
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
+ object-inspect: 1.13.1
dev: true
/siginfo@2.0.0:
@@ -4940,8 +5231,13 @@ packages:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
dev: true
- /simple-git-hooks@2.8.1:
- resolution: {integrity: sha512-DYpcVR1AGtSfFUNzlBdHrQGPsOhuuEJ/FkmPOOlFysP60AHd3nsEpkGq/QEOdtUyT1Qhk7w9oLmFoMG+75BDog==}
+ /signal-exit@4.1.0:
+ resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
+ engines: {node: '>=14'}
+ dev: true
+
+ /simple-git-hooks@2.9.0:
+ resolution: {integrity: sha512-waSQ5paUQtyGC0ZxlHmcMmD9I1rRXauikBwX31bX58l5vTOhCEcBC5Bi+ZDkPXTjDnZAF8TbCqKBY+9+sVPScw==}
hasBin: true
requiresBuild: true
dev: true
@@ -4956,26 +5252,48 @@ packages:
engines: {node: '>=12'}
dev: true
- /slice-ansi@3.0.0:
- resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==}
- engines: {node: '>=8'}
+ /slice-ansi@5.0.0:
+ resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==}
+ engines: {node: '>=12'}
dependencies:
- ansi-styles: 4.3.0
- astral-regex: 2.0.0
- is-fullwidth-code-point: 3.0.0
+ ansi-styles: 6.2.1
+ is-fullwidth-code-point: 4.0.0
dev: true
- /slice-ansi@4.0.0:
- resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}
- engines: {node: '>=10'}
+ /slice-ansi@7.1.0:
+ resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==}
+ engines: {node: '>=18'}
dependencies:
- ansi-styles: 4.3.0
- astral-regex: 2.0.0
- is-fullwidth-code-point: 3.0.0
+ ansi-styles: 6.2.1
+ is-fullwidth-code-point: 5.0.0
+ dev: true
+
+ /smart-buffer@4.2.0:
+ resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
+ engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
+ dev: true
+
+ /smob@1.4.1:
+ resolution: {integrity: sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==}
+ dev: true
+
+ /socks-proxy-agent@8.0.2:
+ resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==}
+ engines: {node: '>= 14'}
+ dependencies:
+ agent-base: 7.1.0
+ debug: 4.3.4
+ socks: 2.7.1
+ transitivePeerDependencies:
+ - supports-color
dev: true
- /smob@0.0.6:
- resolution: {integrity: sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==}
+ /socks@2.7.1:
+ resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==}
+ engines: {node: '>= 10.13.0', npm: '>= 3.0.0'}
+ dependencies:
+ ip: 2.0.0
+ smart-buffer: 4.2.0
dev: true
/source-map-js@1.0.2:
@@ -4994,11 +5312,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /spdx-correct@3.1.1:
- resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==}
+ /spdx-correct@3.2.0:
+ resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
dependencies:
spdx-expression-parse: 3.0.1
- spdx-license-ids: 3.0.12
+ spdx-license-ids: 3.0.16
dev: true
/spdx-exceptions@2.3.0:
@@ -5009,35 +5327,35 @@ packages:
resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==}
dependencies:
spdx-exceptions: 2.3.0
- spdx-license-ids: 3.0.12
- dev: true
-
- /spdx-license-ids@3.0.12:
- resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==}
+ spdx-license-ids: 3.0.16
dev: true
- /split2@3.2.2:
- resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==}
- dependencies:
- readable-stream: 3.6.0
+ /spdx-license-ids@3.0.16:
+ resolution: {integrity: sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==}
dev: true
- /split@1.0.1:
- resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==}
- dependencies:
- through: 2.3.8
+ /split2@4.2.0:
+ resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
+ engines: {node: '>= 10.x'}
dev: true
/stackback@0.0.2:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
dev: true
- /std-env@3.3.2:
- resolution: {integrity: sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==}
+ /std-env@3.6.0:
+ resolution: {integrity: sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==}
dev: true
- /string-argv@0.3.1:
- resolution: {integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==}
+ /streamx@2.15.1:
+ resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==}
+ dependencies:
+ fast-fifo: 1.3.2
+ queue-tick: 1.0.1
+ dev: true
+
+ /string-argv@0.3.2:
+ resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==}
engines: {node: '>=0.6.19'}
dev: true
@@ -5045,14 +5363,6 @@ packages:
resolution: {integrity: sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==}
dev: true
- /string-width@2.1.1:
- resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==}
- engines: {node: '>=4'}
- dependencies:
- is-fullwidth-code-point: 2.0.0
- strip-ansi: 4.0.0
- dev: true
-
/string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
@@ -5062,57 +5372,63 @@ packages:
strip-ansi: 6.0.1
dev: true
- /string.prototype.padend@3.1.4:
- resolution: {integrity: sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==}
- engines: {node: '>= 0.4'}
+ /string-width@5.1.2:
+ resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
+ engines: {node: '>=12'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
- es-abstract: 1.21.1
+ eastasianwidth: 0.2.0
+ emoji-regex: 9.2.2
+ strip-ansi: 7.1.0
dev: true
- /string.prototype.trimend@1.0.6:
- resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==}
+ /string-width@7.0.0:
+ resolution: {integrity: sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==}
+ engines: {node: '>=18'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
- es-abstract: 1.21.1
+ emoji-regex: 10.3.0
+ get-east-asian-width: 1.2.0
+ strip-ansi: 7.1.0
dev: true
- /string.prototype.trimstart@1.0.6:
- resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==}
+ /string.prototype.padend@3.1.5:
+ resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==}
+ engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- define-properties: 1.1.4
- es-abstract: 1.21.1
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
dev: true
- /string_decoder@1.1.1:
- resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
+ /string.prototype.trim@1.2.8:
+ resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==}
+ engines: {node: '>= 0.4'}
dependencies:
- safe-buffer: 5.1.2
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
+ dev: true
- /string_decoder@1.3.0:
- resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
+ /string.prototype.trimend@1.0.7:
+ resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==}
dependencies:
- safe-buffer: 5.2.1
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
dev: true
- /stringify-object@3.3.0:
- resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==}
- engines: {node: '>=4'}
+ /string.prototype.trimstart@1.0.7:
+ resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==}
dependencies:
- get-own-enumerable-property-symbols: 3.0.2
- is-obj: 1.0.1
- is-regexp: 1.0.0
+ call-bind: 1.0.5
+ define-properties: 1.2.1
+ es-abstract: 1.22.2
dev: true
- /strip-ansi@4.0.0:
- resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==}
- engines: {node: '>=4'}
+ /string_decoder@1.1.1:
+ resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
dependencies:
- ansi-regex: 3.0.1
- dev: true
+ safe-buffer: 5.1.2
+ dev: false
/strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
@@ -5121,26 +5437,26 @@ packages:
ansi-regex: 5.0.1
dev: true
+ /strip-ansi@7.1.0:
+ resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ ansi-regex: 6.0.1
+ dev: true
+
/strip-bom@3.0.0:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'}
dev: true
- /strip-eof@1.0.0:
- resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==}
- engines: {node: '>=0.10.0'}
- dev: true
-
/strip-final-newline@2.0.0:
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
engines: {node: '>=6'}
dev: true
- /strip-indent@3.0.0:
- resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}
- engines: {node: '>=8'}
- dependencies:
- min-indent: 1.0.1
+ /strip-final-newline@3.0.0:
+ resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
+ engines: {node: '>=12'}
dev: true
/strip-json-comments@2.0.1:
@@ -5153,10 +5469,10 @@ packages:
engines: {node: '>=8'}
dev: true
- /strip-literal@1.0.1:
- resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==}
+ /strip-literal@1.3.0:
+ resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
dependencies:
- acorn: 8.8.2
+ acorn: 8.10.0
dev: true
/supports-color@5.5.0:
@@ -5182,53 +5498,41 @@ packages:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
dev: true
- /tar-fs@2.1.1:
- resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==}
+ /tar-fs@3.0.4:
+ resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==}
dependencies:
- chownr: 1.1.4
mkdirp-classic: 0.5.3
pump: 3.0.0
- tar-stream: 2.2.0
+ tar-stream: 3.1.6
dev: true
- /tar-stream@2.2.0:
- resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
- engines: {node: '>=6'}
+ /tar-stream@3.1.6:
+ resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==}
dependencies:
- bl: 4.1.0
- end-of-stream: 1.4.4
- fs-constants: 1.0.0
- inherits: 2.0.4
- readable-stream: 3.6.0
+ b4a: 1.6.4
+ fast-fifo: 1.3.2
+ streamx: 2.15.1
dev: true
- /temp-dir@2.0.0:
- resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==}
- engines: {node: '>=8'}
- dev: true
-
- /tempfile@3.0.0:
- resolution: {integrity: sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==}
- engines: {node: '>=8'}
- dependencies:
- temp-dir: 2.0.0
- uuid: 3.4.0
+ /temp-dir@3.0.0:
+ resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==}
+ engines: {node: '>=14.16'}
dev: true
- /term-size@1.2.0:
- resolution: {integrity: sha512-7dPUZQGy/+m3/wjVz3ZW5dobSoD/02NxJpoXUX0WIyjfVS3l0c+b/+9phIDFA7FHzkYtwtMFgeGZ/Y8jVTeqQQ==}
- engines: {node: '>=4'}
+ /tempfile@5.0.0:
+ resolution: {integrity: sha512-bX655WZI/F7EoTDw9JvQURqAXiPHi8o8+yFxPF2lWYyz1aHnmMRuXWqL6YB6GmeO0o4DIYWHLgGNi/X64T+X4Q==}
+ engines: {node: '>=14.18'}
dependencies:
- execa: 0.7.0
+ temp-dir: 3.0.0
dev: true
- /terser@5.16.2:
- resolution: {integrity: sha512-JKuM+KvvWVqT7muHVyrwv7FVRPnmHDwF6XwoIxdbF5Witi0vu99RYpxDexpJndXt3jbZZmmWr2/mQa6HvSNdSg==}
+ /terser@5.22.0:
+ resolution: {integrity: sha512-hHZVLgRA2z4NWcN6aS5rQDc+7Dcy58HOf2zbYwmFcQ+ua3h6eEFf5lIDKTzbWwlazPyOZsFQO8V80/IjVNExEw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
- '@jridgewell/source-map': 0.3.2
- acorn: 8.8.2
+ '@jridgewell/source-map': 0.3.5
+ acorn: 8.10.0
commander: 2.20.3
source-map-support: 0.5.21
dev: true
@@ -5242,48 +5546,30 @@ packages:
minimatch: 3.1.2
dev: true
- /text-extensions@1.9.0:
- resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==}
- engines: {node: '>=0.10'}
+ /text-extensions@2.4.0:
+ resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==}
+ engines: {node: '>=8'}
dev: true
/text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
dev: true
- /through2@2.0.5:
- resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==}
- dependencies:
- readable-stream: 2.3.7
- xtend: 4.0.2
- dev: true
-
- /through2@4.0.2:
- resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==}
- dependencies:
- readable-stream: 3.6.0
- dev: true
-
/through@2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
dev: true
- /time-zone@1.0.0:
- resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==}
- engines: {node: '>=4'}
- dev: true
-
- /tinybench@2.4.0:
- resolution: {integrity: sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==}
+ /tinybench@2.5.1:
+ resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==}
dev: true
- /tinypool@0.4.0:
- resolution: {integrity: sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==}
+ /tinypool@0.8.1:
+ resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==}
engines: {node: '>=14.0.0'}
dev: true
- /tinyspy@2.1.0:
- resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==}
+ /tinyspy@2.2.0:
+ resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==}
engines: {node: '>=14.0.0'}
dev: true
@@ -5298,20 +5584,21 @@ packages:
is-number: 7.0.0
dev: true
- /todomvc-app-css@2.4.2:
- resolution: {integrity: sha512-ViAkQ7ed89rmhFIGRsT36njN+97z8+s3XsJnB8E2IKOq+/SLD/6PtSvmTtiwUcVk39qPcjAc/OyeDys4LoJUVg==}
+ /todomvc-app-css@2.4.3:
+ resolution: {integrity: sha512-mSnWZaKBWj9aQcFRsGguY/a8O8NR8GmecD48yU1rzwNemgZa/INLpIsxxMiToFGVth+uEKBrQ7IhWkaXZxwq5Q==}
+ engines: {node: '>=4'}
dev: true
/token-stream@1.0.0:
- resolution: {integrity: sha1-zCAOqyYT9BZtJ/+a/HylbUnfbrQ=}
+ resolution: {integrity: sha512-VSsyNPPW74RpHwR8Fc21uubwHY7wMDeJLys2IX5zJNih+OnAnaifKHo+1LHT7DAdloQ7apeaaWg8l7qnf/TnEg==}
dev: true
- /tough-cookie@4.1.2:
- resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==}
+ /tough-cookie@4.1.3:
+ resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==}
engines: {node: '>=6'}
dependencies:
psl: 1.9.0
- punycode: 2.3.0
+ punycode: 2.3.1
universalify: 0.2.0
url-parse: 1.5.10
dev: true
@@ -5320,41 +5607,49 @@ packages:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: true
- /tr46@3.0.0:
- resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==}
- engines: {node: '>=12'}
+ /tr46@5.0.0:
+ resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==}
+ engines: {node: '>=18'}
dependencies:
- punycode: 2.3.0
+ punycode: 2.3.1
dev: true
- /trim-newlines@3.0.1:
- resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==}
- engines: {node: '>=8'}
+ /ts-api-utils@1.0.3(typescript@5.2.2):
+ resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==}
+ engines: {node: '>=16.13.0'}
+ peerDependencies:
+ typescript: '>=4.2.0'
+ dependencies:
+ typescript: 5.2.2
dev: true
/tslib@1.14.1:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
dev: true
- /tslib@2.5.0:
- resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
+ /tslib@2.6.2:
+ resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
dev: true
- /tsutils@3.21.0(typescript@5.0.2):
+ /tsutils@3.21.0(typescript@5.2.2):
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: 1.14.1
- typescript: 5.0.2
+ typescript: 5.2.2
dev: true
- /type-check@0.3.2:
- resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
- engines: {node: '>= 0.8.0'}
+ /tsx@4.7.0:
+ resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==}
+ engines: {node: '>=18.0.0'}
+ hasBin: true
dependencies:
- prelude-ls: 1.1.2
+ esbuild: 0.19.10
+ get-tsconfig: 4.7.2
+ optionalDependencies:
+ fsevents: 2.3.3
dev: true
/type-check@0.4.0:
@@ -5369,47 +5664,71 @@ packages:
engines: {node: '>=4'}
dev: true
- /type-fest@0.18.1:
- resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==}
- engines: {node: '>=10'}
- dev: true
-
/type-fest@0.20.2:
resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
engines: {node: '>=10'}
dev: true
- /type-fest@0.21.3:
- resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
- engines: {node: '>=10'}
+ /type-fest@2.19.0:
+ resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
+ engines: {node: '>=12.20'}
dev: true
- /type-fest@0.6.0:
- resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==}
- engines: {node: '>=8'}
+ /type-fest@3.13.1:
+ resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==}
+ engines: {node: '>=14.16'}
dev: true
- /type-fest@0.8.1:
- resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
- engines: {node: '>=8'}
+ /type-fest@4.5.0:
+ resolution: {integrity: sha512-diLQivFzddJl4ylL3jxSkEc39Tpw7o1QeEHIPxVwryDK2lpB7Nqhzhuo6v5/Ls08Z0yPSAhsyAWlv1/H0ciNmw==}
+ engines: {node: '>=16'}
+ dev: true
+
+ /typed-array-buffer@1.0.0:
+ resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.5
+ get-intrinsic: 1.2.1
+ is-typed-array: 1.1.12
+ dev: true
+
+ /typed-array-byte-length@1.0.0:
+ resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.5
+ for-each: 0.3.3
+ has-proto: 1.0.1
+ is-typed-array: 1.1.12
+ dev: true
+
+ /typed-array-byte-offset@1.0.0:
+ resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ available-typed-arrays: 1.0.5
+ call-bind: 1.0.5
+ for-each: 0.3.3
+ has-proto: 1.0.1
+ is-typed-array: 1.1.12
dev: true
/typed-array-length@1.0.4:
resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==}
dependencies:
- call-bind: 1.0.2
+ call-bind: 1.0.5
for-each: 0.3.3
- is-typed-array: 1.1.10
+ is-typed-array: 1.1.12
dev: true
- /typescript@5.0.2:
- resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==}
- engines: {node: '>=12.20'}
+ /typescript@5.2.2:
+ resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==}
+ engines: {node: '>=14.17'}
hasBin: true
- dev: true
- /ufo@1.1.1:
- resolution: {integrity: sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==}
+ /ufo@1.3.1:
+ resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==}
dev: true
/uglify-js@3.17.4:
@@ -5423,7 +5742,7 @@ packages:
/unbox-primitive@1.0.2:
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
dependencies:
- call-bind: 1.0.2
+ call-bind: 1.0.5
has-bigints: 1.0.2
has-symbols: 1.0.3
which-boxed-primitive: 1.0.2
@@ -5436,24 +5755,33 @@ packages:
through: 2.3.8
dev: true
+ /undici-types@5.26.5:
+ resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
+ dev: true
+
+ /universalify@0.1.2:
+ resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
+ engines: {node: '>= 4.0.0'}
+ dev: true
+
/universalify@0.2.0:
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
engines: {node: '>= 4.0.0'}
dev: true
- /update-browserslist-db@1.0.10(browserslist@4.21.5):
- resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==}
+ /update-browserslist-db@1.0.13(browserslist@4.22.1):
+ resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
dependencies:
- browserslist: 4.21.5
+ browserslist: 4.22.1
escalade: 3.1.1
picocolors: 1.0.0
dev: true
- /update-check@1.5.2:
- resolution: {integrity: sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==}
+ /update-check@1.5.4:
+ resolution: {integrity: sha512-5YHsflzHP4t1G+8WGPlvKbJEbAJGCgw+Em+dGR1KmBUbr1J36SJBqlHLjR7oob7sco5hWHGQVcr9B2poIVDDTQ==}
dependencies:
registry-auth-token: 3.3.2
registry-url: 3.1.0
@@ -5462,7 +5790,7 @@ packages:
/uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
- punycode: 2.3.0
+ punycode: 2.3.1
dev: true
/url-parse@1.5.10:
@@ -5472,19 +5800,17 @@ packages:
requires-port: 1.0.0
dev: true
+ /urlpattern-polyfill@9.0.0:
+ resolution: {integrity: sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==}
+ dev: true
+
/util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
- /uuid@3.4.0:
- resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
- deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
- hasBin: true
- dev: true
-
/validate-npm-package-license@3.0.4:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
dependencies:
- spdx-correct: 3.1.1
+ spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1
dev: true
@@ -5493,20 +5819,20 @@ packages:
engines: {node: '>= 0.8'}
dev: true
- /vite-node@0.30.1(@types/node@16.18.11)(terser@5.16.2):
- resolution: {integrity: sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==}
- engines: {node: '>=v14.18.0'}
+ /vite-node@1.2.0(@types/node@20.11.1)(terser@5.22.0):
+ resolution: {integrity: sha512-ETnQTHeAbbOxl7/pyBck9oAPZZZo+kYnFt1uQDD+hPReOc+wCjXw4r4jHriBRuVDB5isHmPXxrfc1yJnfBERqg==}
+ engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
dependencies:
cac: 6.7.14
debug: 4.3.4
- mlly: 1.2.0
- pathe: 1.1.0
+ pathe: 1.1.1
picocolors: 1.0.0
- vite: 4.3.1(@types/node@16.18.11)(terser@5.16.2)
+ vite: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
transitivePeerDependencies:
- '@types/node'
- less
+ - lightningcss
- sass
- stylus
- sugarss
@@ -5514,13 +5840,14 @@ packages:
- terser
dev: true
- /vite@4.3.1(@types/node@16.18.11)(terser@5.16.2):
- resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==}
- engines: {node: ^14.18.0 || >=16.0.0}
+ /vite@5.0.7(@types/node@20.11.1)(terser@5.22.0):
+ resolution: {integrity: sha512-B4T4rJCDPihrQo2B+h1MbeGL/k/GMAHzhQ8S0LjQ142s6/+l3hHTT095ORvsshj4QCkoWu3Xtmob5mazvakaOw==}
+ engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
- '@types/node': '>= 14'
+ '@types/node': ^18.0.0 || >=20.0.0
less: '*'
+ lightningcss: ^1.21.0
sass: '*'
stylus: '*'
sugarss: '*'
@@ -5530,6 +5857,8 @@ packages:
optional: true
less:
optional: true
+ lightningcss:
+ optional: true
sass:
optional: true
stylus:
@@ -5539,31 +5868,31 @@ packages:
terser:
optional: true
dependencies:
- '@types/node': 16.18.11
- esbuild: 0.17.5
- postcss: 8.4.21
- rollup: 3.20.2
- terser: 5.16.2
+ '@types/node': 20.11.1
+ esbuild: 0.19.10
+ postcss: 8.4.33
+ rollup: 4.4.1
+ terser: 5.22.0
optionalDependencies:
- fsevents: 2.3.2
+ fsevents: 2.3.3
dev: true
- /vitest@0.30.1(jsdom@21.1.0)(terser@5.16.2):
- resolution: {integrity: sha512-y35WTrSTlTxfMLttgQk4rHcaDkbHQwDP++SNwPb+7H8yb13Q3cu2EixrtHzF27iZ8v0XCciSsLg00RkPAzB/aA==}
- engines: {node: '>=v14.18.0'}
+ /vitest@1.2.0(@types/node@20.11.1)(jsdom@23.2.0)(terser@5.22.0):
+ resolution: {integrity: sha512-Ixs5m7BjqvLHXcibkzKRQUvD/XLw0E3rvqaCMlrm/0LMsA0309ZqYvTlPzkhh81VlEyVZXFlwWnkhb6/UMtcaQ==}
+ engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
- '@vitest/browser': '*'
- '@vitest/ui': '*'
+ '@types/node': ^18.0.0 || >=20.0.0
+ '@vitest/browser': ^1.0.0
+ '@vitest/ui': ^1.0.0
happy-dom: '*'
jsdom: '*'
- playwright: '*'
- safaridriver: '*'
- webdriverio: '*'
peerDependenciesMeta:
'@edge-runtime/vm':
optional: true
+ '@types/node':
+ optional: true
'@vitest/browser':
optional: true
'@vitest/ui':
@@ -5572,42 +5901,33 @@ packages:
optional: true
jsdom:
optional: true
- playwright:
- optional: true
- safaridriver:
- optional: true
- webdriverio:
- optional: true
dependencies:
- '@types/chai': 4.3.4
- '@types/chai-subset': 1.3.3
- '@types/node': 16.18.11
- '@vitest/expect': 0.30.1
- '@vitest/runner': 0.30.1
- '@vitest/snapshot': 0.30.1
- '@vitest/spy': 0.30.1
- '@vitest/utils': 0.30.1
- acorn: 8.8.2
- acorn-walk: 8.2.0
+ '@types/node': 20.11.1
+ '@vitest/expect': 1.2.0
+ '@vitest/runner': 1.2.0
+ '@vitest/snapshot': 1.2.0
+ '@vitest/spy': 1.2.0
+ '@vitest/utils': 1.2.0
+ acorn-walk: 8.3.1
cac: 6.7.14
- chai: 4.3.7
- concordance: 5.0.4
+ chai: 4.3.10
debug: 4.3.4
- jsdom: 21.1.0
- local-pkg: 0.4.3
- magic-string: 0.30.0
- pathe: 1.1.0
+ execa: 8.0.1
+ jsdom: 23.2.0
+ local-pkg: 0.5.0
+ magic-string: 0.30.5
+ pathe: 1.1.1
picocolors: 1.0.0
- source-map: 0.6.1
- std-env: 3.3.2
- strip-literal: 1.0.1
- tinybench: 2.4.0
- tinypool: 0.4.0
- vite: 4.3.1(@types/node@16.18.11)(terser@5.16.2)
- vite-node: 0.30.1(@types/node@16.18.11)(terser@5.16.2)
+ std-env: 3.6.0
+ strip-literal: 1.3.0
+ tinybench: 2.5.1
+ tinypool: 0.8.1
+ vite: 5.0.7(@types/node@20.11.1)(terser@5.22.0)
+ vite-node: 1.2.0(@types/node@20.11.1)(terser@5.22.0)
why-is-node-running: 2.2.2
transitivePeerDependencies:
- less
+ - lightningcss
- sass
- stylus
- sugarss
@@ -5620,11 +5940,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /w3c-xmlserializer@4.0.0:
- resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}
- engines: {node: '>=14'}
+ /w3c-xmlserializer@5.0.0:
+ resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}
+ engines: {node: '>=18'}
dependencies:
- xml-name-validator: 4.0.0
+ xml-name-validator: 5.0.0
dev: true
/webidl-conversions@3.0.1:
@@ -5636,28 +5956,23 @@ packages:
engines: {node: '>=12'}
dev: true
- /well-known-symbols@2.0.0:
- resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==}
- engines: {node: '>=6'}
- dev: true
-
- /whatwg-encoding@2.0.0:
- resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==}
- engines: {node: '>=12'}
+ /whatwg-encoding@3.1.1:
+ resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==}
+ engines: {node: '>=18'}
dependencies:
iconv-lite: 0.6.3
dev: true
- /whatwg-mimetype@3.0.0:
- resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==}
- engines: {node: '>=12'}
+ /whatwg-mimetype@4.0.0:
+ resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}
+ engines: {node: '>=18'}
dev: true
- /whatwg-url@11.0.0:
- resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==}
- engines: {node: '>=12'}
+ /whatwg-url@14.0.0:
+ resolution: {integrity: sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==}
+ engines: {node: '>=18'}
dependencies:
- tr46: 3.0.0
+ tr46: 5.0.0
webidl-conversions: 7.0.0
dev: true
@@ -5678,16 +5993,15 @@ packages:
is-symbol: 1.0.4
dev: true
- /which-typed-array@1.1.9:
- resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==}
+ /which-typed-array@1.1.13:
+ resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==}
engines: {node: '>= 0.4'}
dependencies:
available-typed-arrays: 1.0.5
- call-bind: 1.0.2
+ call-bind: 1.0.5
for-each: 0.3.3
gopd: 1.0.1
has-tostringtag: 1.0.0
- is-typed-array: 1.1.10
dev: true
/which@1.3.1:
@@ -5714,41 +6028,27 @@ packages:
stackback: 0.0.2
dev: true
- /widest-line@2.0.1:
- resolution: {integrity: sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==}
- engines: {node: '>=4'}
+ /widest-line@4.0.1:
+ resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==}
+ engines: {node: '>=12'}
dependencies:
- string-width: 2.1.1
+ string-width: 5.1.2
dev: true
/with@7.0.2:
resolution: {integrity: sha512-RNGKj82nUPg3g5ygxkQl0R937xLyho1J24ItRCBTr/m1YnZkzJy1hUiHUJrc/VlsDQzsCnInEGSg3bci0Lmd4w==}
engines: {node: '>= 10.0.0'}
dependencies:
- '@babel/parser': 7.21.3
- '@babel/types': 7.21.3
+ '@babel/parser': 7.23.6
+ '@babel/types': 7.23.6
assert-never: 1.2.1
babel-walk: 3.0.0-canary-5
dev: true
- /word-wrap@1.2.3:
- resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}
- engines: {node: '>=0.10.0'}
- dev: true
-
/wordwrap@1.0.0:
resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
dev: true
- /wrap-ansi@6.2.0:
- resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
- engines: {node: '>=8'}
- dependencies:
- ansi-styles: 4.3.0
- string-width: 4.2.3
- strip-ansi: 6.0.1
- dev: true
-
/wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@@ -5758,25 +6058,30 @@ packages:
strip-ansi: 6.0.1
dev: true
- /wrappy@1.0.2:
- resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+ /wrap-ansi@8.1.0:
+ resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ ansi-styles: 6.2.1
+ string-width: 5.1.2
+ strip-ansi: 7.1.0
dev: true
- /ws@8.11.0:
- resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==}
- engines: {node: '>=10.0.0'}
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: ^5.0.2
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
+ /wrap-ansi@9.0.0:
+ resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==}
+ engines: {node: '>=18'}
+ dependencies:
+ ansi-styles: 6.2.1
+ string-width: 7.0.0
+ strip-ansi: 7.1.0
+ dev: true
+
+ /wrappy@1.0.2:
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: true
- /ws@8.12.0:
- resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==}
+ /ws@8.16.0:
+ resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@@ -5788,29 +6093,20 @@ packages:
optional: true
dev: true
- /xml-name-validator@4.0.0:
- resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
- engines: {node: '>=12'}
+ /xml-name-validator@5.0.0:
+ resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
+ engines: {node: '>=18'}
dev: true
/xmlchars@2.2.0:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
dev: true
- /xtend@4.0.2:
- resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
- engines: {node: '>=0.4'}
- dev: true
-
/y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
dev: true
- /yallist@2.1.2:
- resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==}
- dev: true
-
/yallist@3.1.1:
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
dev: true
@@ -5819,27 +6115,27 @@ packages:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: true
- /yaml@1.10.2:
- resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
- engines: {node: '>= 6'}
+ /yaml@2.3.4:
+ resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==}
+ engines: {node: '>= 14'}
dev: true
- /yargs-parser@20.2.9:
- resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
- engines: {node: '>=10'}
+ /yargs-parser@21.1.1:
+ resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
+ engines: {node: '>=12'}
dev: true
- /yargs@16.2.0:
- resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==}
- engines: {node: '>=10'}
+ /yargs@17.7.2:
+ resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
+ engines: {node: '>=12'}
dependencies:
- cliui: 7.0.4
+ cliui: 8.0.1
escalade: 3.1.1
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
- yargs-parser: 20.2.9
+ yargs-parser: 21.1.1
dev: true
/yauzl@2.10.0:
diff --git a/rollup.config.js b/rollup.config.js
index 7050ba437e6..657b711b1a3 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,10 +1,11 @@
// @ts-check
+import assert from 'node:assert/strict'
import { createRequire } from 'node:module'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
import replace from '@rollup/plugin-replace'
import json from '@rollup/plugin-json'
-import chalk from 'chalk'
+import pico from 'picocolors'
import commonJS from '@rollup/plugin-commonjs'
import polyfillNode from 'rollup-plugin-polyfill-node'
import { nodeResolve } from '@rollup/plugin-node-resolve'
@@ -12,7 +13,15 @@ import terser from '@rollup/plugin-terser'
import esbuild from 'rollup-plugin-esbuild'
import alias from '@rollup/plugin-alias'
import { entries } from './scripts/aliases.js'
-import { constEnum } from './scripts/const-enum.js'
+import { inlineEnums } from './scripts/inline-enums.js'
+
+/**
+ * @template T
+ * @template {keyof T} K
+ * @typedef { Omit & Required> } MarkRequired
+ */
+/** @typedef {'cjs' | 'esm-bundler' | 'global' | 'global-runtime' | 'esm-browser' | 'esm-bundler-runtime' | 'esm-browser-runtime'} PackageFormat */
+/** @typedef {MarkRequired} OutputOptions */
if (!process.env.TARGET) {
throw new Error('TARGET package must be specified via --environment flag.')
@@ -27,47 +36,53 @@ const consolidatePkg = require('@vue/consolidate/package.json')
const packagesDir = path.resolve(__dirname, 'packages')
const packageDir = path.resolve(packagesDir, process.env.TARGET)
-const resolve = p => path.resolve(packageDir, p)
+const resolve = (/** @type {string} */ p) => path.resolve(packageDir, p)
const pkg = require(resolve(`package.json`))
const packageOptions = pkg.buildOptions || {}
const name = packageOptions.filename || path.basename(packageDir)
-const [enumPlugin, enumDefines] = constEnum()
+const [enumPlugin, enumDefines] = inlineEnums()
+/** @type {Record} */
const outputConfigs = {
'esm-bundler': {
file: resolve(`dist/${name}.esm-bundler.js`),
- format: `es`
+ format: 'es',
},
'esm-browser': {
file: resolve(`dist/${name}.esm-browser.js`),
- format: `es`
+ format: 'es',
},
cjs: {
file: resolve(`dist/${name}.cjs.js`),
- format: `cjs`
+ format: 'cjs',
},
global: {
file: resolve(`dist/${name}.global.js`),
- format: `iife`
+ format: 'iife',
},
// runtime-only builds, for main "vue" package only
'esm-bundler-runtime': {
file: resolve(`dist/${name}.runtime.esm-bundler.js`),
- format: `es`
+ format: 'es',
},
'esm-browser-runtime': {
file: resolve(`dist/${name}.runtime.esm-browser.js`),
- format: 'es'
+ format: 'es',
},
'global-runtime': {
file: resolve(`dist/${name}.runtime.global.js`),
- format: 'iife'
- }
+ format: 'iife',
+ },
}
+/** @type {ReadonlyArray} */
const defaultFormats = ['esm-bundler', 'cjs']
-const inlineFormats = process.env.FORMATS && process.env.FORMATS.split(',')
+/** @type {ReadonlyArray} */
+const inlineFormats = /** @type {any} */ (
+ process.env.FORMATS && process.env.FORMATS.split(',')
+)
+/** @type {ReadonlyArray} */
const packageFormats = inlineFormats || packageOptions.formats || defaultFormats
const packageConfigs = process.env.PROD_ONLY
? []
@@ -89,9 +104,16 @@ if (process.env.NODE_ENV === 'production') {
export default packageConfigs
+/**
+ *
+ * @param {PackageFormat} format
+ * @param {OutputOptions} output
+ * @param {ReadonlyArray} plugins
+ * @returns {import('rollup').RollupOptions}
+ */
function createConfig(format, output, plugins = []) {
if (!output) {
- console.log(chalk.yellow(`invalid format: "${format}"`))
+ console.log(pico.yellow(`invalid format: "${format}"`))
process.exit(1)
}
@@ -100,7 +122,7 @@ function createConfig(format, output, plugins = []) {
const isBundlerESMBuild = /esm-bundler/.test(format)
const isBrowserESMBuild = /esm-browser/.test(format)
const isServerRenderer = name === 'server-renderer'
- const isNodeBuild = format === 'cjs'
+ const isCJSBuild = format === 'cjs'
const isGlobalBuild = /global/.test(format)
const isCompatPackage =
pkg.name === '@vue/compat' || pkg.name === '@vue/compat-canary'
@@ -109,8 +131,14 @@ function createConfig(format, output, plugins = []) {
(isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
!packageOptions.enableNonBrowserBranches
+ output.banner = `/**
+* ${pkg.name} v${masterVersion}
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/`
+
output.exports = isCompatPackage ? 'auto' : 'named'
- if (isNodeBuild) {
+ if (isCJSBuild) {
output.esModule = true
}
output.sourcemap = !!process.env.SOURCE_MAP
@@ -132,6 +160,7 @@ function createConfig(format, output, plugins = []) {
}
function resolveDefine() {
+ /** @type {Record} */
const replacements = {
__COMMIT__: `"${process.env.COMMIT}"`,
__VERSION__: `"${masterVersion}"`,
@@ -143,9 +172,9 @@ function createConfig(format, output, plugins = []) {
__ESM_BUNDLER__: String(isBundlerESMBuild),
__ESM_BROWSER__: String(isBrowserESMBuild),
// is targeting Node (SSR)?
- __NODE_JS__: String(isNodeBuild),
+ __CJS__: String(isCJSBuild),
// need SSR-specific branches?
- __SSR__: String(isNodeBuild || isBundlerESMBuild || isServerRenderer),
+ __SSR__: String(isCJSBuild || isBundlerESMBuild || isServerRenderer),
// 2.x compat build
__COMPAT__: String(isCompatBuild),
@@ -157,12 +186,14 @@ function createConfig(format, output, plugins = []) {
: `true`,
__FEATURE_PROD_DEVTOOLS__: isBundlerESMBuild
? `__VUE_PROD_DEVTOOLS__`
- : `false`
+ : `false`,
+ __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: isBundlerESMBuild
+ ? `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`
+ : `false`,
}
if (!isBundlerESMBuild) {
// hard coded dev/prod builds
- // @ts-ignore
replacements.__DEV__ = String(!isProductionBuild)
}
@@ -170,7 +201,9 @@ function createConfig(format, output, plugins = []) {
//__RUNTIME_COMPILE__=true pnpm build runtime-core
Object.keys(replacements).forEach(key => {
if (key in process.env) {
- replacements[key] = process.env[key]
+ const value = process.env[key]
+ assert(typeof value === 'string')
+ replacements[key] = value
}
})
return replacements
@@ -186,14 +219,14 @@ function createConfig(format, output, plugins = []) {
'context.onError(': `/*#__PURE__*/ context.onError(`,
'emitError(': `/*#__PURE__*/ emitError(`,
'createCompilerError(': `/*#__PURE__*/ createCompilerError(`,
- 'createDOMCompilerError(': `/*#__PURE__*/ createDOMCompilerError(`
+ 'createDOMCompilerError(': `/*#__PURE__*/ createDOMCompilerError(`,
})
}
if (isBundlerESMBuild) {
Object.assign(replacements, {
// preserve to be handled by bundlers
- __DEV__: `!!(process.env.NODE_ENV !== 'production')`
+ __DEV__: `!!(process.env.NODE_ENV !== 'production')`,
})
}
@@ -202,12 +235,11 @@ function createConfig(format, output, plugins = []) {
Object.assign(replacements, {
'process.env': '({})',
'process.platform': '""',
- 'process.stdout': 'null'
+ 'process.stdout': 'null',
})
}
if (Object.keys(replacements).length) {
- // @ts-ignore
return [replace({ values: replacements, preventAssignment: true })]
} else {
return []
@@ -215,7 +247,12 @@ function createConfig(format, output, plugins = []) {
}
function resolveExternal() {
- const treeShakenDeps = ['source-map-js', '@babel/parser', 'estree-walker']
+ const treeShakenDeps = [
+ 'source-map-js',
+ '@babel/parser',
+ 'estree-walker',
+ 'entities/lib/decode.js',
+ ]
if (isGlobalBuild || isBrowserESMBuild || isCompatPackage) {
if (!packageOptions.enableNonBrowserBranches) {
@@ -232,7 +269,7 @@ function createConfig(format, output, plugins = []) {
// for @vue/compiler-sfc / server-renderer
...['path', 'url', 'stream'],
// somehow these throw warnings for runtime-* package builds
- ...treeShakenDeps
+ ...treeShakenDeps,
]
}
}
@@ -240,6 +277,7 @@ function createConfig(format, output, plugins = []) {
function resolveNodePlugins() {
// we are bundling forked consolidate.js in compiler-sfc which dynamically
// requires a ton of template engines which should be ignored.
+ /** @type {ReadonlyArray} */
let cjsIgnores = []
if (
pkg.name === '@vue/compiler-sfc' ||
@@ -253,7 +291,7 @@ function createConfig(format, output, plugins = []) {
'teacup/lib/express',
'arc-templates/dist/es5',
'then-pug',
- 'then-jade'
+ 'then-jade',
]
}
@@ -263,10 +301,10 @@ function createConfig(format, output, plugins = []) {
? [
commonJS({
sourceMap: false,
- ignore: cjsIgnores
+ ignore: cjsIgnores,
}),
...(format === 'cjs' ? [] : [polyfillNode()]),
- nodeResolve()
+ nodeResolve(),
]
: []
@@ -280,10 +318,10 @@ function createConfig(format, output, plugins = []) {
external: resolveExternal(),
plugins: [
json({
- namedExports: false
+ namedExports: false,
}),
alias({
- entries
+ entries,
}),
enumPlugin,
...resolveReplace(),
@@ -291,47 +329,47 @@ function createConfig(format, output, plugins = []) {
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
sourceMap: output.sourcemap,
minify: false,
- target: isServerRenderer || isNodeBuild ? 'es2019' : 'es2015',
- define: resolveDefine()
+ target: isServerRenderer || isCJSBuild ? 'es2019' : 'es2015',
+ define: resolveDefine(),
}),
...resolveNodePlugins(),
- ...plugins
+ ...plugins,
],
output,
onwarn: (msg, warn) => {
- if (!/Circular/.test(msg)) {
+ if (msg.code !== 'CIRCULAR_DEPENDENCY') {
warn(msg)
}
},
treeshake: {
- moduleSideEffects: false
- }
+ moduleSideEffects: false,
+ },
}
}
-function createProductionConfig(format) {
+function createProductionConfig(/** @type {PackageFormat} */ format) {
return createConfig(format, {
file: resolve(`dist/${name}.${format}.prod.js`),
- format: outputConfigs[format].format
+ format: outputConfigs[format].format,
})
}
-function createMinifiedConfig(format) {
+function createMinifiedConfig(/** @type {PackageFormat} */ format) {
return createConfig(
format,
{
file: outputConfigs[format].file.replace(/\.js$/, '.prod.js'),
- format: outputConfigs[format].format
+ format: outputConfigs[format].format,
},
[
terser({
module: /^esm/.test(format),
compress: {
ecma: 2015,
- pure_getters: true
+ pure_getters: true,
},
- safari10: true
- })
- ]
+ safari10: true,
+ }),
+ ],
)
}
diff --git a/rollup.dts.config.js b/rollup.dts.config.js
index 961e8ee2a94..d715af4a4f8 100644
--- a/rollup.dts.config.js
+++ b/rollup.dts.config.js
@@ -1,13 +1,13 @@
// @ts-check
+import assert from 'node:assert/strict'
import { parse } from '@babel/parser'
-import { existsSync, readdirSync, readFileSync, writeFileSync } from 'fs'
+import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'
import MagicString from 'magic-string'
import dts from 'rollup-plugin-dts'
-import { walk } from 'estree-walker'
if (!existsSync('temp/packages')) {
console.warn(
- 'no temp dts files found. run `tsc -p tsconfig.build.json` first.'
+ 'no temp dts files found. run `tsc -p tsconfig.build.json` first.',
)
process.exit(1)
}
@@ -18,35 +18,39 @@ const targetPackages = targets
? packages.filter(pkg => targets.includes(pkg))
: packages
-export default targetPackages.map(pkg => {
- return {
- input: `./temp/packages/${pkg}/src/index.d.ts`,
- output: {
- file: `packages/${pkg}/dist/${pkg}.d.ts`,
- format: 'es'
- },
- plugins: [dts(), patchTypes(pkg), ...(pkg === 'vue' ? [copyMts()] : [])],
- onwarn(warning, warn) {
- // during dts rollup, everything is externalized by default
- if (
- warning.code === 'UNRESOLVED_IMPORT' &&
- !warning.exporter.startsWith('.')
- ) {
- return
- }
- warn(warning)
+export default targetPackages.map(
+ /** @returns {import('rollup').RollupOptions} */
+ pkg => {
+ return {
+ input: `./temp/packages/${pkg}/src/index.d.ts`,
+ output: {
+ file: `packages/${pkg}/dist/${pkg}.d.ts`,
+ format: 'es',
+ },
+ plugins: [dts(), patchTypes(pkg), ...(pkg === 'vue' ? [copyMts()] : [])],
+ onwarn(warning, warn) {
+ // during dts rollup, everything is externalized by default
+ if (
+ warning.code === 'UNRESOLVED_IMPORT' &&
+ !warning.exporter?.startsWith('.')
+ ) {
+ return
+ }
+ warn(warning)
+ },
}
- }
-})
+ },
+)
/**
* Patch the dts generated by rollup-plugin-dts
- * 1. remove exports marked as @internal
- * 2. Convert all types to inline exports
+ * 1. Convert all types to inline exports
* and remove them from the big export {} declaration
* otherwise it gets weird in vitepress `defineComponent` call with
* "the inferred type cannot be named without a reference"
- * 3. Append custom agumentations (jsx, macros)
+ * 2. Append custom augmentations (jsx, macros)
+ *
+ * @param {string} pkg
* @returns {import('rollup').Plugin}
*/
function patchTypes(pkg) {
@@ -56,7 +60,7 @@ function patchTypes(pkg) {
const s = new MagicString(code)
const ast = parse(code, {
plugins: ['typescript'],
- sourceType: 'module'
+ sourceType: 'module',
})
/**
@@ -67,68 +71,17 @@ function patchTypes(pkg) {
if (!node.id) {
return
}
- // @ts-ignore
+ assert(node.id.type === 'Identifier')
const name = node.id.name
if (name.startsWith('_')) {
return
}
shouldRemoveExport.add(name)
- if (!removeInternal(parentDecl || node)) {
- if (isExported.has(name)) {
- // @ts-ignore
- s.prependLeft((parentDecl || node).start, `export `)
- }
- // traverse further for internal properties
- if (
- node.type === 'TSInterfaceDeclaration' ||
- node.type === 'ClassDeclaration'
- ) {
- node.body.body.forEach(removeInternal)
- } else if (node.type === 'TSTypeAliasDeclaration') {
- // @ts-ignore
- walk(node.typeAnnotation, {
- enter(node) {
- // @ts-ignore
- if (removeInternal(node)) this.skip()
- }
- })
- }
- }
- }
-
- /**
- * @param {import('@babel/types').Node} node
- * @returns {boolean}
- */
- function removeInternal(node) {
- if (
- node.leadingComments &&
- node.leadingComments.some(c => {
- return c.type === 'CommentBlock' && /@internal\b/.test(c.value)
- })
- ) {
- /** @type {any} */
- const n = node
- let id
- if (n.id && n.id.type === 'Identifier') {
- id = n.id.name
- } else if (n.key && n.key.type === 'Identifier') {
- id = n.key.name
- }
- if (id) {
- s.overwrite(
- // @ts-ignore
- node.leadingComments[0].start,
- node.end,
- `/* removed internal: ${id} */`
- )
- } else {
- // @ts-ignore
- s.remove(node.leadingComments[0].start, node.end)
- }
- return true
+ if (isExported.has(name)) {
+ const start = (parentDecl || node).start
+ assert(typeof start === 'number')
+ s.prependLeft(start, `export `)
}
- return false
}
const isExported = new Set()
@@ -146,17 +99,18 @@ function patchTypes(pkg) {
}
}
- // pass 1: remove internals + add exports
+ // pass 1: add exports
for (const node of ast.program.body) {
if (node.type === 'VariableDeclaration') {
processDeclaration(node.declarations[0], node)
if (node.declarations.length > 1) {
+ assert(typeof node.start === 'number')
+ assert(typeof node.end === 'number')
throw new Error(
`unhandled declare const with more than one declarators:\n${code.slice(
- // @ts-ignore
node.start,
- node.end
- )}`
+ node.end,
+ )}`,
)
}
} else if (
@@ -167,10 +121,6 @@ function patchTypes(pkg) {
node.type === 'ClassDeclaration'
) {
processDeclaration(node)
- } else if (removeInternal(node)) {
- throw new Error(
- `unhandled export type marked as @internal: ${node.type}`
- )
}
}
@@ -184,7 +134,7 @@ function patchTypes(pkg) {
spec.type === 'ExportSpecifier' &&
shouldRemoveExport.has(spec.local.name)
) {
- // @ts-ignore
+ assert(spec.exported.type === 'Identifier')
const exported = spec.exported.name
if (exported !== spec.local.name) {
// this only happens if we have something like
@@ -194,31 +144,33 @@ function patchTypes(pkg) {
}
const next = node.specifiers[i + 1]
if (next) {
- // @ts-ignore
+ assert(typeof spec.start === 'number')
+ assert(typeof next.start === 'number')
s.remove(spec.start, next.start)
} else {
// last one
const prev = node.specifiers[i - 1]
- // @ts-ignore
- s.remove(prev ? prev.end : spec.start, spec.end)
+ assert(typeof spec.start === 'number')
+ assert(typeof spec.end === 'number')
+ s.remove(
+ prev
+ ? (assert(typeof prev.end === 'number'), prev.end)
+ : spec.start,
+ spec.end,
+ )
}
removed++
}
}
if (removed === node.specifiers.length) {
- // @ts-ignore
+ assert(typeof node.start === 'number')
+ assert(typeof node.end === 'number')
s.remove(node.start, node.end)
}
}
}
code = s.toString()
- if (/@internal/.test(code)) {
- throw new Error(
- `unhandled @internal declarations detected in ${chunk.fileName}.`
- )
- }
-
// append pkg specific types
const additionalTypeDir = `packages/${pkg}/types`
if (existsSync(additionalTypeDir)) {
@@ -229,7 +181,7 @@ function patchTypes(pkg) {
.join('\n')
}
return code
- }
+ },
}
}
@@ -245,11 +197,8 @@ function copyMts() {
return {
name: 'copy-vue-mts',
writeBundle(_, bundle) {
- writeFileSync(
- 'packages/vue/dist/vue.d.mts',
- // @ts-ignore
- bundle['vue.d.ts'].code
- )
- }
+ assert('code' in bundle['vue.d.ts'])
+ writeFileSync('packages/vue/dist/vue.d.mts', bundle['vue.d.ts'].code)
+ },
}
}
diff --git a/scripts/aliases.js b/scripts/aliases.js
index 95e3016322c..d50498a80aa 100644
--- a/scripts/aliases.js
+++ b/scripts/aliases.js
@@ -4,27 +4,23 @@ import { readdirSync, statSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
-const resolveEntryForPkg = p =>
+const resolveEntryForPkg = (/** @type {string} */ p) =>
path.resolve(
fileURLToPath(import.meta.url),
- `../../packages/${p}/src/index.ts`
+ `../../packages/${p}/src/index.ts`,
)
const dirs = readdirSync(new URL('../packages', import.meta.url))
+/** @type {Record} */
const entries = {
vue: resolveEntryForPkg('vue'),
'vue/compiler-sfc': resolveEntryForPkg('compiler-sfc'),
'vue/server-renderer': resolveEntryForPkg('server-renderer'),
- '@vue/compat': resolveEntryForPkg('vue-compat')
+ '@vue/compat': resolveEntryForPkg('vue-compat'),
}
-const nonSrcPackages = [
- 'sfc-playground',
- 'size-check',
- 'template-explorer',
- 'dts-test'
-]
+const nonSrcPackages = ['sfc-playground', 'template-explorer', 'dts-test']
for (const dir of dirs) {
const key = `@vue/${dir}`
diff --git a/scripts/build.js b/scripts/build.js
index 689d3dc9351..eacabe0dee4 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -17,16 +17,17 @@ nr build core --formats cjs
*/
import fs from 'node:fs/promises'
-import { existsSync, readFileSync, rmSync } from 'node:fs'
+import { existsSync } from 'node:fs'
import path from 'node:path'
import minimist from 'minimist'
-import { gzipSync, brotliCompressSync } from 'node:zlib'
-import chalk from 'chalk'
-import execa from 'execa'
+import { brotliCompressSync, gzipSync } from 'node:zlib'
+import pico from 'picocolors'
+import { execa, execaSync } from 'execa'
import { cpus } from 'node:os'
import { createRequire } from 'node:module'
import { targets as allTargets, fuzzyMatchTarget } from './utils.js'
-import { scanEnums } from './const-enum.js'
+import { scanEnums } from './inline-enums.js'
+import prettyBytes from 'pretty-bytes'
const require = createRequire(import.meta.url)
const args = minimist(process.argv.slice(2))
@@ -37,19 +38,24 @@ const prodOnly = !devOnly && (args.prodOnly || args.p)
const buildTypes = args.withTypes || args.t
const sourceMap = args.sourcemap || args.s
const isRelease = args.release
+/** @type {boolean | undefined} */
const buildAllMatching = args.all || args.a
-const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
+const writeSize = args.size
+const commit = execaSync('git', ['rev-parse', '--short=7', 'HEAD']).stdout
+
+const sizeDir = path.resolve('temp/size')
run()
async function run() {
+ if (writeSize) await fs.mkdir(sizeDir, { recursive: true })
const removeCache = scanEnums()
try {
const resolvedTargets = targets.length
? fuzzyMatchTarget(targets, buildAllMatching)
: allTargets
await buildAll(resolvedTargets)
- checkAllSizes(resolvedTargets)
+ await checkAllSizes(resolvedTargets)
if (buildTypes) {
await execa(
'pnpm',
@@ -58,11 +64,11 @@ async function run() {
'build-dts',
...(targets.length
? ['--environment', `TARGETS:${resolvedTargets.join(',')}`]
- : [])
+ : []),
],
{
- stdio: 'inherit'
- }
+ stdio: 'inherit',
+ },
)
}
} finally {
@@ -70,19 +76,36 @@ async function run() {
}
}
+/**
+ * Builds all the targets in parallel.
+ * @param {Array} targets - An array of targets to build.
+ * @returns {Promise} - A promise representing the build process.
+ */
async function buildAll(targets) {
await runParallel(cpus().length, targets, build)
}
+/**
+ * Runs iterator function in parallel.
+ * @template T - The type of items in the data source
+ * @param {number} maxConcurrency - The maximum concurrency.
+ * @param {Array} source - The data source
+ * @param {(item: T) => Promise} iteratorFn - The iteratorFn
+ * @returns {Promise} - A Promise array containing all iteration results.
+ */
async function runParallel(maxConcurrency, source, iteratorFn) {
+ /**@type {Promise[]} */
const ret = []
+ /**@type {Promise[]} */
const executing = []
for (const item of source) {
- const p = Promise.resolve().then(() => iteratorFn(item, source))
+ const p = Promise.resolve().then(() => iteratorFn(item))
ret.push(p)
if (maxConcurrency <= source.length) {
- const e = p.then(() => executing.splice(executing.indexOf(e), 1))
+ const e = p.then(() => {
+ executing.splice(executing.indexOf(e), 1)
+ })
executing.push(e)
if (executing.length >= maxConcurrency) {
await Promise.race(executing)
@@ -91,7 +114,11 @@ async function runParallel(maxConcurrency, source, iteratorFn) {
}
return Promise.all(ret)
}
-
+/**
+ * Builds the target.
+ * @param {string} target - The target to build.
+ * @returns {Promise} - A promise representing the build process.
+ */
async function build(target) {
const pkgDir = path.resolve(`packages/${target}`)
const pkg = require(`${pkgDir}/package.json`)
@@ -120,48 +147,76 @@ async function build(target) {
`TARGET:${target}`,
formats ? `FORMATS:${formats}` : ``,
prodOnly ? `PROD_ONLY:true` : ``,
- sourceMap ? `SOURCE_MAP:true` : ``
+ sourceMap ? `SOURCE_MAP:true` : ``,
]
.filter(Boolean)
- .join(',')
+ .join(','),
],
- { stdio: 'inherit' }
+ { stdio: 'inherit' },
)
}
-function checkAllSizes(targets) {
+/**
+ * Checks the sizes of all targets.
+ * @param {string[]} targets - The targets to check sizes for.
+ * @returns {Promise}
+ */
+async function checkAllSizes(targets) {
if (devOnly || (formats && !formats.includes('global'))) {
return
}
console.log()
for (const target of targets) {
- checkSize(target)
+ await checkSize(target)
}
console.log()
}
-function checkSize(target) {
+/**
+ * Checks the size of a target.
+ * @param {string} target - The target to check the size for.
+ * @returns {Promise}
+ */
+async function checkSize(target) {
const pkgDir = path.resolve(`packages/${target}`)
- checkFileSize(`${pkgDir}/dist/${target}.global.prod.js`)
+ await checkFileSize(`${pkgDir}/dist/${target}.global.prod.js`)
if (!formats || formats.includes('global-runtime')) {
- checkFileSize(`${pkgDir}/dist/${target}.runtime.global.prod.js`)
+ await checkFileSize(`${pkgDir}/dist/${target}.runtime.global.prod.js`)
}
}
-function checkFileSize(filePath) {
+/**
+ * Checks the file size.
+ * @param {string} filePath - The path of the file to check the size for.
+ * @returns {Promise}
+ */
+async function checkFileSize(filePath) {
if (!existsSync(filePath)) {
return
}
- const file = readFileSync(filePath)
- const minSize = (file.length / 1024).toFixed(2) + 'kb'
+ const file = await fs.readFile(filePath)
+ const fileName = path.basename(filePath)
+
const gzipped = gzipSync(file)
- const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
- const compressed = brotliCompressSync(file)
- // @ts-ignore
- const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
+ const brotli = brotliCompressSync(file)
+
console.log(
- `${chalk.gray(
- chalk.bold(path.basename(filePath))
- )} min:${minSize} / gzip:${gzippedSize} / brotli:${compressedSize}`
+ `${pico.gray(pico.bold(fileName))} min:${prettyBytes(
+ file.length,
+ )} / gzip:${prettyBytes(gzipped.length)} / brotli:${prettyBytes(
+ brotli.length,
+ )}`,
)
+
+ if (writeSize)
+ await fs.writeFile(
+ path.resolve(sizeDir, `${fileName}.json`),
+ JSON.stringify({
+ file: fileName,
+ size: file.length,
+ gzip: gzipped.length,
+ brotli: brotli.length,
+ }),
+ 'utf-8',
+ )
}
diff --git a/scripts/const-enum.js b/scripts/const-enum.js
deleted file mode 100644
index 8feb5f9f750..00000000000
--- a/scripts/const-enum.js
+++ /dev/null
@@ -1,255 +0,0 @@
-// @ts-check
-
-/**
- * We use rollup-plugin-esbuild for faster builds, but esbuild in insolation
- * mode compiles const enums into runtime enums, bloating bundle size.
- *
- * Here we pre-process all the const enums in the project and turn them into
- * global replacements, and remove the original declarations and re-exports.
- *
- * This erases the const enums before the esbuild transform so that we can
- * leverage esbuild's speed while retaining the DX and bundle size benefits
- * of const enums.
- *
- * This file is expected to be executed with project root as cwd.
- */
-
-import execa from 'execa'
-import {
- existsSync,
- mkdirSync,
- readFileSync,
- rmSync,
- writeFileSync
-} from 'node:fs'
-import { parse } from '@babel/parser'
-import path from 'node:path'
-import MagicString from 'magic-string'
-
-const ENUM_CACHE_PATH = 'temp/enum.json'
-
-function evaluate(exp) {
- return new Function(`return ${exp}`)()
-}
-
-// this is called in the build script entry once
-// so the data can be shared across concurrent Rollup processes
-export function scanEnums() {
- /**
- * @type {{ ranges: Record, defines: Record, ids: string[] }}
- */
- const enumData = {
- ranges: {},
- defines: {},
- ids: []
- }
-
- // 1. grep for files with exported const enum
- const { stdout } = execa.sync('git', ['grep', `export const enum`])
- const files = [...new Set(stdout.split('\n').map(line => line.split(':')[0]))]
-
- // 2. parse matched files to collect enum info
- for (const relativeFile of files) {
- const file = path.resolve(process.cwd(), relativeFile)
- const content = readFileSync(file, 'utf-8')
- const ast = parse(content, {
- plugins: ['typescript'],
- sourceType: 'module'
- })
-
- for (const node of ast.program.body) {
- if (
- node.type === 'ExportNamedDeclaration' &&
- node.declaration &&
- node.declaration.type === 'TSEnumDeclaration'
- ) {
- if (file in enumData.ranges) {
- // @ts-ignore
- enumData.ranges[file].push([node.start, node.end])
- } else {
- // @ts-ignore
- enumData.ranges[file] = [[node.start, node.end]]
- }
-
- const decl = node.declaration
- let lastInitialized
- for (let i = 0; i < decl.members.length; i++) {
- const e = decl.members[i]
- const id = decl.id.name
- if (!enumData.ids.includes(id)) {
- enumData.ids.push(id)
- }
- const key = e.id.type === 'Identifier' ? e.id.name : e.id.value
- const fullKey = `${id}.${key}`
- const saveValue = value => {
- if (fullKey in enumData.defines) {
- throw new Error(`name conflict for enum ${id} in ${file}`)
- }
- enumData.defines[fullKey] = JSON.stringify(value)
- }
- const init = e.initializer
- if (init) {
- let value
- if (
- init.type === 'StringLiteral' ||
- init.type === 'NumericLiteral'
- ) {
- value = init.value
- }
-
- // e.g. 1 << 2
- if (init.type === 'BinaryExpression') {
- const resolveValue = node => {
- if (
- node.type === 'NumericLiteral' ||
- node.type === 'StringLiteral'
- ) {
- return node.value
- } else if (node.type === 'MemberExpression') {
- const exp = content.slice(node.start, node.end)
- if (!(exp in enumData.defines)) {
- throw new Error(
- `unhandled enum initialization expression ${exp} in ${file}`
- )
- }
- return enumData.defines[exp]
- } else {
- throw new Error(
- `unhandled BinaryExpression operand type ${node.type} in ${file}`
- )
- }
- }
- const exp = `${resolveValue(init.left)}${
- init.operator
- }${resolveValue(init.right)}`
- value = evaluate(exp)
- }
-
- if (init.type === 'UnaryExpression') {
- if (
- init.argument.type === 'StringLiteral' ||
- init.argument.type === 'NumericLiteral'
- ) {
- const exp = `${init.operator}${init.argument.value}`
- value = evaluate(exp)
- } else {
- throw new Error(
- `unhandled UnaryExpression argument type ${init.argument.type} in ${file}`
- )
- }
- }
-
- if (value === undefined) {
- throw new Error(
- `unhandled initializer type ${init.type} for ${fullKey} in ${file}`
- )
- }
- saveValue(value)
- lastInitialized = value
- } else {
- if (lastInitialized === undefined) {
- // first initialized
- saveValue((lastInitialized = 0))
- } else if (typeof lastInitialized === 'number') {
- saveValue(++lastInitialized)
- } else {
- // should not happen
- throw new Error(`wrong enum initialization sequence in ${file}`)
- }
- }
- }
- }
- }
- }
-
- // 3. save cache
- if (!existsSync('temp')) mkdirSync('temp')
- writeFileSync(ENUM_CACHE_PATH, JSON.stringify(enumData))
-
- return () => {
- rmSync(ENUM_CACHE_PATH, { force: true })
- }
-}
-
-/**
- * @returns {[import('rollup').Plugin, Record]}
- */
-export function constEnum() {
- if (!existsSync(ENUM_CACHE_PATH)) {
- throw new Error('enum cache needs to be initialized before creating plugin')
- }
- /**
- * @type {{ ranges: Record, defines: Record, ids: string[] }}
- */
- const enumData = JSON.parse(readFileSync(ENUM_CACHE_PATH, 'utf-8'))
-
- // construct a regex for matching re-exports of known const enums
- const reExportsRE = new RegExp(
- `export {[^}]*?\\b(${enumData.ids.join('|')})\\b[^]*?}`
- )
-
- // 3. during transform:
- // 3.1 files w/ const enum declaration: remove delcaration
- // 3.2 files using const enum: inject into esbuild define
- /**
- * @type {import('rollup').Plugin}
- */
- const plugin = {
- name: 'remove-const-enum',
- transform(code, id) {
- let s
-
- if (id in enumData.ranges) {
- s = s || new MagicString(code)
- for (const [start, end] of enumData.ranges[id]) {
- s.remove(start, end)
- }
- }
-
- // check for const enum re-exports that must be removed
- if (reExportsRE.test(code)) {
- s = s || new MagicString(code)
- const ast = parse(code, {
- plugins: ['typescript'],
- sourceType: 'module'
- })
- for (const node of ast.program.body) {
- if (
- node.type === 'ExportNamedDeclaration' &&
- node.exportKind !== 'type' &&
- node.source
- ) {
- for (let i = 0; i < node.specifiers.length; i++) {
- const spec = node.specifiers[i]
- if (
- spec.type === 'ExportSpecifier' &&
- spec.exportKind !== 'type' &&
- enumData.ids.includes(spec.local.name)
- ) {
- const next = node.specifiers[i + 1]
- if (next) {
- // @ts-ignore
- s.remove(spec.start, next.start)
- } else {
- // last one
- const prev = node.specifiers[i - 1]
- // @ts-ignore
- s.remove(prev ? prev.end : spec.start, spec.end)
- }
- }
- }
- }
- }
- }
-
- if (s) {
- return {
- code: s.toString(),
- map: s.generateMap()
- }
- }
- }
- }
-
- return [plugin, enumData.defines]
-}
diff --git a/scripts/dev.js b/scripts/dev.js
index 8342f5237b7..7db79442ee9 100644
--- a/scripts/dev.js
+++ b/scripts/dev.js
@@ -2,10 +2,10 @@
// Using esbuild for faster dev builds.
// We are still using Rollup for production builds because it generates
-// smaller files w/ better tree-shaking.
+// smaller files and provides better tree-shaking.
import esbuild from 'esbuild'
-import { resolve, relative, dirname } from 'node:path'
+import { dirname, relative, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { createRequire } from 'node:module'
import minimist from 'minimist'
@@ -14,115 +14,120 @@ import { polyfillNode } from 'esbuild-plugin-polyfill-node'
const require = createRequire(import.meta.url)
const __dirname = dirname(fileURLToPath(import.meta.url))
const args = minimist(process.argv.slice(2))
-const target = args._[0] || 'vue'
+const targets = args._.length ? args._ : ['vue']
const format = args.f || 'global'
+const prod = args.p || false
const inlineDeps = args.i || args.inline
-const pkg = require(`../packages/${target}/package.json`)
// resolve output
const outputFormat = format.startsWith('global')
? 'iife'
: format === 'cjs'
- ? 'cjs'
- : 'esm'
+ ? 'cjs'
+ : 'esm'
const postfix = format.endsWith('-runtime')
? `runtime.${format.replace(/-runtime$/, '')}`
: format
-const outfile = resolve(
- __dirname,
- `../packages/${target}/dist/${
- target === 'vue-compat' ? `vue` : target
- }.${postfix}.js`
-)
-const relativeOutfile = relative(process.cwd(), outfile)
+for (const target of targets) {
+ const pkg = require(`../packages/${target}/package.json`)
+ const outfile = resolve(
+ __dirname,
+ `../packages/${target}/dist/${
+ target === 'vue-compat' ? `vue` : target
+ }.${postfix}.${prod ? `prod.` : ``}js`,
+ )
+ const relativeOutfile = relative(process.cwd(), outfile)
-// resolve externals
-// TODO this logic is largely duplicated from rollup.config.js
-let external = []
-if (!inlineDeps) {
- // cjs & esm-bundler: external all deps
- if (format === 'cjs' || format.includes('esm-bundler')) {
- external = [
- ...external,
- ...Object.keys(pkg.dependencies || {}),
- ...Object.keys(pkg.peerDependencies || {}),
- // for @vue/compiler-sfc / server-renderer
- 'path',
- 'url',
- 'stream'
- ]
- }
+ // resolve externals
+ // TODO this logic is largely duplicated from rollup.config.js
+ /** @type {string[]} */
+ let external = []
+ if (!inlineDeps) {
+ // cjs & esm-bundler: external all deps
+ if (format === 'cjs' || format.includes('esm-bundler')) {
+ external = [
+ ...external,
+ ...Object.keys(pkg.dependencies || {}),
+ ...Object.keys(pkg.peerDependencies || {}),
+ // for @vue/compiler-sfc / server-renderer
+ 'path',
+ 'url',
+ 'stream',
+ ]
+ }
- if (target === 'compiler-sfc') {
- const consolidatePkgPath = require.resolve(
- '@vue/consolidate/package.json',
- {
- paths: [resolve(__dirname, `../packages/${target}/`)]
- }
- )
- const consolidateDeps = Object.keys(
- require(consolidatePkgPath).devDependencies
- )
- external = [
- ...external,
- ...consolidateDeps,
- 'fs',
- 'vm',
- 'crypto',
- 'react-dom/server',
- 'teacup/lib/express',
- 'arc-templates/dist/es5',
- 'then-pug',
- 'then-jade'
- ]
+ if (target === 'compiler-sfc') {
+ const consolidatePkgPath = require.resolve(
+ '@vue/consolidate/package.json',
+ {
+ paths: [resolve(__dirname, `../packages/${target}/`)],
+ },
+ )
+ const consolidateDeps = Object.keys(
+ require(consolidatePkgPath).devDependencies,
+ )
+ external = [
+ ...external,
+ ...consolidateDeps,
+ 'fs',
+ 'vm',
+ 'crypto',
+ 'react-dom/server',
+ 'teacup/lib/express',
+ 'arc-templates/dist/es5',
+ 'then-pug',
+ 'then-jade',
+ ]
+ }
}
-}
+ /** @type {Array} */
+ const plugins = [
+ {
+ name: 'log-rebuild',
+ setup(build) {
+ build.onEnd(() => {
+ console.log(`built: ${relativeOutfile}`)
+ })
+ },
+ },
+ ]
-const plugins = [
- {
- name: 'log-rebuild',
- setup(build) {
- build.onEnd(() => {
- console.log(`built: ${relativeOutfile}`)
- })
- }
+ if (format !== 'cjs' && pkg.buildOptions?.enableNonBrowserBranches) {
+ plugins.push(polyfillNode())
}
-]
-if (format === 'cjs' || pkg.buildOptions?.enableNonBrowserBranches) {
- plugins.push(polyfillNode())
+ esbuild
+ .context({
+ entryPoints: [resolve(__dirname, `../packages/${target}/src/index.ts`)],
+ outfile,
+ bundle: true,
+ external,
+ sourcemap: true,
+ format: outputFormat,
+ globalName: pkg.buildOptions?.name,
+ platform: format === 'cjs' ? 'node' : 'browser',
+ plugins,
+ define: {
+ __COMMIT__: `"dev"`,
+ __VERSION__: `"${pkg.version}"`,
+ __DEV__: prod ? `false` : `true`,
+ __TEST__: `false`,
+ __BROWSER__: String(
+ format !== 'cjs' && !pkg.buildOptions?.enableNonBrowserBranches,
+ ),
+ __GLOBAL__: String(format === 'global'),
+ __ESM_BUNDLER__: String(format.includes('esm-bundler')),
+ __ESM_BROWSER__: String(format.includes('esm-browser')),
+ __CJS__: String(format === 'cjs'),
+ __SSR__: String(format === 'cjs' || format.includes('esm-bundler')),
+ __COMPAT__: String(target === 'vue-compat'),
+ __FEATURE_SUSPENSE__: `true`,
+ __FEATURE_OPTIONS_API__: `true`,
+ __FEATURE_PROD_DEVTOOLS__: `false`,
+ __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: `false`,
+ },
+ })
+ .then(ctx => ctx.watch())
}
-
-esbuild
- .context({
- entryPoints: [resolve(__dirname, `../packages/${target}/src/index.ts`)],
- outfile,
- bundle: true,
- external,
- sourcemap: true,
- format: outputFormat,
- globalName: pkg.buildOptions?.name,
- platform: format === 'cjs' ? 'node' : 'browser',
- plugins,
- define: {
- __COMMIT__: `"dev"`,
- __VERSION__: `"${pkg.version}"`,
- __DEV__: `true`,
- __TEST__: `false`,
- __BROWSER__: String(
- format !== 'cjs' && !pkg.buildOptions?.enableNonBrowserBranches
- ),
- __GLOBAL__: String(format === 'global'),
- __ESM_BUNDLER__: String(format.includes('esm-bundler')),
- __ESM_BROWSER__: String(format.includes('esm-browser')),
- __NODE_JS__: String(format === 'cjs'),
- __SSR__: String(format === 'cjs' || format.includes('esm-bundler')),
- __COMPAT__: String(target === 'vue-compat'),
- __FEATURE_SUSPENSE__: `true`,
- __FEATURE_OPTIONS_API__: `true`,
- __FEATURE_PROD_DEVTOOLS__: `false`
- }
- })
- .then(ctx => ctx.watch())
diff --git a/scripts/inline-enums.js b/scripts/inline-enums.js
new file mode 100644
index 00000000000..40bd31bfd8a
--- /dev/null
+++ b/scripts/inline-enums.js
@@ -0,0 +1,279 @@
+// @ts-check
+
+/**
+ * We used const enums before, but it caused some issues: #1228, so we
+ * switched to regular enums. But we still want to keep the zero-cost benefit
+ * of const enums, and minimize the impact on bundle size as much as possible.
+ *
+ * Here we pre-process all the enums in the project and turn them into
+ * global replacements, and rewrite the original declarations as object literals.
+ *
+ * This file is expected to be executed with project root as cwd.
+ */
+
+import * as assert from 'node:assert'
+import {
+ existsSync,
+ mkdirSync,
+ readFileSync,
+ rmSync,
+ writeFileSync,
+} from 'node:fs'
+import * as path from 'node:path'
+import { parse } from '@babel/parser'
+import { execaSync } from 'execa'
+import MagicString from 'magic-string'
+
+/**
+ * @typedef {{ readonly name: string, readonly value: string | number }} EnumMember
+ * @typedef {{ readonly id: string, readonly range: readonly [start: number, end: number], readonly members: ReadonlyArray}} EnumDeclaration
+ * @typedef {{ readonly declarations: { readonly [file: string] : ReadonlyArray}, readonly defines: { readonly [ id_key: `${string}.${string}`]: string } }} EnumData
+ */
+
+const ENUM_CACHE_PATH = 'temp/enum.json'
+
+/**
+ * @param {string} exp
+ * @returns {string | number}
+ */
+function evaluate(exp) {
+ return new Function(`return ${exp}`)()
+}
+
+// this is called in the build script entry once
+// so the data can be shared across concurrent Rollup processes
+export function scanEnums() {
+ /** @type {{ [file: string]: EnumDeclaration[] }} */
+ const declarations = Object.create(null)
+ /** @type {{ [id_key: `${string}.${string}`]: string; }} */
+ const defines = Object.create(null)
+
+ // 1. grep for files with exported enum
+ const { stdout } = execaSync('git', ['grep', `export enum`])
+ const files = [...new Set(stdout.split('\n').map(line => line.split(':')[0]))]
+
+ // 2. parse matched files to collect enum info
+ for (const relativeFile of files) {
+ const file = path.resolve(process.cwd(), relativeFile)
+ const content = readFileSync(file, 'utf-8')
+ const ast = parse(content, {
+ plugins: ['typescript'],
+ sourceType: 'module',
+ })
+
+ /** @type {Set} */
+ const enumIds = new Set()
+ for (const node of ast.program.body) {
+ if (
+ node.type === 'ExportNamedDeclaration' &&
+ node.declaration &&
+ node.declaration.type === 'TSEnumDeclaration'
+ ) {
+ const decl = node.declaration
+ const id = decl.id.name
+ if (enumIds.has(id)) {
+ throw new Error(
+ `not support declaration merging for enum ${id} in ${file}`,
+ )
+ }
+ enumIds.add(id)
+ /** @type {string | number | undefined} */
+ let lastInitialized
+ /** @type {Array} */
+ const members = []
+
+ for (let i = 0; i < decl.members.length; i++) {
+ const e = decl.members[i]
+ const key = e.id.type === 'Identifier' ? e.id.name : e.id.value
+ const fullKey = /** @type {const} */ (`${id}.${key}`)
+ const saveValue = (/** @type {string | number} */ value) => {
+ // We need allow same name enum in different file.
+ // For example: enum ErrorCodes exist in both @vue/compiler-core and @vue/runtime-core
+ // But not allow `ErrorCodes.__EXTEND_POINT__` appear in two same name enum
+ if (fullKey in defines) {
+ throw new Error(`name conflict for enum ${id} in ${file}`)
+ }
+ members.push({
+ name: key,
+ value,
+ })
+ defines[fullKey] = JSON.stringify(value)
+ }
+ const init = e.initializer
+ if (init) {
+ /** @type {string | number} */
+ let value
+ if (
+ init.type === 'StringLiteral' ||
+ init.type === 'NumericLiteral'
+ ) {
+ value = init.value
+ }
+ // e.g. 1 << 2
+ else if (init.type === 'BinaryExpression') {
+ const resolveValue = (
+ /** @type {import('@babel/types').Expression | import('@babel/types').PrivateName} */ node,
+ ) => {
+ assert.ok(typeof node.start === 'number')
+ assert.ok(typeof node.end === 'number')
+ if (
+ node.type === 'NumericLiteral' ||
+ node.type === 'StringLiteral'
+ ) {
+ return node.value
+ } else if (node.type === 'MemberExpression') {
+ const exp = /** @type {`${string}.${string}`} */ (
+ content.slice(node.start, node.end)
+ )
+ if (!(exp in defines)) {
+ throw new Error(
+ `unhandled enum initialization expression ${exp} in ${file}`,
+ )
+ }
+ return defines[exp]
+ } else {
+ throw new Error(
+ `unhandled BinaryExpression operand type ${node.type} in ${file}`,
+ )
+ }
+ }
+ const exp = `${resolveValue(init.left)}${
+ init.operator
+ }${resolveValue(init.right)}`
+ value = evaluate(exp)
+ } else if (init.type === 'UnaryExpression') {
+ if (
+ init.argument.type === 'StringLiteral' ||
+ init.argument.type === 'NumericLiteral'
+ ) {
+ const exp = `${init.operator}${init.argument.value}`
+ value = evaluate(exp)
+ } else {
+ throw new Error(
+ `unhandled UnaryExpression argument type ${init.argument.type} in ${file}`,
+ )
+ }
+ } else {
+ throw new Error(
+ `unhandled initializer type ${init.type} for ${fullKey} in ${file}`,
+ )
+ }
+ lastInitialized = value
+ saveValue(lastInitialized)
+ } else {
+ if (lastInitialized === undefined) {
+ // first initialized
+ lastInitialized = 0
+ saveValue(lastInitialized)
+ } else if (typeof lastInitialized === 'number') {
+ lastInitialized++
+ saveValue(lastInitialized)
+ } else {
+ // should not happen
+ throw new Error(`wrong enum initialization sequence in ${file}`)
+ }
+ }
+ }
+
+ if (!(file in declarations)) {
+ declarations[file] = []
+ }
+ assert.ok(typeof node.start === 'number')
+ assert.ok(typeof node.end === 'number')
+ declarations[file].push({
+ id,
+ range: [node.start, node.end],
+ members,
+ })
+ }
+ }
+ }
+
+ // 3. save cache
+ if (!existsSync('temp')) mkdirSync('temp')
+
+ /** @type {EnumData} */
+ const enumData = {
+ declarations,
+ defines,
+ }
+
+ writeFileSync(ENUM_CACHE_PATH, JSON.stringify(enumData))
+
+ return () => {
+ rmSync(ENUM_CACHE_PATH, { force: true })
+ }
+}
+
+/**
+ * @returns {[import('rollup').Plugin, Record]}
+ */
+export function inlineEnums() {
+ if (!existsSync(ENUM_CACHE_PATH)) {
+ throw new Error('enum cache needs to be initialized before creating plugin')
+ }
+ /**
+ * @type {EnumData}
+ */
+ const enumData = JSON.parse(readFileSync(ENUM_CACHE_PATH, 'utf-8'))
+
+ // 3. during transform:
+ // 3.1 files w/ enum declaration: rewrite declaration as object literal
+ // 3.2 files using enum: inject into esbuild define
+ /**
+ * @type {import('rollup').Plugin}
+ */
+ const plugin = {
+ name: 'inline-enum',
+ transform(code, id) {
+ /**
+ * @type {MagicString | undefined}
+ */
+ let s
+
+ if (id in enumData.declarations) {
+ s = s || new MagicString(code)
+ for (const declaration of enumData.declarations[id]) {
+ const {
+ range: [start, end],
+ id,
+ members,
+ } = declaration
+ s.update(
+ start,
+ end,
+ `export const ${id} = {${members
+ .flatMap(({ name, value }) => {
+ const forwardMapping =
+ JSON.stringify(name) + ': ' + JSON.stringify(value)
+ const reverseMapping =
+ JSON.stringify(value.toString()) + ': ' + JSON.stringify(name)
+
+ // see https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings
+ return typeof value === 'string'
+ ? [
+ forwardMapping,
+ // string enum members do not get a reverse mapping generated at all
+ ]
+ : [
+ forwardMapping,
+ // other enum members should support enum reverse mapping
+ reverseMapping,
+ ]
+ })
+ .join(',\n')}}`,
+ )
+ }
+ }
+
+ if (s) {
+ return {
+ code: s.toString(),
+ map: s.generateMap(),
+ }
+ }
+ },
+ }
+
+ return [plugin, enumData.defines]
+}
diff --git a/scripts/pre-dev-sfc.js b/scripts/pre-dev-sfc.js
index b9b3a534460..b28705f3464 100644
--- a/scripts/pre-dev-sfc.js
+++ b/scripts/pre-dev-sfc.js
@@ -6,8 +6,7 @@ const packagesToCheck = [
'compiler-core',
'compiler-dom',
'compiler-ssr',
- 'reactivity-transform',
- 'shared'
+ 'shared',
]
let allFilesPresent = true
@@ -15,7 +14,7 @@ let allFilesPresent = true
for (const pkg of packagesToCheck) {
if (
!fs.existsSync(
- new URL(`../packages/${pkg}/dist/${pkg}.cjs.js`, import.meta.url)
+ new URL(`../packages/${pkg}/dist/${pkg}.cjs.js`, import.meta.url),
)
) {
allFilesPresent = false
diff --git a/scripts/preinstall.js b/scripts/preinstall.js
deleted file mode 100644
index 05823d5f5d0..00000000000
--- a/scripts/preinstall.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// @ts-check
-if (!/pnpm/.test(process.env.npm_execpath || '')) {
- console.warn(
- `\u001b[33mThis repository requires using pnpm as the package manager ` +
- ` for scripts to work properly.\u001b[39m\n`
- )
- process.exit(1)
-}
diff --git a/scripts/release.js b/scripts/release.js
index 2c91cbbafac..6a962e07adf 100644
--- a/scripts/release.js
+++ b/scripts/release.js
@@ -2,19 +2,39 @@
import minimist from 'minimist'
import fs from 'node:fs'
import path from 'node:path'
-import chalk from 'chalk'
+import pico from 'picocolors'
import semver from 'semver'
import enquirer from 'enquirer'
-import execa from 'execa'
+import { execa } from 'execa'
import { createRequire } from 'node:module'
import { fileURLToPath } from 'node:url'
+/**
+ * @typedef {{
+ * name: string
+ * version: string
+ * dependencies?: { [dependenciesPackageName: string]: string }
+ * peerDependencies?: { [peerDependenciesPackageName: string]: string }
+ * }} Package
+ */
+
+let versionUpdated = false
+
const { prompt } = enquirer
const currentVersion = createRequire(import.meta.url)('../package.json').version
const __dirname = path.dirname(fileURLToPath(import.meta.url))
-const args = minimist(process.argv.slice(2))
+const args = minimist(process.argv.slice(2), {
+ alias: {
+ skipBuild: 'skip-build',
+ skipTests: 'skip-tests',
+ skipGit: 'skip-git',
+ skipPrompts: 'skip-prompts',
+ },
+})
+
const preId = args.preid || semver.prerelease(currentVersion)?.[0]
const isDryRun = args.dry
+/** @type {boolean | undefined} */
let skipTests = args.skipTests
const skipBuild = args.skipBuild
const isCanary = args.canary
@@ -23,9 +43,17 @@ const skipGit = args.skipGit || args.canary
const packages = fs
.readdirSync(path.resolve(__dirname, '../packages'))
- .filter(p => !p.endsWith('.ts') && !p.startsWith('.'))
+ .filter(p => {
+ const pkgRoot = path.resolve(__dirname, '../packages', p)
+ if (fs.statSync(pkgRoot).isDirectory()) {
+ const pkg = JSON.parse(
+ fs.readFileSync(path.resolve(pkgRoot, 'package.json'), 'utf-8'),
+ )
+ return !pkg.private
+ }
+ })
-const isCorePackage = pkgName => {
+const isCorePackage = (/** @type {string} */ pkgName) => {
if (!pkgName) return
if (pkgName === 'vue' || pkgName === '@vue/compat') {
@@ -38,7 +66,7 @@ const isCorePackage = pkgName => {
)
}
-const renamePackageToCanary = pkgName => {
+const renamePackageToCanary = (/** @type {string} */ pkgName) => {
if (pkgName === 'vue') {
return '@vue/canary'
}
@@ -50,31 +78,49 @@ const renamePackageToCanary = pkgName => {
return pkgName
}
-const keepThePackageName = pkgName => pkgName
+const keepThePackageName = (/** @type {string} */ pkgName) => pkgName
+/** @type {string[]} */
const skippedPackages = []
+/** @type {ReadonlyArray} */
const versionIncrements = [
'patch',
'minor',
'major',
- ...(preId ? ['prepatch', 'preminor', 'premajor', 'prerelease'] : [])
+ ...(preId
+ ? /** @type {const} */ (['prepatch', 'preminor', 'premajor', 'prerelease'])
+ : []),
]
-const inc = i => semver.inc(currentVersion, i, preId)
-const run = (bin, args, opts = {}) =>
- execa(bin, args, { stdio: 'inherit', ...opts })
-const dryRun = (bin, args, opts = {}) =>
- console.log(chalk.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts)
+const inc = (/** @type {import('semver').ReleaseType} */ i) =>
+ semver.inc(currentVersion, i, preId)
+const run = async (
+ /** @type {string} */ bin,
+ /** @type {ReadonlyArray} */ args,
+ /** @type {import('execa').Options} */ opts = {},
+) => execa(bin, args, { stdio: 'inherit', ...opts })
+const dryRun = async (
+ /** @type {string} */ bin,
+ /** @type {ReadonlyArray} */ args,
+ /** @type {import('execa').Options} */ opts = {},
+) => console.log(pico.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts)
const runIfNotDry = isDryRun ? dryRun : run
-const getPkgRoot = pkg => path.resolve(__dirname, '../packages/' + pkg)
-const step = msg => console.log(chalk.cyan(msg))
+const getPkgRoot = (/** @type {string} */ pkg) =>
+ path.resolve(__dirname, '../packages/' + pkg)
+const step = (/** @type {string} */ msg) => console.log(pico.cyan(msg))
async function main() {
+ if (!(await isInSyncWithRemote())) {
+ return
+ } else {
+ console.log(`${pico.green(`✓`)} commit is up-to-date with rmeote.\n`)
+ }
+
let targetVersion = args._[0]
if (isCanary) {
- // The canary version string format is `3.yyyyMMdd.0`.
+ // The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
// Use UTC date so that it's consistent across CI and maintainers' machines
const date = new Date()
const yyyy = date.getUTCFullYear()
@@ -82,9 +128,13 @@ async function main() {
const dd = date.getUTCDate().toString().padStart(2, '0')
const major = semver.major(currentVersion)
- const minor = `${yyyy}${MM}${dd}`
- const patch = 0
- let canaryVersion = `${major}.${minor}.${patch}`
+ const datestamp = `${yyyy}${MM}${dd}`
+ let canaryVersion
+
+ canaryVersion = `${major}.${datestamp}.0`
+ if (args.tag && args.tag !== 'latest') {
+ canaryVersion = `${major}.${datestamp}.0-${args.tag}.0`
+ }
// check the registry to avoid version collision
// in case we need to publish more than one canary versions in a day
@@ -93,17 +143,23 @@ async function main() {
const { stdout } = await run(
'pnpm',
['view', `${pkgName}@~${canaryVersion}`, 'version', '--json'],
- { stdio: 'pipe' }
+ { stdio: 'pipe' },
)
let versions = JSON.parse(stdout)
versions = Array.isArray(versions) ? versions : [versions]
const latestSameDayPatch = /** @type {string} */ (
semver.maxSatisfying(versions, `~${canaryVersion}`)
)
+
canaryVersion = /** @type {string} */ (
semver.inc(latestSameDayPatch, 'patch')
)
- } catch (e) {
+ if (args.tag && args.tag !== 'latest') {
+ canaryVersion = /** @type {string} */ (
+ semver.inc(latestSameDayPatch, 'prerelease', args.tag)
+ )
+ }
+ } catch (/** @type {any} */ e) {
if (/E404/.test(e.message)) {
// the first patch version on that day
} else {
@@ -116,25 +172,27 @@ async function main() {
if (!targetVersion) {
// no explicit version, offer suggestions
- // @ts-ignore
+ /** @type {{ release: string }} */
const { release } = await prompt({
type: 'select',
name: 'release',
message: 'Select release type',
- choices: versionIncrements.map(i => `${i} (${inc(i)})`).concat(['custom'])
+ choices: versionIncrements
+ .map(i => `${i} (${inc(i)})`)
+ .concat(['custom']),
})
if (release === 'custom') {
+ /** @type {{ version: string }} */
const result = await prompt({
type: 'input',
name: 'version',
message: 'Input custom version',
- initial: currentVersion
+ initial: currentVersion,
})
- // @ts-ignore
targetVersion = result.version
} else {
- targetVersion = release.match(/\((.*)\)/)[1]
+ targetVersion = release.match(/\((.*)\)/)?.[1] ?? ''
}
}
@@ -146,14 +204,14 @@ async function main() {
step(
isCanary
? `Releasing canary version v${targetVersion}...`
- : `Releasing v${targetVersion}...`
+ : `Releasing v${targetVersion}...`,
)
} else {
- // @ts-ignore
+ /** @type {{ yes: boolean }} */
const { yes: confirmRelease } = await prompt({
type: 'confirm',
name: 'yes',
- message: `Releasing v${targetVersion}. Confirm?`
+ message: `Releasing v${targetVersion}. Confirm?`,
})
if (!confirmRelease) {
@@ -167,11 +225,11 @@ async function main() {
skipTests ||= isCIPassed
if (isCIPassed && !skipPrompts) {
- // @ts-ignore
+ /** @type {{ yes: boolean }} */
const { yes: promptSkipTests } = await prompt({
type: 'confirm',
name: 'yes',
- message: `CI for this commit passed. Skip local tests?`
+ message: `CI for this commit passed. Skip local tests?`,
})
skipTests = promptSkipTests
@@ -193,8 +251,9 @@ async function main() {
step('\nUpdating cross dependencies...')
updateVersions(
targetVersion,
- isCanary ? renamePackageToCanary : keepThePackageName
+ isCanary ? renamePackageToCanary : keepThePackageName,
)
+ versionUpdated = true
// build all packages with types
step('\nBuilding all packages...')
@@ -211,11 +270,11 @@ async function main() {
await run(`pnpm`, ['run', 'changelog'])
if (!skipPrompts) {
- // @ts-ignore
+ /** @type {{ yes: boolean }} */
const { yes: changelogOk } = await prompt({
type: 'confirm',
name: 'yes',
- message: `Changelog generated. Does it look good?`
+ message: `Changelog generated. Does it look good?`,
})
if (!changelogOk) {
@@ -243,8 +302,23 @@ async function main() {
// publish packages
step('\nPublishing packages...')
+
+ const additionalPublishFlags = []
+ if (isDryRun) {
+ additionalPublishFlags.push('--dry-run')
+ }
+ if (skipGit) {
+ additionalPublishFlags.push('--no-git-checks')
+ }
+ // bypass the pnpm --publish-branch restriction which isn't too useful to us
+ // otherwise it leads to a prompt and blocks the release script
+ const branch = await getBranch()
+ if (branch !== 'main') {
+ additionalPublishFlags.push('--publish-branch', branch)
+ }
+
for (const pkg of packages) {
- await publishPackage(pkg, targetVersion)
+ await publishPackage(pkg, targetVersion, additionalPublishFlags)
}
// push to GitHub
@@ -261,11 +335,11 @@ async function main() {
if (skippedPackages.length) {
console.log(
- chalk.yellow(
+ pico.yellow(
`The following packages are skipped and NOT published:\n- ${skippedPackages.join(
- '\n- '
- )}`
- )
+ '\n- ',
+ )}`,
+ ),
)
}
console.log()
@@ -273,65 +347,116 @@ async function main() {
async function getCIResult() {
try {
- const { stdout: sha } = await execa('git', ['rev-parse', 'HEAD'])
+ const sha = await getSha()
const res = await fetch(
`https://api.github.com/repos/vuejs/core/actions/runs?head_sha=${sha}` +
- `&status=success&exclude_pull_requests=true`
+ `&status=success&exclude_pull_requests=true`,
)
const data = await res.json()
return data.workflow_runs.length > 0
} catch (e) {
+ console.error('Failed to get CI status for current commit.')
+ return false
+ }
+}
+
+async function isInSyncWithRemote() {
+ try {
+ const branch = await getBranch()
+ const res = await fetch(
+ `https://api.github.com/repos/vuejs/core/commits/${branch}?per_page=1`,
+ )
+ const data = await res.json()
+ if (data.sha === (await getSha())) {
+ return true
+ } else {
+ /** @type {{ yes: boolean }} */
+ const { yes } = await prompt({
+ type: 'confirm',
+ name: 'yes',
+ message: pico.red(
+ `Local HEAD is not up-to-date with remote. Are you sure you want to continue?`,
+ ),
+ })
+ return yes
+ }
+ } catch (e) {
+ console.error(
+ pico.red('Failed to check whether local HEAD is up-to-date with remote.'),
+ )
return false
}
}
+async function getSha() {
+ return (await execa('git', ['rev-parse', 'HEAD'])).stdout
+}
+
+async function getBranch() {
+ return (await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'])).stdout
+}
+
+/**
+ * @param {string} version
+ * @param {(pkgName: string) => string} getNewPackageName
+ */
function updateVersions(version, getNewPackageName = keepThePackageName) {
// 1. update root package.json
updatePackage(path.resolve(__dirname, '..'), version, getNewPackageName)
// 2. update all packages
packages.forEach(p =>
- updatePackage(getPkgRoot(p), version, getNewPackageName)
+ updatePackage(getPkgRoot(p), version, getNewPackageName),
)
}
+/**
+ * @param {string} pkgRoot
+ * @param {string} version
+ * @param {(pkgName: string) => string} getNewPackageName
+ */
function updatePackage(pkgRoot, version, getNewPackageName) {
const pkgPath = path.resolve(pkgRoot, 'package.json')
+ /** @type {Package} */
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
pkg.name = getNewPackageName(pkg.name)
pkg.version = version
- updateDeps(pkg, 'dependencies', version, getNewPackageName)
- updateDeps(pkg, 'peerDependencies', version, getNewPackageName)
+ if (isCanary) {
+ updateDeps(pkg, 'dependencies', version, getNewPackageName)
+ updateDeps(pkg, 'peerDependencies', version, getNewPackageName)
+ }
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
}
+/**
+ * @param {Package} pkg
+ * @param {'dependencies' | 'peerDependencies'} depType
+ * @param {string} version
+ * @param {(pkgName: string) => string} getNewPackageName
+ */
function updateDeps(pkg, depType, version, getNewPackageName) {
const deps = pkg[depType]
if (!deps) return
Object.keys(deps).forEach(dep => {
- if (deps[dep] === 'workspace:*') {
- return
- }
if (isCorePackage(dep)) {
const newName = getNewPackageName(dep)
const newVersion = newName === dep ? version : `npm:${newName}@${version}`
console.log(
- chalk.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`)
+ pico.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`),
)
deps[dep] = newVersion
}
})
}
-async function publishPackage(pkgName, version) {
+/**
+ * @param {string} pkgName
+ * @param {string} version
+ * @param {ReadonlyArray} additionalFlags
+ */
+async function publishPackage(pkgName, version, additionalFlags) {
if (skippedPackages.includes(pkgName)) {
return
}
- const pkgRoot = getPkgRoot(pkgName)
- const pkgPath = path.resolve(pkgRoot, 'package.json')
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
- if (pkg.private) {
- return
- }
let releaseTag = null
if (args.tag) {
@@ -346,6 +471,8 @@ async function publishPackage(pkgName, version) {
step(`Publishing ${pkgName}...`)
try {
+ // Don't change the package manager here as we rely on pnpm to handle
+ // workspace:* deps
await run(
'pnpm',
[
@@ -353,18 +480,17 @@ async function publishPackage(pkgName, version) {
...(releaseTag ? ['--tag', releaseTag] : []),
'--access',
'public',
- ...(isDryRun ? ['--dry-run'] : []),
- ...(skipGit ? ['--no-git-checks'] : [])
+ ...additionalFlags,
],
{
- cwd: pkgRoot,
- stdio: 'pipe'
- }
+ cwd: getPkgRoot(pkgName),
+ stdio: 'pipe',
+ },
)
- console.log(chalk.green(`Successfully published ${pkgName}@${version}`))
- } catch (e) {
+ console.log(pico.green(`Successfully published ${pkgName}@${version}`))
+ } catch (/** @type {any} */ e) {
if (e.stderr.match(/previously published/)) {
- console.log(chalk.red(`Skipping already published: ${pkgName}`))
+ console.log(pico.red(`Skipping already published: ${pkgName}`))
} else {
throw e
}
@@ -372,7 +498,10 @@ async function publishPackage(pkgName, version) {
}
main().catch(err => {
- updateVersions(currentVersion)
+ if (versionUpdated) {
+ // revert to current version on failed releases
+ updateVersions(currentVersion)
+ }
console.error(err)
process.exit(1)
})
diff --git a/scripts/setupVitest.ts b/scripts/setup-vitest.ts
similarity index 87%
rename from scripts/setupVitest.ts
rename to scripts/setup-vitest.ts
index c555b0fa5e8..d5c65f0d3c0 100644
--- a/scripts/setupVitest.ts
+++ b/scripts/setup-vitest.ts
@@ -1,4 +1,6 @@
-import { vi, type SpyInstance } from 'vitest'
+import type { MockInstance } from 'vitest'
+
+vi.stubGlobal('MathMLElement', class MathMLElement {})
expect.extend({
toHaveBeenWarned(received: string) {
@@ -7,7 +9,7 @@ expect.extend({
if (passed) {
return {
pass: true,
- message: () => `expected "${received}" not to have been warned.`
+ message: () => `expected "${received}" not to have been warned.`,
}
} else {
const msgs = warn.mock.calls.map(args => args[0]).join('\n - ')
@@ -17,7 +19,7 @@ expect.extend({
`expected "${received}" to have been warned` +
(msgs.length
? `.\n\nActual messages:\n\n - ${msgs}`
- : ` but no warning was recorded.`)
+ : ` but no warning was recorded.`),
}
}
},
@@ -29,14 +31,14 @@ expect.extend({
if (passed) {
return {
pass: true,
- message: () => `expected "${received}" not to have been warned last.`
+ message: () => `expected "${received}" not to have been warned last.`,
}
} else {
const msgs = warn.mock.calls.map(args => args[0]).join('\n - ')
return {
pass: false,
message: () =>
- `expected "${received}" to have been warned last.\n\nActual messages:\n\n - ${msgs}`
+ `expected "${received}" to have been warned last.\n\nActual messages:\n\n - ${msgs}`,
}
}
},
@@ -53,19 +55,19 @@ expect.extend({
if (found === n) {
return {
pass: true,
- message: () => `expected "${received}" to have been warned ${n} times.`
+ message: () => `expected "${received}" to have been warned ${n} times.`,
}
} else {
return {
pass: false,
message: () =>
- `expected "${received}" to have been warned ${n} times but got ${found}.`
+ `expected "${received}" to have been warned ${n} times but got ${found}.`,
}
}
- }
+ },
})
-let warn: SpyInstance
+let warn: MockInstance
const asserted: Set = new Set()
beforeEach(() => {
@@ -87,8 +89,8 @@ afterEach(() => {
if (nonAssertedWarnings.length) {
throw new Error(
`test case threw unexpected warnings:\n - ${nonAssertedWarnings.join(
- '\n - '
- )}`
+ '\n - ',
+ )}`,
)
}
})
diff --git a/scripts/size-report.ts b/scripts/size-report.ts
new file mode 100644
index 00000000000..a67aa3dd67c
--- /dev/null
+++ b/scripts/size-report.ts
@@ -0,0 +1,105 @@
+import path from 'node:path'
+import { markdownTable } from 'markdown-table'
+import prettyBytes from 'pretty-bytes'
+import { readdir } from 'node:fs/promises'
+import { existsSync } from 'node:fs'
+
+interface SizeResult {
+ size: number
+ gzip: number
+ brotli: number
+}
+
+interface BundleResult extends SizeResult {
+ file: string
+}
+
+type UsageResult = Record
+
+const currDir = path.resolve('temp/size')
+const prevDir = path.resolve('temp/size-prev')
+let output = '## Size Report\n\n'
+const sizeHeaders = ['Size', 'Gzip', 'Brotli']
+
+run()
+
+async function run() {
+ await renderFiles()
+ await renderUsages()
+
+ process.stdout.write(output)
+}
+
+async function renderFiles() {
+ const filterFiles = (files: string[]) =>
+ files.filter(file => !file.startsWith('_'))
+
+ const curr = filterFiles(await readdir(currDir))
+ const prev = existsSync(prevDir) ? filterFiles(await readdir(prevDir)) : []
+ const fileList = new Set([...curr, ...prev])
+
+ const rows: string[][] = []
+ for (const file of fileList) {
+ const currPath = path.resolve(currDir, file)
+ const prevPath = path.resolve(prevDir, file)
+
+ const curr = await importJSON(currPath)
+ const prev = await importJSON(prevPath)
+ const fileName = curr?.file || prev?.file || ''
+
+ if (!curr) {
+ rows.push([`~~${fileName}~~`])
+ } else
+ rows.push([
+ fileName,
+ `${prettyBytes(curr.size)}${getDiff(curr.size, prev?.size)}`,
+ `${prettyBytes(curr.gzip)}${getDiff(curr.gzip, prev?.gzip)}`,
+ `${prettyBytes(curr.brotli)}${getDiff(curr.brotli, prev?.brotli)}`,
+ ])
+ }
+
+ output += '### Bundles\n\n'
+ output += markdownTable([['File', ...sizeHeaders], ...rows])
+ output += '\n\n'
+}
+
+async function renderUsages() {
+ const curr = (await importJSON(
+ path.resolve(currDir, '_usages.json'),
+ ))!
+ const prev = await importJSON(
+ path.resolve(prevDir, '_usages.json'),
+ )
+ output += '\n### Usages\n\n'
+
+ const data = Object.values(curr)
+ .map(usage => {
+ const prevUsage = prev?.[usage.name]
+ const diffSize = getDiff(usage.size, prevUsage?.size)
+ const diffGzipped = getDiff(usage.gzip, prevUsage?.gzip)
+ const diffBrotli = getDiff(usage.brotli, prevUsage?.brotli)
+
+ return [
+ usage.name,
+ `${prettyBytes(usage.size)}${diffSize}`,
+ `${prettyBytes(usage.gzip)}${diffGzipped}`,
+ `${prettyBytes(usage.brotli)}${diffBrotli}`,
+ ]
+ })
+ .filter((usage): usage is string[] => !!usage)
+
+ output += `${markdownTable([['Name', ...sizeHeaders], ...data])}\n\n`
+}
+
+async function importJSON(path: string): Promise {
+ if (!existsSync(path)) return undefined
+ return (await import(path, { assert: { type: 'json' } })).default
+}
+
+function getDiff(curr: number, prev?: number) {
+ if (prev === undefined) return ''
+ const diff = curr - prev
+ if (diff === 0) return ''
+ const sign = diff > 0 ? '+' : ''
+ return ` (**${sign}${prettyBytes(diff)}**)`
+}
diff --git a/scripts/usage-size.ts b/scripts/usage-size.ts
new file mode 100644
index 00000000000..7eddbeb6696
--- /dev/null
+++ b/scripts/usage-size.ts
@@ -0,0 +1,100 @@
+import { mkdir, writeFile } from 'node:fs/promises'
+import path from 'node:path'
+import { rollup } from 'rollup'
+import nodeResolve from '@rollup/plugin-node-resolve'
+import { minify } from 'terser'
+import replace from '@rollup/plugin-replace'
+import { brotliCompressSync, gzipSync } from 'node:zlib'
+
+const sizeDir = path.resolve('temp/size')
+const entry = path.resolve('./packages/vue/dist/vue.runtime.esm-bundler.js')
+
+interface Preset {
+ name: string
+ imports: string[]
+}
+
+const presets: Preset[] = [
+ { name: 'createApp', imports: ['createApp'] },
+ { name: 'createSSRApp', imports: ['createSSRApp'] },
+ { name: 'defineCustomElement', imports: ['defineCustomElement'] },
+ {
+ name: 'overall',
+ imports: [
+ 'createApp',
+ 'ref',
+ 'watch',
+ 'Transition',
+ 'KeepAlive',
+ 'Suspense',
+ ],
+ },
+]
+
+main()
+
+async function main() {
+ const tasks: ReturnType[] = []
+ for (const preset of presets) {
+ tasks.push(generateBundle(preset))
+ }
+
+ const results = Object.fromEntries(
+ (await Promise.all(tasks)).map(r => [r.name, r]),
+ )
+
+ await mkdir(sizeDir, { recursive: true })
+ await writeFile(
+ path.resolve(sizeDir, '_usages.json'),
+ JSON.stringify(results),
+ 'utf-8',
+ )
+}
+
+async function generateBundle(preset: Preset) {
+ const id = 'virtual:entry'
+ const content = `export { ${preset.imports.join(', ')} } from '${entry}'`
+ const result = await rollup({
+ input: id,
+ plugins: [
+ {
+ name: 'usage-size-plugin',
+ resolveId(_id) {
+ if (_id === id) return id
+ return null
+ },
+ load(_id) {
+ if (_id === id) return content
+ },
+ },
+ nodeResolve(),
+ replace({
+ 'process.env.NODE_ENV': '"production"',
+ __VUE_PROD_DEVTOOLS__: 'false',
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
+ __VUE_OPTIONS_API__: 'true',
+ preventAssignment: true,
+ }),
+ ],
+ })
+
+ const generated = await result.generate({})
+ const bundled = generated.output[0].code
+ const minified = (
+ await minify(bundled, {
+ module: true,
+ toplevel: true,
+ })
+ ).code!
+
+ const size = minified.length
+ const gzip = gzipSync(minified).length
+ const brotli = brotliCompressSync(minified).length
+
+ return {
+ name: preset.name,
+ size,
+ gzip,
+ brotli,
+ }
+}
diff --git a/scripts/utils.js b/scripts/utils.js
index b58f25a1333..6c3844dd12c 100644
--- a/scripts/utils.js
+++ b/scripts/utils.js
@@ -1,12 +1,15 @@
// @ts-check
import fs from 'node:fs'
-import chalk from 'chalk'
+import pico from 'picocolors'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
export const targets = fs.readdirSync('packages').filter(f => {
- if (!fs.statSync(`packages/${f}`).isDirectory()) {
+ if (
+ !fs.statSync(`packages/${f}`).isDirectory() ||
+ !fs.existsSync(`packages/${f}/package.json`)
+ ) {
return false
}
const pkg = require(`../packages/${f}/package.json`)
@@ -16,7 +19,13 @@ export const targets = fs.readdirSync('packages').filter(f => {
return true
})
+/**
+ *
+ * @param {ReadonlyArray} partialTargets
+ * @param {boolean | undefined} includeAllMatching
+ */
export function fuzzyMatchTarget(partialTargets, includeAllMatching) {
+ /** @type {Array} */
const matched = []
partialTargets.forEach(partialTarget => {
for (const target of targets) {
@@ -33,9 +42,9 @@ export function fuzzyMatchTarget(partialTargets, includeAllMatching) {
} else {
console.log()
console.error(
- ` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
- `Target ${chalk.underline(partialTargets)} not found!`
- )}`
+ ` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(
+ `Target ${pico.underline(partialTargets.toString())} not found!`,
+ )}`,
)
console.log()
diff --git a/scripts/verify-commit.js b/scripts/verify-commit.js
new file mode 100644
index 00000000000..d37370df023
--- /dev/null
+++ b/scripts/verify-commit.js
@@ -0,0 +1,28 @@
+// @ts-check
+import pico from 'picocolors'
+import { readFileSync } from 'node:fs'
+import path from 'node:path'
+
+const msgPath = path.resolve('.git/COMMIT_EDITMSG')
+const msg = readFileSync(msgPath, 'utf-8').trim()
+
+const commitRE =
+ /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\(.+\))?: .{1,50}/
+
+if (!commitRE.test(msg)) {
+ console.log()
+ console.error(
+ ` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(
+ `invalid commit message format.`,
+ )}\n\n` +
+ pico.red(
+ ` Proper commit message format is required for automated changelog generation. Examples:\n\n`,
+ ) +
+ ` ${pico.green(`feat(compiler): add 'comments' option`)}\n` +
+ ` ${pico.green(
+ `fix(v-model): handle events on blur (close #28)`,
+ )}\n\n` +
+ pico.red(` See .github/commit-convention.md for more details.\n`),
+ )
+ process.exit(1)
+}
diff --git a/scripts/verify-treeshaking.js b/scripts/verify-treeshaking.js
new file mode 100644
index 00000000000..a93b8bbbd61
--- /dev/null
+++ b/scripts/verify-treeshaking.js
@@ -0,0 +1,49 @@
+// @ts-check
+import fs from 'node:fs'
+import { execa } from 'execa'
+
+execa('pnpm', ['build', 'vue', '-f', 'global-runtime']).then(() => {
+ const errors = []
+
+ const devBuild = fs.readFileSync(
+ 'packages/vue/dist/vue.runtime.global.js',
+ 'utf-8',
+ )
+
+ if (devBuild.includes('__spreadValues')) {
+ errors.push(
+ 'dev build contains unexpected esbuild object spread helper.\n' +
+ 'This means { ...obj } syntax is used in runtime code. This should be ' +
+ 'refactoed to use the `extend` helper to avoid the extra code.',
+ )
+ }
+
+ const prodBuild = fs.readFileSync(
+ 'packages/vue/dist/vue.runtime.global.prod.js',
+ 'utf-8',
+ )
+
+ if (prodBuild.includes('Vue warn')) {
+ errors.push(
+ 'prod build contains unexpected warning-related code.\n' +
+ 'This means there are calls of warn() that are not guarded by the __DEV__ condition.',
+ )
+ }
+
+ if (
+ prodBuild.includes('html,body,base') ||
+ prodBuild.includes('svg,animate,animateMotion') ||
+ prodBuild.includes('annotation,annotation-xml,maction')
+ ) {
+ errors.push(
+ 'prod build contains unexpected domTagConifg lists.\n' +
+ 'This means helpers like isHTMLTag() is used in runtime code paths when it should be compiler-only.',
+ )
+ }
+
+ if (errors.length) {
+ throw new Error(
+ `Found the following treeshaking errors:\n\n- ${errors.join('\n\n- ')}`,
+ )
+ }
+})
diff --git a/scripts/verifyCommit.js b/scripts/verifyCommit.js
deleted file mode 100644
index 4c1a2828bb8..00000000000
--- a/scripts/verifyCommit.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// @ts-check
-import chalk from 'chalk'
-import { readFileSync } from 'fs'
-import path from 'path'
-
-const msgPath = path.resolve('.git/COMMIT_EDITMSG')
-const msg = readFileSync(msgPath, 'utf-8').trim()
-
-const commitRE =
- /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\(.+\))?: .{1,50}/
-
-if (!commitRE.test(msg)) {
- console.log()
- console.error(
- ` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
- `invalid commit message format.`
- )}\n\n` +
- chalk.red(
- ` Proper commit message format is required for automated changelog generation. Examples:\n\n`
- ) +
- ` ${chalk.green(`feat(compiler): add 'comments' option`)}\n` +
- ` ${chalk.green(
- `fix(v-model): handle events on blur (close #28)`
- )}\n\n` +
- chalk.red(` See .github/commit-convention.md for more details.\n`)
- )
- process.exit(1)
-}
diff --git a/tsconfig.build.json b/tsconfig.build.json
index 8b7749b858b..954103c0f2f 100644
--- a/tsconfig.build.json
+++ b/tsconfig.build.json
@@ -2,14 +2,14 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
- "emitDeclarationOnly": true
+ "emitDeclarationOnly": true,
+ "stripInternal": true
},
"exclude": [
"packages/*/__tests__",
"packages/runtime-test",
"packages/template-explorer",
"packages/sfc-playground",
- "packages/size-check",
"packages/dts-test"
]
}
diff --git a/tsconfig.json b/tsconfig.json
index e575f0c4c90..f47b7fc8eb9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,8 +7,8 @@
"newLine": "LF",
"useDefineForClassFields": false,
"module": "esnext",
- "moduleResolution": "node",
- "allowJs": false,
+ "moduleResolution": "bundler",
+ "allowJs": true,
"strict": true,
"noUnusedLocals": true,
"experimentalDecorators": true,
@@ -34,6 +34,7 @@
"packages/*/__tests__",
"packages/dts-test",
"packages/vue/jsx-runtime",
- "scripts/setupVitest.ts"
+ "scripts/*",
+ "rollup.*.js"
]
}
diff --git a/vitest.config.ts b/vitest.config.ts
index e5d5f59345f..e6436408adb 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -1,5 +1,6 @@
-import { configDefaults, defineConfig, UserConfig } from 'vitest/config'
+import { configDefaults, defineConfig } from 'vitest/config'
import { entries } from './scripts/aliases.js'
+import codspeedPlugin from '@codspeed/vitest-plugin'
export default defineConfig({
define: {
@@ -10,26 +11,26 @@ export default defineConfig({
__GLOBAL__: false,
__ESM_BUNDLER__: true,
__ESM_BROWSER__: false,
- __NODE_JS__: true,
+ __CJS__: true,
__SSR__: true,
__FEATURE_OPTIONS_API__: true,
__FEATURE_SUSPENSE__: true,
__FEATURE_PROD_DEVTOOLS__: false,
- __COMPAT__: true
+ __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
+ __COMPAT__: true,
},
resolve: {
- alias: entries
+ alias: entries,
},
+ plugins: [codspeedPlugin()],
test: {
globals: true,
- // disable threads on GH actions to speed it up
- threads: !process.env.GITHUB_ACTIONS,
- setupFiles: 'scripts/setupVitest.ts',
+ setupFiles: 'scripts/setup-vitest.ts',
environmentMatchGlobs: [
- ['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom']
+ ['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom'],
],
sequence: {
- hooks: 'list'
+ hooks: 'list',
},
coverage: {
provider: 'istanbul',
@@ -39,8 +40,8 @@ export default defineConfig({
// DOM transitions are tested via e2e so no coverage is collected
'packages/runtime-dom/src/components/Transition*',
// mostly entries
- 'packages/vue-compat/**'
- ]
- }
- }
-}) as UserConfig
+ 'packages/vue-compat/**',
+ ],
+ },
+ },
+})
diff --git a/vitest.e2e.config.ts b/vitest.e2e.config.ts
index 8e168f65341..ecf1c9d95f0 100644
--- a/vitest.e2e.config.ts
+++ b/vitest.e2e.config.ts
@@ -1,10 +1,8 @@
-import { UserConfig } from 'vitest/config'
+import { mergeConfig } from 'vitest/config'
import config from './vitest.config'
-export default {
- ...config,
+export default mergeConfig(config, {
test: {
- ...config.test,
- include: ['packages/vue/__tests__/e2e/*.spec.ts']
- }
-} as UserConfig
+ include: ['packages/vue/__tests__/e2e/*.spec.ts'],
+ },
+})
diff --git a/vitest.unit.config.ts b/vitest.unit.config.ts
index 2094385dd8e..80549766c50 100644
--- a/vitest.unit.config.ts
+++ b/vitest.unit.config.ts
@@ -1,10 +1,8 @@
-import { UserConfig, configDefaults } from 'vitest/config'
+import { configDefaults, mergeConfig } from 'vitest/config'
import config from './vitest.config'
-export default {
- ...config,
+export default mergeConfig(config, {
test: {
- ...config.test,
- exclude: [...configDefaults.exclude, '**/e2e/**']
- }
-} as UserConfig
+ exclude: [...configDefaults.exclude, '**/e2e/**'],
+ },
+})