Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add support for web as a platform #330

Merged
merged 6 commits into from
Aug 15, 2024
Merged

Conversation

robwalkerco
Copy link
Member

@robwalkerco robwalkerco commented Aug 13, 2024

Fixes #223
Required before #305 can be worked on.

Description

When trying to use Victory Native in an Expo Snack, I found that the default web platform was erroring.
This led me to investigate why Vistory Native was not working on the web platform, and subsequently this PR where I've fixed the issues and updated the example app so that it can easily be run on the web, as well an Android and iOS.

Known Issues

The pie-and-donut-charts screen contains 8 separate graphs, which is too many for my current browser (Arc) to render. WARNING: Too many active WebGL contexts. Oldest context will be lost. is logged to the console, and only the last three graphs are rendered. It seems there is no such limitation on iOS or Android.

I have not refactored that example screen in this PR to keep this PR smaller.

To overcome the limit of active WebGL contexts, we could refactor the screen into an accordion or split it into multiple screens.

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Checklist: (Feel free to delete this section upon completion)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run yarn run check:code and all checks pass
  • I have created a changeset for new features, patches, or major changes
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
    • There is one minor note regarding the downgraded version of @react-native-community/slider not matching the Expo recommended version.
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Aug 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
victory-native-xl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 3:28pm

Copy link

changeset-bot bot commented Aug 13, 2024

🦋 Changeset detected

Latest commit: 86a162d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
example Minor
victory-native 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

"@expo/vector-icons": "^14.0.0",
"@gorhom/bottom-sheet": "^4",
"@react-native-community/slider": "4.5.2",
"@react-native-community/slider": "4.4.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgraded this version to resolve callstack/react-native-slider#617 which I could replicate while testing the sliders in the example app.

@robwalkerco robwalkerco marked this pull request as ready for review August 13, 2024 15:47
Copy link
Contributor

@zibs zibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so awesome!

My only question is what's the story behind getGlyphWidths vs measureText changes?

@robwalkerco
Copy link
Member Author

My only question is what's the story behind getGlyphWidths vs measureText changes?

@zibs measureText was deprecated in react-native-skia in favour of getGlyphWidth in 2022. It is not implemented in the skia web implementation -

@robwalkerco robwalkerco merged commit 34bc324 into main Aug 15, 2024
3 checks passed
@robwalkerco robwalkerco deleted the feat/expo-web-support branch August 15, 2024 08:33
@github-actions github-actions bot mentioned this pull request Aug 15, 2024
@robwalkerco robwalkerco changed the title Feat: Add support for Expo web Feat: Add support for web as a platform Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using on web
2 participants