Comments (3)
I was thinking about dropping the runtime vs. full build dimension and distributing the compiler in a separate package altogether. So the vue
package would be only the runtime. This allows us to drop a dimension but you'd have to do something like this to get on-the-fly compilation:
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-template-compiler"></script>
This allows us to get down to 7 builds in the vue
package itself (cjs.js
is just a dynamic entry file):
Runtime
vue.esm-bundler.js
vue.cjs.dev.js
vue.cjs.prod.js
vue.esm-browser.dev.js
vue.esm-browser.prod.js
vue.global.dev.js
vue.global.prod.js
Compilers
compiler.global.dev.js
compiler.global.prod.js
compiler.esm-browser.dev.js
compiler.esm-browser.prod.js
Usage
- For bundlers,
module
field defaults to the esm-bundler build. - For in browser usage via CDN, unpkg and jsdelivr defaults to the global build. (Users now need to include the compiler separately on page)
- For Node SSR usage,
index
field inpackage.json
defaults to the cjs build. - The user only needs to specify file path when using ESM directly in browser.
Now assuming we will have an extra dimension for API compat. That leaves us at 7 * 2 = 14 builds for the runtime (runtime API compat doesn't affect the compiler). Which is still kinda ok.
Maybe we can make the 2.x compat code a plugin - which would reduce yet another dimension, but I'm not 100% sure if it can be cleanly done. I'll have to experiment to see if that's possible.
Finally for IE compat - we should probably distribute it in a separate package (like vue-ie11
) with the same dist folder layout. So for users that need IE11 support would simply switch the package resolution.
from core.
Thanks , that makes sense.
how would the compiler be included in bundler projects?
from core.
Well, now that we are (for now) no longer doing the lean build, I think we can close this 😅
The lean build can probably be a compile-time flag (e.g. process.env.LEAN_MODE
) preserved in the esm-bundler
build.
from core.
Related Issues (20)
- Cannot read property 'isCE' of null in host component with slot using Module Federation
- Cannot read properties of undefined (reading 'shapeFlag');Page rendering error HOT 3
- Scoped style escape case
- vue使用tsx突然报 _defineComponent is not defined HOT 8
- a标签使用text属性时, 文本内容会被替换成text的属性值 HOT 2
- defineProps导致热更新失效 HOT 3
- `defineModel` loses two way binding flow when parent adds event listeneres HOT 2
- CSS nesting inserts attribute selector at every level HOT 1
- can not resolve global component in h function when pass a render function HOT 7
- Unhandled error during execution of render function HOT 1
- Regression of multiselect integer form values (>=3.4.15) HOT 2
- v-model修饰符在初始化的时候不生效,只有当v-model绑定的值发生变化时才生效。 HOT 5
- Issues Regarding TransitionGroup HOT 4
- Vue 3 render function no class reactivity HOT 1
- withDefaults merge object union HOT 1
- Inconsistent production and runtime environments. HOT 3
- Not possible to use Symbol value for checkbox true-value HOT 6
- Not possible to use Symbol values for checkbox v-model values HOT 3
- Change in computed property behavior with Reactive objects in 3.4 HOT 3
- `app.provide` is not type safe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.