BuilderIO/mitosis

Some frames are generated with unnecessary blank lines!

ayangweb opened this issue · 1 comments

I am interested in helping provide a feature!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

What problem does this feature solve?

Some frames are generated with unnecessary blank lines!

preview

react

image

stencil

image

ng

image

preact

image

What does the proposed API look like?

Usage Scenarios:

This looks very clunky if it's a demo with previewable code blocks!

iShot_2023-08-17_18 38 49

Additional Information

No response

Thanks for reporting. Your particular example is the logic that handles the Mitosis compile-away component For, which is different for each generator. I can show you the .join('\n') in the case of the React generator (which also runs for React Native):

.join('\n')}${wrap ? closeFrag(options) : ''}

removing the newline here should fix the issue for React.

If you want to fix this for all generators, you will have to go to each generator individually and replace the newlines with empty strings.