Comments (6)
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
from mitosis.
Is it possible to make the parser pluggable and let the community to maintain so we can turn whatever framework to 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 MitosisComponent
JSON object (see type here). Then you can feed that into any of Mitosis' generators.
This is how @raymondmuller created a Svelte parser for Mitosis.
This design is understandable but it's trying to create another standard in some way here
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 believe reusing an exsiting one will be a big boost for mitosis.
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 @builder.io/mitosis
package, so folks are more than welcome to attempt this on their own! Reach out to us on Discord if we do, and we can try to help wherever possible. 😃
from mitosis.
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.
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?
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
- React => Mitosis (one off migration)
- Mitosis => React, Vue, & everything else
😄
from mitosis.
React => Mitosis
see also https://github.com/milahu/awesome-component-converters
from mitosis.
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!
from mitosis.
We would just have to change the jsx parser a bit and create a few escape hatches.
Is it possible to make the parser pluggable and let the community to maintain so we can turn whatever framework to mitosis.
Mitosis was made to be your single source of truth!
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.
from mitosis.
Related Issues (20)
- Wrong mapping of `change` and `input` events for `HTMLInputElement` for vue HOT 2
- [FEAT Contribution] Plugin to support Imported stylesheets CSS / SASS HOT 3
- [FEAT Contribution] Plugin Support for vue V-Model integration and event interoperability HOT 2
- How to test a mitosis component ? HOT 1
- Lackluster developer docs HOT 1
- critical/high Vulnerabilities
- support `children` as render prop HOT 1
- React named slots getting prefixed with the word 'Slot'
- Support for custom components in mitosis compiler HOT 11
- "Could not replace node." added in vue-component HOT 1
- Treat module scrope correctly for Svelte and Vue
- cli ignore parts of config settings
- Angular [attr.disabled]
- SolidJS: mitosis compiles the attribute "for" to "htmlFor" HOT 2
- Support for custom generators / targets HOT 2
- Sveltosis doesn't work on Fiddle HOT 1
- The context.Provider in SolidJS wraps the children in Fragments HOT 3
- Vue2 `For` component not generating `template` HOT 2
- Bug: slots with data HOT 21
- Slots: Angular and Vue behave diffently
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mitosis.