Comments (6)
The essence of designing Vapor is: that we need to maximize compatibility with the existing behavior of Vue core.
- Currently, we don't need to consider macros like
defineProps
; they belong to the scope of SFC compiler and will ultimately be compiled into theprops
option. - We need to support options like
props
,emits
, and others, as well as thesetup
function. However, there's no need to implement the Options API such asdata
,created
,computed
, etc. - Props should be stored in the
ComponentInternalInstance
for composable retrieval. - As you mentioned the https://github.com/sxzz/vue-simple-props project. Currently, we might need a formal RFC or experiment first in Vue Macros before landing it in Vue Vapor.
from core-vapor.
I'm trying..
https://github.com/Ubugeeei/vuejs-core/tree/feat/component-props
from core-vapor.
I've probably implemented the basic functionality, so once I refine it a bit more, it seems like I'll be able to submit a PR.
Unlike the render function of traditional components, which generates new rawProps and patches them each time, we need to find a way to always get the latest values of the original props.
I tried implementing this by modifying the traditional initProps
function and defining a getter using Object.defineProperty
, but I wonder if there's a smarter way to do this. 😵💫
I'll raise a PR soon for a bit of discussion...
from core-vapor.
@sxzz
I've written a few drafts, but regarding the design of Props, has there been any discussion within the team, or is there a planned time to discuss this?
from core-vapor.
It's too long, and I haven't had enough time and read it yet...
from core-vapor.
Oh, I'm sorry for rushing you, I understand.
I'll wait until there's some progress! 💪🏻
from core-vapor.
Related Issues (20)
- Stop Using WeakMap/Map
- Only Root Element in Fragment
- [Bug] runtime-vapor/vModel HOT 1
- delegate events on metadata
- Re-exports for CDN bundle
- Component slots HOT 6
- Compile component directives
- The onUpdated hook is not triggered across components. HOT 1
- test apiLifecycle
- perf: template abbreviation of end tag HOT 3
- Component setRef
- `v-on` fails to wrap inline statements in a function expression.
- setRef update
- transformText can not process dynamic root text properly
- Handle `Failed to resolve component`
- API Progress Overview
- Defaults to TS for `<script vapor>` HOT 25
- Block State Destructuring & Nesting HOT 1
- [Bug]: v-once directive not working as expected with SFC Playground after code modifications HOT 1
- Assets Management HOT 1
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-vapor.