From: Evan You Date: Wed, 4 Dec 2024 06:22:26 +0000 (+0800) Subject: refactor: remove @vue/vapor package X-Git-Tag: v3.6.0-alpha.1~16^2~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a6915b587089dc7e822d732ac8d1f90dd55d689;p=thirdparty%2Fvuejs%2Fcore.git refactor: remove @vue/vapor package --- diff --git a/benchmark/client/App.vue b/benchmark/client/App.vue index 350cd7df10..428217aa97 100644 --- a/benchmark/client/App.vue +++ b/benchmark/client/App.vue @@ -4,7 +4,7 @@ import { triggerRef, type ShallowRef, createSelector, -} from '@vue/vapor' +} from 'vue/vapor' import { buildData } from './data' import { defer, wrap } from './profiling' diff --git a/benchmark/client/data.ts b/benchmark/client/data.ts index 91c3ba631f..2626bf1348 100644 --- a/benchmark/client/data.ts +++ b/benchmark/client/data.ts @@ -1,4 +1,4 @@ -import { shallowRef } from '@vue/vapor' +import { shallowRef } from 'vue/vapor' let ID = 1 diff --git a/benchmark/client/profiling.ts b/benchmark/client/profiling.ts index f4b5eaeb93..82d950a0f6 100644 --- a/benchmark/client/profiling.ts +++ b/benchmark/client/profiling.ts @@ -2,7 +2,7 @@ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-restricted-globals */ -import { nextTick } from '@vue/vapor' +import { nextTick } from 'vue/vapor' declare namespace globalThis { let doProfile: boolean diff --git a/benchmark/client/vapor.ts b/benchmark/client/vapor.ts index 68071a84c4..70f1d4b1b3 100644 --- a/benchmark/client/vapor.ts +++ b/benchmark/client/vapor.ts @@ -1,4 +1,4 @@ -import { createVaporApp } from '@vue/vapor' +import { createVaporApp } from 'vue/vapor' import App from './App.vue' createVaporApp(App as any).mount('#app') diff --git a/benchmark/index.js b/benchmark/index.js index eddf3b9036..f1a37cdff7 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -179,7 +179,6 @@ async function buildApp(isVapor) { }, resolve: { alias: { - '@vue/vapor': runtimePath, 'vue/vapor': runtimePath, vue: runtimePath, }, diff --git a/benchmark/tsconfig.json b/benchmark/tsconfig.json index c769cb57d5..535fcf2069 100644 --- a/benchmark/tsconfig.json +++ b/benchmark/tsconfig.json @@ -18,8 +18,6 @@ "noEmit": true, "paths": { "vue": ["../packages/vue/src"], - "@vue/vapor": ["../packages/vue-vapor/src"], - "vue/vapor": ["../packages/vue-vapor/src"], "@vue/*": ["../packages/*/src"] } }, diff --git a/packages/runtime-dom/src/index.ts b/packages/runtime-dom/src/index.ts index 4246b3ed0c..4f59f1f16a 100644 --- a/packages/runtime-dom/src/index.ts +++ b/packages/runtime-dom/src/index.ts @@ -230,9 +230,9 @@ function injectCompilerOptionsCheck(app: App) { /** * @internal */ -export function normalizeContainer( - container: Element | ShadowRoot | string, -): Element | ShadowRoot | null { +export function normalizeContainer( + container: T | string, +): T | null { if (isString(container)) { const res = document.querySelector(container) if (__DEV__ && !res) { @@ -240,7 +240,7 @@ export function normalizeContainer( `Failed to mount app: mount target selector "${container}" returned null.`, ) } - return res + return res as any } if ( __DEV__ && diff --git a/packages/runtime-vapor/src/apiCreateApp.ts b/packages/runtime-vapor/src/apiCreateApp.ts index 6ccd70b315..f1112e9a05 100644 --- a/packages/runtime-vapor/src/apiCreateApp.ts +++ b/packages/runtime-vapor/src/apiCreateApp.ts @@ -1,4 +1,3 @@ -import { normalizeContainer } from './_old/apiRender' import { insert } from './dom/element' import { type VaporComponent, createComponent } from './component' import { @@ -6,7 +5,8 @@ import { type AppUnmountFn, type CreateAppFunction, createAppAPI, -} from '@vue/runtime-core' + normalizeContainer, +} from '@vue/runtime-dom' let _createApp: CreateAppFunction @@ -32,7 +32,7 @@ export const createVaporApp: CreateAppFunction< const app = _createApp(comp) const mount = app.mount app.mount = (container, ...args: any[]) => { - container = normalizeContainer(container) // TODO reuse from runtime-dom + container = normalizeContainer(container) as ParentNode return mount(container, ...args) } return app diff --git a/packages/runtime-vapor/src/component.ts b/packages/runtime-vapor/src/component.ts index 2ef4730b68..17973b4076 100644 --- a/packages/runtime-vapor/src/component.ts +++ b/packages/runtime-vapor/src/component.ts @@ -11,7 +11,7 @@ import { nextUid, popWarningContext, pushWarningContext, -} from '@vue/runtime-core' +} from '@vue/runtime-dom' import type { Block } from './block' import { pauseTracking, resetTracking } from '@vue/reactivity' import { EMPTY_OBJ, isFunction } from '@vue/shared' diff --git a/packages/runtime-vapor/src/componentEmits.ts b/packages/runtime-vapor/src/componentEmits.ts index f792766a8e..4dbbf4f3bd 100644 --- a/packages/runtime-vapor/src/componentEmits.ts +++ b/packages/runtime-vapor/src/componentEmits.ts @@ -2,7 +2,7 @@ import { type EmitFn, type ObjectEmitsOptions, baseEmit, -} from '@vue/runtime-core' +} from '@vue/runtime-dom' import { type VaporComponent, type VaporComponentInstance, diff --git a/packages/runtime-vapor/src/componentProps.ts b/packages/runtime-vapor/src/componentProps.ts index 560f89240b..17fc893fc0 100644 --- a/packages/runtime-vapor/src/componentProps.ts +++ b/packages/runtime-vapor/src/componentProps.ts @@ -5,7 +5,7 @@ import { baseNormalizePropsOptions, isEmitListener, resolvePropValue, -} from '@vue/runtime-core' +} from '@vue/runtime-dom' import { normalizeEmitsOptions } from './componentEmits' export interface RawProps { diff --git a/packages/runtime-vapor/src/dom/prop.ts b/packages/runtime-vapor/src/dom/prop.ts index 4bcc5304ee..12b7f2a9da 100644 --- a/packages/runtime-vapor/src/dom/prop.ts +++ b/packages/runtime-vapor/src/dom/prop.ts @@ -12,7 +12,6 @@ import { shouldSetAsAttr, toDisplayString, } from '@vue/shared' -import { warn } from '../_old/warning' import { setStyle } from './style' import { MetadataKind, @@ -20,7 +19,8 @@ import { recordPropMetadata, } from '../componentMetadata' import { on } from './event' -import { currentInstance } from '../_old/component' +import { currentInstance } from '../component' +import { warn } from '@vue/runtime-dom' export function mergeInheritAttr(key: string, value: any): unknown { const instance = currentInstance! diff --git a/packages/runtime-vapor/src/dom/style.ts b/packages/runtime-vapor/src/dom/style.ts index 0e688dfb18..c0a0844da9 100644 --- a/packages/runtime-vapor/src/dom/style.ts +++ b/packages/runtime-vapor/src/dom/style.ts @@ -6,7 +6,7 @@ import { isString, normalizeStyle, } from '@vue/shared' -import { warn } from '../_old/warning' +import { warn } from '@vue/runtime-dom' import { recordPropMetadata } from '../componentMetadata' import { mergeInheritAttr } from './prop' diff --git a/packages/runtime-vapor/src/dom/templateRef.ts b/packages/runtime-vapor/src/dom/templateRef.ts index 271c8e3c3f..445b4a7925 100644 --- a/packages/runtime-vapor/src/dom/templateRef.ts +++ b/packages/runtime-vapor/src/dom/templateRef.ts @@ -1,10 +1,15 @@ import { type Ref, isRef, onScopeDispose } from '@vue/reactivity' import { - type ComponentInternalInstance, + type VaporComponentInstance, currentInstance, isVaporComponent, -} from '../_old/component' -import { VaporErrorCodes, callWithErrorHandling } from '../_old/errorHandling' +} from '../component' +import { + type SchedulerJob, + callWithErrorHandling, + queuePostFlushCb, + warn, +} from '@vue/runtime-dom' import { EMPTY_OBJ, hasOwn, @@ -13,11 +18,9 @@ import { isString, remove, } from '@vue/shared' -import { warn } from '../_old/warning' -import { type SchedulerJob, queuePostFlushCb } from '../_old/scheduler' export type NodeRef = string | Ref | ((ref: Element) => void) -export type RefEl = Element | ComponentInternalInstance +export type RefEl = Element | VaporComponentInstance /** * Function for handling a template ref @@ -29,6 +32,7 @@ export function setRef( refFor = false, ): NodeRef | undefined { if (!currentInstance) return + // @ts-expect-error TODO const { setupState, isUnmounted } = currentInstance if (isUnmounted) { @@ -46,7 +50,7 @@ export function setRef( if (oldRef != null && oldRef !== ref) { if (isString(oldRef)) { refs[oldRef] = null - if (hasOwn(setupState, oldRef)) { + if (setupState && hasOwn(setupState, oldRef)) { setupState[oldRef] = null } } else if (isRef(oldRef)) { @@ -59,7 +63,8 @@ export function setRef( callWithErrorHandling( ref, currentInstance, - VaporErrorCodes.FUNCTION_REF, + // @ts-expect-error + null, [value, refs], ) } @@ -126,7 +131,7 @@ export function setRef( }) }) } else if (__DEV__) { - warn('Invalid template ref type:', ref, `(${typeof ref})`) + // warn('Invalid template ref type:', ref, `(${typeof ref})`) } } return ref diff --git a/packages/runtime-vapor/src/renderEffect.ts b/packages/runtime-vapor/src/renderEffect.ts index 77220ec5b8..170f29bb4c 100644 --- a/packages/runtime-vapor/src/renderEffect.ts +++ b/packages/runtime-vapor/src/renderEffect.ts @@ -1,5 +1,5 @@ import { ReactiveEffect } from '@vue/reactivity' -import { type SchedulerJob, queueJob } from '@vue/runtime-core' +import { type SchedulerJob, queueJob } from '@vue/runtime-dom' import { currentInstance } from './component' export function renderEffect(fn: () => void): void { diff --git a/packages/vue-vapor/LICENSE b/packages/vue-vapor/LICENSE deleted file mode 100644 index 15f1f7e7a4..0000000000 --- a/packages/vue-vapor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018-present, Yuxi (Evan) You - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/vue-vapor/README.md b/packages/vue-vapor/README.md deleted file mode 100644 index ceb922d7cf..0000000000 --- a/packages/vue-vapor/README.md +++ /dev/null @@ -1 +0,0 @@ -# @vue/vapor diff --git a/packages/vue-vapor/__tests__/e2e/e2eUtils.ts b/packages/vue-vapor/__tests__/e2e/e2eUtils.ts deleted file mode 100644 index 8512dcaae4..0000000000 --- a/packages/vue-vapor/__tests__/e2e/e2eUtils.ts +++ /dev/null @@ -1,209 +0,0 @@ -import puppeteer, { - type Browser, - type ClickOptions, - type Page, - type PuppeteerLaunchOptions, -} from 'puppeteer' - -export const E2E_TIMEOUT: number = 30 * 1000 - -const puppeteerOptions: PuppeteerLaunchOptions = { - args: process.env.CI ? ['--no-sandbox', '--disable-setuid-sandbox'] : [], - headless: true, -} - -const maxTries = 30 -export const timeout = (n: number): Promise => - new Promise(r => setTimeout(r, n)) - -export async function expectByPolling( - poll: () => Promise, - expected: string, -): Promise { - for (let tries = 0; tries < maxTries; tries++) { - const actual = (await poll()) || '' - if (actual.indexOf(expected) > -1 || tries === maxTries - 1) { - expect(actual).toMatch(expected) - break - } else { - await timeout(50) - } - } -} - -interface PuppeteerUtils { - page: () => Page - click(selector: string, options?: ClickOptions): Promise - count(selector: string): Promise - text(selector: string): Promise - value(selector: string): Promise - html(selector: string): Promise - classList(selector: string): Promise - children(selector: string): Promise - isVisible(selector: string): Promise - isChecked(selector: string): Promise - isFocused(selector: string): Promise - setValue(selector: string, value: string): Promise - typeValue(selector: string, value: string): Promise - enterValue(selector: string, value: string): Promise - clearValue(selector: string): Promise - timeout(time: number): Promise - nextFrame(): Promise -} - -export function setupPuppeteer(args?: string[]): PuppeteerUtils { - let browser: Browser - let page: Page - - const resolvedOptions = args - ? { - ...puppeteerOptions, - args: [...puppeteerOptions.args!, ...args], - } - : puppeteerOptions - - beforeAll(async () => { - browser = await puppeteer.launch(resolvedOptions) - }, 20000) - - beforeEach(async () => { - page = await browser.newPage() - - await page.evaluateOnNewDocument(() => { - localStorage.clear() - }) - - page.on('console', e => { - if (e.type() === 'error') { - const err = e.args()[0] - console.error(`Error from Puppeteer-loaded page:\n`, err.remoteObject()) - } - }) - }) - - afterEach(async () => { - await page.close() - }) - - afterAll(async () => { - await browser.close() - }) - - async function click( - selector: string, - options?: ClickOptions, - ): Promise { - await page.click(selector, options) - } - - async function count(selector: string): Promise { - return (await page.$$(selector)).length - } - - async function text(selector: string): Promise { - return page.$eval(selector, node => node.textContent) - } - - async function value(selector: string): Promise { - return page.$eval(selector, node => (node as HTMLInputElement).value) - } - - async function html(selector: string): Promise { - return page.$eval(selector, node => node.innerHTML) - } - - async function classList(selector: string): Promise { - return page.$eval(selector, (node: any) => [...node.classList]) - } - - async function children(selector: string): Promise { - return page.$eval(selector, (node: any) => [...node.children]) - } - - async function isVisible(selector: string): Promise { - const display = await page.$eval(selector, node => { - return window.getComputedStyle(node).display - }) - return display !== 'none' - } - - async function isChecked(selector: string) { - return await page.$eval( - selector, - node => (node as HTMLInputElement).checked, - ) - } - - async function isFocused(selector: string) { - return await page.$eval(selector, node => node === document.activeElement) - } - - async function setValue(selector: string, value: string) { - await page.$eval( - selector, - (node, value) => { - ;(node as HTMLInputElement).value = value as string - node.dispatchEvent(new Event('input')) - }, - value, - ) - } - - async function typeValue(selector: string, value: string) { - const el = (await page.$(selector))! - await el.evaluate(node => ((node as HTMLInputElement).value = '')) - await el.type(value) - } - - async function enterValue(selector: string, value: string) { - const el = (await page.$(selector))! - await el.evaluate(node => ((node as HTMLInputElement).value = '')) - await el.type(value) - await el.press('Enter') - } - - async function clearValue(selector: string) { - return await page.$eval( - selector, - node => ((node as HTMLInputElement).value = ''), - ) - } - - function timeout(time: number) { - return page.evaluate(time => { - return new Promise(r => { - setTimeout(r, time) - }) - }, time) - } - - function nextFrame() { - return page.evaluate(() => { - return new Promise(resolve => { - requestAnimationFrame(() => { - requestAnimationFrame(resolve) - }) - }) - }) - } - - return { - page: () => page, - click, - count, - text, - value, - html, - classList, - children, - isVisible, - isChecked, - isFocused, - setValue, - typeValue, - enterValue, - clearValue, - timeout, - nextFrame, - } -} diff --git a/packages/vue-vapor/__tests__/e2e/todomvc.spec.ts b/packages/vue-vapor/__tests__/e2e/todomvc.spec.ts deleted file mode 100644 index c26079c06d..0000000000 --- a/packages/vue-vapor/__tests__/e2e/todomvc.spec.ts +++ /dev/null @@ -1,177 +0,0 @@ -import path from 'node:path' -import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils' - -describe('e2e: todomvc', () => { - const { - page, - click, - isVisible, - count, - text, - value, - isChecked, - isFocused, - classList, - enterValue, - clearValue, - } = setupPuppeteer() - - async function removeItemAt(n: number) { - const item = (await page().$('.todo:nth-child(' + n + ')'))! - const itemBBox = (await item.boundingBox())! - await page().mouse.move(itemBBox.x + 10, itemBBox.y + 10) - await click('.todo:nth-child(' + n + ') .destroy') - } - - async function testTodomvc(apiType: 'classic' | 'composition') { - let baseUrl = `../../examples/${apiType}/todomvc.html` - baseUrl = `file://${path.resolve(__dirname, baseUrl)}` - - await page().goto(baseUrl) - expect(await isVisible('.main')).toBe(false) - expect(await isVisible('.footer')).toBe(false) - expect(await count('.filters .selected')).toBe(1) - expect(await text('.filters .selected')).toBe('All') - expect(await count('.todo')).toBe(0) - - await enterValue('.new-todo', 'test') - expect(await count('.todo')).toBe(1) - expect(await isVisible('.todo .edit')).toBe(false) - expect(await text('.todo label')).toBe('test') - expect(await text('.todo-count strong')).toBe('1') - expect(await isChecked('.todo .toggle')).toBe(false) - expect(await isVisible('.main')).toBe(true) - expect(await isVisible('.footer')).toBe(true) - expect(await isVisible('.clear-completed')).toBe(false) - expect(await value('.new-todo')).toBe('') - - await enterValue('.new-todo', 'test2') - expect(await count('.todo')).toBe(2) - expect(await text('.todo:nth-child(2) label')).toBe('test2') - expect(await text('.todo-count strong')).toBe('2') - - // toggle - await click('.todo .toggle') - expect(await count('.todo.completed')).toBe(1) - expect(await classList('.todo:nth-child(1)')).toContain('completed') - expect(await text('.todo-count strong')).toBe('1') - expect(await isVisible('.clear-completed')).toBe(true) - - await enterValue('.new-todo', 'test3') - expect(await count('.todo')).toBe(3) - expect(await text('.todo:nth-child(3) label')).toBe('test3') - expect(await text('.todo-count strong')).toBe('2') - - await enterValue('.new-todo', 'test4') - await enterValue('.new-todo', 'test5') - expect(await count('.todo')).toBe(5) - expect(await text('.todo-count strong')).toBe('4') - - // toggle more - await click('.todo:nth-child(4) .toggle') - await click('.todo:nth-child(5) .toggle') - expect(await count('.todo.completed')).toBe(3) - expect(await text('.todo-count strong')).toBe('2') - - // remove - await removeItemAt(1) - expect(await count('.todo')).toBe(4) - expect(await count('.todo.completed')).toBe(2) - expect(await text('.todo-count strong')).toBe('2') - await removeItemAt(2) - expect(await count('.todo')).toBe(3) - expect(await count('.todo.completed')).toBe(2) - expect(await text('.todo-count strong')).toBe('1') - - // remove all - await click('.clear-completed') - expect(await count('.todo')).toBe(1) - expect(await text('.todo label')).toBe('test2') - expect(await count('.todo.completed')).toBe(0) - expect(await text('.todo-count strong')).toBe('1') - expect(await isVisible('.clear-completed')).toBe(false) - - // prepare to test filters - await enterValue('.new-todo', 'test') - await enterValue('.new-todo', 'test') - await click('.todo:nth-child(2) .toggle') - await click('.todo:nth-child(3) .toggle') - - // active filter - await click('.filters li:nth-child(2) a') - expect(await count('.todo')).toBe(1) - expect(await count('.todo.completed')).toBe(0) - // add item with filter active - await enterValue('.new-todo', 'test') - expect(await count('.todo')).toBe(2) - - // completed filter - await click('.filters li:nth-child(3) a') - expect(await count('.todo')).toBe(2) - expect(await count('.todo.completed')).toBe(2) - - // filter on page load - await page().goto(`${baseUrl}#active`) - expect(await count('.todo')).toBe(2) - expect(await count('.todo.completed')).toBe(0) - expect(await text('.todo-count strong')).toBe('2') - - // completed on page load - await page().goto(`${baseUrl}#completed`) - expect(await count('.todo')).toBe(2) - expect(await count('.todo.completed')).toBe(2) - expect(await text('.todo-count strong')).toBe('2') - - // toggling with filter active - await click('.todo .toggle') - expect(await count('.todo')).toBe(1) - await click('.filters li:nth-child(2) a') - expect(await count('.todo')).toBe(3) - await click('.todo .toggle') - expect(await count('.todo')).toBe(2) - - // editing triggered by blur - await click('.filters li:nth-child(1) a') - await click('.todo:nth-child(1) label', { clickCount: 2 }) - expect(await count('.todo.editing')).toBe(1) - expect(await isFocused('.todo:nth-child(1) .edit')).toBe(true) - await clearValue('.todo:nth-child(1) .edit') - await page().type('.todo:nth-child(1) .edit', 'edited!') - await click('.new-todo') // blur - expect(await count('.todo.editing')).toBe(0) - expect(await text('.todo:nth-child(1) label')).toBe('edited!') - - // editing triggered by enter - await click('.todo label', { clickCount: 2 }) - await enterValue('.todo:nth-child(1) .edit', 'edited again!') - expect(await count('.todo.editing')).toBe(0) - expect(await text('.todo:nth-child(1) label')).toBe('edited again!') - - // cancel - await click('.todo label', { clickCount: 2 }) - await clearValue('.todo:nth-child(1) .edit') - await page().type('.todo:nth-child(1) .edit', 'edited!') - await page().keyboard.press('Escape') - expect(await count('.todo.editing')).toBe(0) - expect(await text('.todo:nth-child(1) label')).toBe('edited again!') - - // empty value should remove - await click('.todo label', { clickCount: 2 }) - await enterValue('.todo:nth-child(1) .edit', ' ') - expect(await count('.todo')).toBe(3) - - // toggle all - await click('.toggle-all+label') - expect(await count('.todo.completed')).toBe(3) - await click('.toggle-all+label') - expect(await count('.todo:not(.completed)')).toBe(3) - } - - test( - 'composition', - async () => { - await testTodomvc('composition') - }, - E2E_TIMEOUT, - ) -}) diff --git a/packages/vue-vapor/examples/composition/todomvc.html b/packages/vue-vapor/examples/composition/todomvc.html deleted file mode 100644 index 8e3ff006d2..0000000000 --- a/packages/vue-vapor/examples/composition/todomvc.html +++ /dev/null @@ -1,289 +0,0 @@ - - - -
- - diff --git a/packages/vue-vapor/index.js b/packages/vue-vapor/index.js deleted file mode 100644 index 2625461ea9..0000000000 --- a/packages/vue-vapor/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./dist/vue-vapor.cjs.prod.js') -} else { - module.exports = require('./dist/vue-vapor.cjs.js') -} diff --git a/packages/vue-vapor/index.mjs b/packages/vue-vapor/index.mjs deleted file mode 100644 index fcb9204cbc..0000000000 --- a/packages/vue-vapor/index.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from './index.js' diff --git a/packages/vue-vapor/package.json b/packages/vue-vapor/package.json deleted file mode 100644 index 5f02fa53e0..0000000000 --- a/packages/vue-vapor/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@vue/vapor", - "version": "3.0.0-vapor", - "description": "The progressive JavaScript framework for building modern web UI.", - "main": "index.js", - "module": "dist/vue-vapor.esm-bundler.js", - "types": "dist/vue-vapor.d.ts", - "unpkg": "dist/vue-vapor.global.js", - "jsdelivr": "dist/vue-vapor.global.js", - "files": [ - "index.js", - "index.mjs", - "dist" - ], - "exports": { - ".": { - "types": "./dist/vue-vapor.d.ts", - "import": { - "node": "./index.mjs", - "default": "./dist/vue-vapor.esm-bundler.js" - }, - "require": { - "node": { - "production": "./dist/vue-vapor.cjs.prod.js", - "development": "./dist/vue-vapor.cjs.js", - "default": "./index.js" - }, - "default": "./index.js" - } - }, - "./dist/*": "./dist/*", - "./package.json": "./package.json" - }, - "buildOptions": { - "name": "VueVapor", - "formats": [ - "esm-bundler", - "cjs", - "global", - "esm-browser" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vuejs/vue-vapor.git" - }, - "keywords": [ - "vue" - ], - "author": "Evan You", - "license": "MIT", - "bugs": { - "url": "https://github.com/vuejs/vue-vapor/issues" - }, - "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vapor#readme", - "dependencies": { - "@vue/runtime-vapor": "workspace:*" - } -} diff --git a/packages/vue-vapor/src/index.ts b/packages/vue-vapor/src/index.ts deleted file mode 100644 index c05964199a..0000000000 --- a/packages/vue-vapor/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { initCustomFormatter } from '@vue/runtime-dom' - -if (__DEV__ && __BROWSER__) { - /* istanbul ignore if */ - 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.`, - ) - } - - initCustomFormatter() -} - -export * from '@vue/runtime-vapor/src' diff --git a/packages/vue/package.json b/packages/vue/package.json index d47b70ae21..f3437e5faf 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -107,9 +107,9 @@ "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vue#readme", "dependencies": { "@vue/shared": "workspace:*", - "@vue/vapor": "workspace:*", "@vue/compiler-dom": "workspace:*", "@vue/runtime-dom": "workspace:*", + "@vue/runtime-vapor": "workspace:*", "@vue/compiler-sfc": "workspace:*", "@vue/server-renderer": "workspace:*" }, diff --git a/packages/vue/vapor/index.d.mts b/packages/vue/vapor/index.d.mts index 658617456b..bddf2c71a4 100644 --- a/packages/vue/vapor/index.d.mts +++ b/packages/vue/vapor/index.d.mts @@ -1 +1 @@ -export * from '@vue/vapor' +export * from '@vue/runtime-vapor' diff --git a/packages/vue/vapor/index.d.ts b/packages/vue/vapor/index.d.ts index 658617456b..bddf2c71a4 100644 --- a/packages/vue/vapor/index.d.ts +++ b/packages/vue/vapor/index.d.ts @@ -1 +1 @@ -export * from '@vue/vapor' +export * from '@vue/runtime-vapor' diff --git a/packages/vue/vapor/index.js b/packages/vue/vapor/index.js index a6b4e3cdaf..684bafc39b 100644 --- a/packages/vue/vapor/index.js +++ b/packages/vue/vapor/index.js @@ -1 +1 @@ -module.exports = require('@vue/vapor') +module.exports = require('@vue/runtime-vapor') diff --git a/packages/vue/vapor/index.mjs b/packages/vue/vapor/index.mjs index 658617456b..bddf2c71a4 100644 --- a/packages/vue/vapor/index.mjs +++ b/packages/vue/vapor/index.mjs @@ -1 +1 @@ -export * from '@vue/vapor' +export * from '@vue/runtime-vapor' diff --git a/playground/setup/dev.js b/playground/setup/dev.js index 8f24be7575..5402b40735 100644 --- a/playground/setup/dev.js +++ b/playground/setup/dev.js @@ -16,9 +16,8 @@ export function DevPlugin({ browser = false } = {}) { return { resolve: { alias: { - 'vue/vapor': resolve('vue/vapor/index.mjs'), + 'vue/vapor': resolve('runtime-vapor/src'), vue: resolve('vue/src/runtime.ts'), - '@vue/vapor': resolve('vue-vapor/src'), '@vue/runtime-core': resolve('runtime-core/src'), '@vue/runtime-dom': resolve('runtime-dom/src'), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f469ca216..3f7ab37c2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -468,15 +468,15 @@ importers: '@vue/runtime-dom': specifier: workspace:* version: link:../runtime-dom + '@vue/runtime-vapor': + specifier: workspace:* + version: link:../runtime-vapor '@vue/server-renderer': specifier: workspace:* version: link:../server-renderer '@vue/shared': specifier: workspace:* version: link:../shared - '@vue/vapor': - specifier: workspace:* - version: link:../vue-vapor typescript: specifier: '*' version: 5.5.4 @@ -496,12 +496,6 @@ importers: specifier: workspace:* version: link:../vue - packages/vue-vapor: - dependencies: - '@vue/runtime-vapor': - specifier: workspace:* - version: link:../runtime-vapor - playground: dependencies: '@vueuse/core': diff --git a/tsconfig.json b/tsconfig.json index 051b9b4f98..e34aaa58ab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,6 @@ "rootDir": ".", "paths": { "@vue/compat": ["packages/vue-compat/src"], - "@vue/vapor": ["packages/vue-vapor/src"], "@vue/*": ["packages/*/src"], "vue": ["packages/vue/src"] },