-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add framework - DLight.js #222
Conversation
} | ||
} | ||
|
||
export default Name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By curiosity, why did you choose to export default
like this instead of export default class Name {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In dlight, we use class to declare a component and use function call
to use one:
@View
class Comp {}
@View
class App {
Body() {
Comp()
}
}
This is fine in js. But in ts, this'll arise syntax level errors(even though it's working, but it's ugly in your editor). To we need to force type casting to a self-returning function, which'll resolve this error and give you props auto-completion. But in ts you can't export class {} as xxx
. So we do it like:
// ~> Comp.view.ts
@View
class Comp {}
export default Comp as Pretty as Typed<Props>
// ~ App.view.ts
import Comp from "./Comp.view"
@View
class App {
Body() {
Comp()
}
}
And here Pretty
is just an alias of "any" to make the typing pretty. I mean make it "as pretty as" your type...
What is this ci error about? I didn't change anything except the pacakge name in this commit |
Too niche atm, would not have the time to maintain it. You can clone it to make a Component Party clone for this framework. |
Hi. This pr is to add a new framework called DLight.js. DLight being the fastest and lightweight framework aims to provide developers with the best and pure MVVM DX. V1.0.0 of dlight is about to drop and it's gaining more attention, so I think contributing to component-party is a good move to get developers to know dlight and migrate from other frameworks. Ping me if I made something wrong or there's anything else I can help! Thanks!