Sfoglia il codice sorgente

fix(vue-vapor): remove compiler version

三咲智子 Kevin Deng 1 anno fa
parent
commit
8ea6e4fb22

+ 2 - 2
package.json

@@ -10,8 +10,8 @@
     "clean": "rimraf --glob packages/*/dist temp .eslintcache",
     "size": "run-s \"size-*\" && node scripts/usage-size.js",
     "size-global": "node scripts/build.js vue vue-vapor runtime-dom runtime-vapor compiler-dom -f global -p --size",
-    "size-esm-runtime": "node scripts/build.js vue vue-vapor -f esm-bundler-runtime",
-    "size-esm": "node scripts/build.js runtime-shared runtime-dom runtime-vapor runtime-core reactivity shared -f esm-bundler",
+    "size-esm-runtime": "node scripts/build.js vue -f esm-bundler-runtime",
+    "size-esm": "node scripts/build.js runtime-shared runtime-dom runtime-vapor runtime-core reactivity shared vue-vapor -f esm-bundler",
     "check": "tsc --incremental --noEmit",
     "lint": "eslint --cache .",
     "format": "prettier --write --cache .",

+ 4 - 8
packages/vue-vapor/package.json

@@ -3,7 +3,7 @@
   "version": "3.0.0-vapor",
   "description": "The progressive JavaScript framework for building modern web UI.",
   "main": "index.js",
-  "module": "dist/vue-vapor.runtime.esm-bundler.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",
@@ -17,7 +17,7 @@
       "types": "./dist/vue-vapor.d.ts",
       "import": {
         "node": "./index.mjs",
-        "default": "./dist/vue-vapor.runtime.esm-bundler.js"
+        "default": "./dist/vue-vapor.esm-bundler.js"
       },
       "require": {
         "node": {
@@ -35,12 +35,9 @@
     "name": "VueVapor",
     "formats": [
       "esm-bundler",
-      "esm-bundler-runtime",
       "cjs",
       "global",
-      "global-runtime",
-      "esm-browser",
-      "esm-browser-runtime"
+      "esm-browser"
     ]
   },
   "repository": {
@@ -57,7 +54,6 @@
   },
   "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vapor#readme",
   "dependencies": {
-    "@vue/runtime-vapor": "workspace:*",
-    "@vue/compiler-vapor": "workspace:*"
+    "@vue/runtime-vapor": "workspace:*"
   }
 }

+ 0 - 15
packages/vue-vapor/src/dev.ts

@@ -1,15 +0,0 @@
-import { initCustomFormatter } from '@vue/runtime-dom'
-
-export function initDev(): void {
-  if (__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()
-  }
-}

+ 11 - 8
packages/vue-vapor/src/index.ts

@@ -1,12 +1,15 @@
-// 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 { initCustomFormatter } from '@vue/runtime-dom'
 
-if (__DEV__) {
-  initDev()
-}
+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.`,
+    )
+  }
 
-// TODO register compiler
+  initCustomFormatter()
+}
 
-export { compile } from '@vue/compiler-vapor'
 export * from '@vue/runtime-vapor'

+ 0 - 26
packages/vue-vapor/src/runtime.ts

@@ -1,26 +0,0 @@
-// This entry exports the runtime only, and is built as
-// `dist/vue.esm-bundler.js` which is used by default for bundlers.
-import { initDev } from './dev'
-// TODO implement warn
-// import { warn } from '@vue/runtime-vapor'
-
-if (__DEV__) {
-  initDev()
-}
-
-export * from '@vue/runtime-vapor'
-
-export const compile = (): void => {
-  if (__DEV__) {
-    console.warn(
-      `Runtime compilation is not supported in this build of Vue.` +
-        (__ESM_BUNDLER__
-          ? ` Configure your bundler to alias "vue" to "vue/dist/vue-vapor.esm-bundler.js".`
-          : __ESM_BROWSER__
-            ? ` Use "vue-vapor.esm-browser.js" instead.`
-            : __GLOBAL__
-              ? ` Use "vue-vapor.global.js" instead.`
-              : ``) /* should not happen */,
-    )
-  }
-}

+ 0 - 3
pnpm-lock.yaml

@@ -507,9 +507,6 @@ importers:
 
   packages/vue-vapor:
     dependencies:
-      '@vue/compiler-vapor':
-        specifier: workspace:*
-        version: link:../compiler-vapor
       '@vue/runtime-vapor':
         specifier: workspace:*
         version: link:../runtime-vapor

+ 2 - 4
scripts/usage-size.js

@@ -23,9 +23,7 @@ const {
 
 const sizeDir = path.resolve('temp/size')
 const vue = path.resolve('./packages/vue/dist/vue.runtime.esm-bundler.js')
-const vapor = path.resolve(
-  './packages/vue-vapor/dist/vue-vapor.runtime.esm-bundler.js',
-)
+const vapor = path.resolve('./packages/vue-vapor/dist/vue-vapor.esm-bundler.js')
 
 /**
  * @typedef {Object} Preset
@@ -44,9 +42,9 @@ const presets = [
     from: vue,
   },
   { name: 'createApp', imports: ['createApp'], from: vue },
+  { name: 'createVaporApp', imports: ['createVaporApp'], from: vapor },
   { name: 'createSSRApp', imports: ['createSSRApp'], from: vue },
   { name: 'defineCustomElement', imports: ['defineCustomElement'], from: vue },
-  { name: 'vapor', imports: '*', from: vapor },
   {
     name: 'overall',
     imports: [