question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracking Issue: Fabric support

See original GitHub issue

In the PR #1102, @TheSavior detailed the state-of-the-art for supporting Fabric (which had implications for long-term Animated support). We ended up discussing it in depth, so that thread should be considered prior reading to explain what aspects of the library are impacted, what changes are necessary, and why. In short:

  • Fabric doesn’t have findNodeHandle anymore.
  • It has always been confusing, for many APIs, whether users need to obtain a ref to a class component instance, a ref to the host component, or a node handle to the host component.
  • The react-native-webview library is particularly complex in this respect because <WebView> renders a <View> with a <NativeWebView> child, which itself has scrolling behaviour (which incidentally will differ between macOS and iOS because the iOS WKWebView has a UIScrollView, yet the macOS WKWebView doesn’t contain a scrollView at all). There are valid reasons for a user or library (e.g. Animated/Reanimated) to require a ref to any of these various components.
  • Fabric’s approach is to ref-forward to the native component, then adorn it with public APIs from the class component that wraps it.

I began work on a branch to change the way refs are managed in this library to make this Animated support compatible with Fabric. However, I found that a rather large refactor was entailed, so I’ve decided to separate the PR from immediate Animated support and open the issue of Fabric support in general for proper discussion.

shirakaba/animated-support-fabric is the branch. Note that the aspect of Animated support only constitutes three lines of code: the getScrollableNode aspect. The rest is all related to Fabric. Note also that I’ve only touched the iOS implementation so far in this!

Note that this work is untested and may be missing some aspects; it’s merely my best understanding of how to implement the suggestions by @TheSavior. Hopefully it can illustrate the idea in mind.

I guess a starting point is to ask @TheSavior whether this implementation essentially looks correct for iOS?

Questions for the maintainers would be what they think about this ref-forwarding and adorning process and whether it means any breaking changes in the library and ecosystem around it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
kartikmittal1996commented, Oct 15, 2022

Hey @shirakaba @TheSavior , please let me know if there is any working version of react-native-webview that will support react native new architecture with fabric. I have to migrate my application to new architecture with fabric enabled so it’s a must for me before proceeding further. Thanks in advance.

1reaction
thiavila-sigmacommented, Oct 16, 2022

I’m with @kartikmittal1996. I’ve just changed my whole application to Fabric, and react-native-webview would play a key role in this new version. I wish I had the knowledge to help you out, but if there is anything that is within my reach, feel free to ask.

I know @Titozzz has worked in this also. More details here: https://github.com/react-native-webview/react-native-webview/pull/2686

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · fabric/fabric - GitHub
Simple, Pythonic remote execution and deployment. Contribute to fabric/fabric development by creating an account on GitHub.
Read more >
Fabric
We made Fabric easy for small teams to get started with, and for larger teams to grow with. Try Fabric today. Try the...
Read more >
Azure Service Fabric support options - Microsoft Learn
To report issues related to your Service Fabric cluster running on Azure, open a support ticket on the Azure portal or Microsoft support...
Read more >
Add support for alternative mechanisms for locating pkcs11 keys
The pkcs11 implementation in Fabric currently generates a key via pkcs11, then creates a X509 certificate with an SKI and then updates the ......
Read more >
Player Tracking (Fabric) - Mods - Minecraft - CurseForge
Player Tracking is a PvP mod which allows tracking players via trackers in the world, via the /track command. These have been originally ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found