Closed nicolodavis closed 5 years ago
The other UI stuff is coupled to React. How do you plan to proceed?
@Stefan-Hanke I'd assume the UI stuff will continue to be coupled directly with React for now– and anyone implementing React Native/Vue/Angular will be responsible for bringing their own UI components.
@nicolodavis I gave this a shot about a month back– I'm pretty sure the only things that need changes are converting the div
s to View
s, handling the CSS imports + debug UI, and adding an example using RN (probably with create-react-native-app + Expo.io)
I'm not sure what my schedule is like in the next couple weeks– I'll get going on something but if anyone else reads this and wants to take a stab at it please do!
We'll need to have parallel implementations in React Native / Vue / Angular. However, that doesn't mean they can't share code. @Stefan-Hanke proposes sharing SVG code in https://github.com/google/boardgame.io/pull/111, which I think is a good idea.
I think the UI components are the easy bit. The Debug pane is going to be harder. React Native doesn't really need one (or could use a pretty watered down version), but I think it will need to be rewritten completely for Angular and Vue (they can start out without having one, of course).
What's the status of RN integration now? I'll be attempting a RN project with this soon, and would be willing to contribute if anything's missing.
That, and/or TypeScript support.
i think everything is in master, just waiting on release 0.22 to get cut and it will be available on npm
It is already on NPM. Would welcome some testers though (I haven't checked if it works correctly).
Would welcome some testers though (I haven't checked if it works correctly).
Seems to work!
This screenshot is actually my port of the react-native tic-tac-toe example to TypeScript. It's made as a non-Expo app, for some variety. The port is not quite ready to show yet, as I first need to figure out how to distribute the TypeScript declarations (I have no idea how to get them to co-operate with rollup bundles).
That looks amazing, great work!
yea, doing import { Client } from 'boardgame.io/react-native'
even works on exposnack.io now
Wow, I'll have to try that out sometime.
Now that the client logic is decoupled from React, and the React implementation is just a tiny wrapper around the Client class, it should be possible to add support for React Native in a similar way.
I have no experience with React Native, but if someone wants to do some exploring here, I'll be happy to provide guidance and review PR's.