New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse-Mitosis #149
Comments
I think, this question is in the same vein as my question: Suppose I have an existing component-library written in React, that I want to be the single source of truth and generate output in Vue from. Is Mitosis suitable for my use-case? React => Mitosis => Vue Big thanks in advance! |
Mitosis's scope is (at least currently) focused only on outputting web framework code. Parsing framework code is a separate task/undertaking, and a rather complex one given that we have zero control over how folks build their React/Angular/Vue/etc. components.
Mitosis was made to be your single source of truth! For your use-case, I would suggest that you perform a one-time manual migration from React to Mitosis, and then use Mitosis as your single source-of-truth moving forward
馃槃 |
We can probably make an Alpha version of React => Mitosis. We would just have to change the jsx parser a bit and create a few escape hatches. Mitosis can be a slightly stricter version of whatever framework the lib author chooses (so long as they maintain some of the escape hatches). The lib author would need testing oh every new changes to mitosis to make sure their lib can output to everything they want to support. This will likely only work with new libs allows mitosis to be a super linter but the benefits are huge. If the community decides to change what they see as "Components", wanted classes, or the lib author doesn't update their lib then you can always refactor the output once you convert it to json |
see also https://github.com/milahu/awesome-component-converters |
Is it possible to make the parser pluggable and let the community to maintain so we can turn whatever framework to mitosis.
This design is understandable but it's trying to create another standard in some way here, there will be lots of marketing work needed. I believe reusing an exsiting one will be a big boost for mitosis. |
Yes, anyone is able to create their own parser for Mitosis, so the community is definitely able to attempt a React -> Mitosis parser. What you need is to write a parser that outputs a This is how @raymondmuller created a Svelte parser for Mitosis.
Not really. Read our docs for more information. TL;DR: Mitosis is not "another standard", but rather an attempt at abstracting over existing how current web frameworks author components.
I understand that many people want this, but it requires an enormous amount of additional effort that doesn't overlap with any of the other work we're doing, and so we do not have the resources to spend on it at the moment. A React parser will constantly need to be improved to handle more edge cases. As soon as it exists, the expectation from people will be that it can parse their existing React components, which it won't easily be able to do, as React allows folks to write components in very flexible ways. One of the first things people will try to do is create custom hooks, which is also a very complex problem to solve, and we've only had high-level discussions about: see #548. Seeing as we have no plans to look into this in the foreseeable future, I am going to close this issue for now (so that community expectations are clear). As I said, all of the Mitosis internals are exposed from the |
Greetings.
Does anyone know of a good way to go from "framework" code back to mitosis 馃榿
The text was updated successfully, but these errors were encountered: