BuilderIO / BuilderIO/mitosis

Generation of Vue 2 classes could possibly avoid _classStringToObject

Open
#951 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
14.4k
Forks
671
PR merge metrics
No merged PRs in 30d

Description

### I am interested in helping provide a fix!

Yes

### Which generators are impacted?

- [ ] All
- [ ] Angular
- [ ] HTML
- [ ] Qwik
- [ ] React
- [ ] React-Native
- [ ] Solid
- [ ] Stencil
- [ ] Svelte
- [X] Vue
- [ ] Web components

### Reproduction case

https://mitosis.builder.io/?outputTab=G4VwpkA%3D&inputTab=M4NwpgNgLmQ%3D&code=DwZwxgTglgDgLgPgFAAIUFMAeMD2E4oA26BAJlCAIYBGxpKAvCgGaWEjoDcqRJLOYAK4hGKOBEFckwAPTho8ZNKgA7GIIJhClECAYAiZngC2AWlXq4%2BlFp0gAXOSq109W7vtGhImQiA%3D

### Expected Behaviour

The Vue 2 output in the the _Class Directive_ example uses minimal Vue code, e.g.

```

```

### Actual Behaviour

The Vue 2 output in the _Class Directive_ uses code which is quite verbose, converting a string into a class with a `_classStringToObject` helper:

```

```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked reproduction and inspect how Vue 2 generates the Class Directive example. Trace the generation path that produces _classStringToObject; the work is done when the output uses a direct class binding like the expected example instead of the verbose helper conversion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.