mitosis icon indicating copy to clipboard operation
mitosis copied to clipboard

fix(isTypeScriptComponent): check all script tags (#933)

Open milahu opened this issue 2 years ago • 5 comments

fix #933

milahu avatar Nov 30 '22 19:11 milahu

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
mitosis-fiddle ✅ Ready (Inspect) Visit Preview Dec 2, 2022 at 4:27PM (UTC)

vercel[bot] avatar Nov 30 '22 19:11 vercel[bot]

@milahu Svelte doesn't support multiple

See example REPL: https://svelte.dev/repl/d5266c4fd50a49398b232ef54a825fdf?version=3.53.1 Issue and Explanation on the official Svelte repo: https://github.com/sveltejs/svelte/issues/6387#issuecomment-856517275

raymondmuller avatar Dec 01 '22 21:12 raymondmuller

thanks, return '' was missing

Svelte doesn't support multiple

example input https://github.com/PuruVJ/macos-web/blob/main/src/components/Dock/DockItem.svelte whats the meaning of context=module? does it work with svelte2mitosis?

milahu avatar Dec 02 '22 08:12 milahu

thanks, return '' was missing

Svelte doesn't support multiple

example input https://github.com/PuruVJ/macos-web/blob/main/src/components/Dock/DockItem.svelte whats the meaning of context=module? does it work with svelte2mitosis?

The official Svelte docs explain context module scripts: https://svelte.dev/docs#component-format-script-context-module

Regarding if this is working in Sveltosis, not entirely yet. Export statements are parsed, but there is still some work to do there for other node types.

I suggest closing this PR.

raymondmuller avatar Dec 02 '22 15:12 raymondmuller

The official Svelte docs explain context module scripts: svelte.dev/docs#component-format-script-context-module

aah, so these are static variables of the component class https://en.wikipedia.org/wiki/Static_variable#Object-oriented_programming

<script context="module"> is a confusing name, but well

I suggest closing this PR.

i suggest to throw NotImplementedError

currently <script context="module"> is ignored, see mitosis fiddle but maybe the fiddle is outdated

milahu avatar Dec 02 '22 15:12 milahu