mitosis
mitosis copied to clipboard
Fiddle: add TS Support
Our Fiddle still does not support TS, even though Mitosis itself knows how to handle it!

This is weird because we set language="typescript"
:
https://github.com/BuilderIO/mitosis/blob/7bc921c4ef53fdaf1b902618aab34f8398c1ad93/packages/fiddle/src/components/Fiddle.tsx#L800 https://github.com/BuilderIO/mitosis/blob/7bc921c4ef53fdaf1b902618aab34f8398c1ad93/packages/fiddle/src/components/CodeEditor.tsx#L146
Not sure where the bug is, but would be neat to get type coverage in the fiddle!
Ideas from other issue:
https://github.com/BuilderIO/mitosis/issues/183#issuecomment-1050129752
Passing path="mitosis-file.tsx"
as a prop to <MonacoEditor might bring us one step closer.

Getting other errors now though


.
Missing types.
My thoughts:
-
From my NextJS memories, we'd have to add the raw-loader config to nextjs's webpack config to extend it and from there try to do the
raw-loader
import -
alternatively, looks like the string might be able to be a relative path to the node modules as well: https://stackoverflow.com/questions/43058191/how-to-use-addextralib-in-monaco-with-an-external-type-definition
-
also since we have
@builder.io
imports 🤔, we might need to update to a new version of Monaco Editor if ours is before this fix was pushed https://github.com/microsoft/monaco-editor/issues/2295
That seems to work :)
Closed by #673!