Replies: 1 comment
-
Technically it's possible but not trivial because: We don't use the NPM ecosystem that means that if we want to use an existing React component we would need to create a custom build of the runtime which includes that component. What we can do is to turn this around and make Mint components and entities available for the NPM ecosystem. What we need to do to achieve this is to have a command that prints a compiled component (or entity) to STDOUT which would look something like this: component Main {
fun render {
<div>
<{ String.reverse("Hello World!") }>
</div>
}
} /* Import things from the runtime. */
import { Component, createElement } from "mint-runtime";
/*
Import things from the application itself.
"mint-application" would not be a real package but a pretend one
which can access the entities.
*/
import { String } from "mint-application";
class Main extends Component {
render() {
return createElement("div", {}, [
String.reverse(`Hello World!`)
]);
}
};
export default Main; Then we need create a plugin for the bundler (Webpack, Parcel, etc...) itself which can resolve things from In my opinion it would be better to rewrite the needed packages in Mint. |
Beta Was this translation helpful? Give feedback.
-
So I was thinking about animations and transitions for Mint. As I've looked into React and Vue.js this seems to be a quite complicated matter, so it's not something to be done quickly.
However, Preact (underneath Mint) is compatible with React ecosystem so a library like this one should be simply working:
https://reactcommunity.org/react-transition-group/
Do we have a way to use react components? Any ideas on how to implement this? What the design should be?
Beta Was this translation helpful? Give feedback.
All reactions