capsize
capsize copied to clipboard
Add React Native integration
In order to better support the React Native integration, I also added a precomputeNumericValues
function to the core
package since the existing logic returns strings of CSS values which React Native doesn't support. Not 100% on the naming and it's quite likely we'll want to change it, but wanted to at least get a working implementation in there.
To see the example for yourself, assuming you've set up your environment for React Native:
yarn
yarn preconstruct build
yarn workspace react-native-example start
For iOS, run yarn workspace react-native-example ios
, or if that doesn't work, open examples/react-native/ios/example.xcworkspace
and click the play button in the toolbar (or hit Cmd+R).
For Android, run yarn workspace react-native-example android
while you've got an Android emulator open.
The example is a bit heavy so I can see that there's room for debate about whether to include it in the repo or not, but I figured that it's important to have a working example we can reference if we want to make changes to the implementation.
🦋 Changeset detected
Latest commit: 5173be45dbf297929fbf724c312b26105e5696d7
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
@capsizecss/core | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
I made react-native-capsize a while ago, really glad to see React Native getting official support!
Not sure about this repo owning the react-native example code though, as it looks like something that would likely rot quickly. The boundary looks simple enough, so maybe stand up a separate repo and link to it from the integration repo?
Maybe we could use Expo for the example project instead? That would significantly reduce the size of the project and allow people to run the example without Android Studio or XCode.
Hey is there still any interest in getting this merged?
I'd be happy to take a look at it if there is. I could set up an Expo project to replace the example and make adjustments to the way this is set up to get it up to date with the current package version. Do you have any more thoughts on precomputeNumericValues
api at this point?
I can piggy-back off of this PR or make a new one if that sounds more sensible.
For transparency, I spoke to @markdalgleish a while ago about it offline, and I dont think taking on the maintenance of the react-native setup in the examples would be a good move for the project.
Not ruling out a simpler seam in the future, but for now i'll close this one off.