BuilderIO / BuilderIO/mitosis

core: add MitosisComponent.props

Open
#469 2 comments 0 reactions 0 assignees View on GitHub
core idea
Dominant language
TypeScript
Stars
14.4k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

I think the code will be a lot simpler in the generators if we provide more metadata on the props. For example in angular we want to know if it's a function and if it's being invoked. or in React if it's going used in `ref` binding.

I was something something like
```typescript
type PropType =
| 'function'
| 'string'
| 'boolean'
| 'undefined'
| 'null';

// metadata on how it's being used
type PropUsed =
| 'binding'
| 'invoked'
| 'binding.ref' // forwardRef
| 'function'
| 'onMount'
| 'onInit'
| 'onUnMount'
| 'onUpdate'
| 'onUpdate.dep';

interface MitosisProp {
type: PropType;
used: PropUsed[];
code: string;
}
```

Contributor guide

Open the contributing guide

Research direction

Locate the MitosisComponent definition and the generators that consume its props metadata. Review how props are currently represented, then determine whether the proposed type, usage markers, and source code are sufficient; done means generators can inspect this metadata for cases such as invocation and ref binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, react, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.