#react to foundry
1 messages · Page 1 of 1 (latest)
Depending on how much they have that's sufficiently abstracted, they might be able to put some logic into a library that both the site and module leverage
As for actually embedding react components into foundry, I've seen a proof of concept, but it's a really heavy dependency
it's not something I would advise
I think what I'm looking for is some advice for how to reuse portions of their react architecture effectively
also if there are some league tips/resources for using TypeScript effectively in Foundry (I'm sure there are)
They will undoubtedly want to have a look a foundry-vtt-types
It's a big question you're asking that naturally depends on the state of their current code, what they're using for state management, etc
Most React stuff handles its own internal state with react utilities, or uses redux to do so. You could probably theoretically do some interesting things to use redux in a foundry module, but that would require some custom middleware at minimum.
I work in react and ts land, so I'd be down to take a closer look if there's a public repo they have for instance and maybe I could give more concrete strategies.
It's not public, although I can see if they are interested in someone who knows Foundry well who would be willing to consult (potentially for payment)
IMO using their React code directly inside FVTT is a valid option
valid option and recommended are very different things 😛
If React is anything like Svelte, it will be a great experience
👍 I at least know of most of the tricks in that trade and can at least tell them how possible re-use of their stack would be even if no access to the repo is given
It’s not 😄 they are very different
The way to go about this really depends a lot on how their app is set up exactly.
If the logic and state management is tied tightly to react (or redux), then it will probably be very difficult to separate that. In that case, simply bringing the whole react app into foundry might be the best option, although it’s a very heavy solution.
If react is more or less just being used as a way to display stuff, but logic happens independently underneath that, it might be better to redo the ui (potentially reusing styling, depending on how that’s set up in the react app) and make the logic some sort of library that can be used both by the react app as well as a foundry module
But from what I have seen of react apps so far, I suspect that option one is much more likely
I don’t have any experience with react inside foundry (or any other ui framework for that matter). But I know a lot about foundry + typescript and have a lot of experience with React at work. So if that sounds to them like I might be able to help them, feel free to tell them to contact me.
Thanks @bleak bay and @lucid whale - appreciate it
React, in my small experience with it, takes a very opinionated approach to how things work that don't match well with a Foundry Application. You could perhaps map a React component to a Handlebars helper, but all of the component-sized interactivity code would not be easily ported
Vue turns out to be comparatively accommodating?