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: bridgeless support #410

Merged
merged 13 commits into from
Apr 30, 2024
Merged

feat: bridgeless support #410

merged 13 commits into from
Apr 30, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Apr 6, 2024

📜 Description

Updated react-native to 0.74 (wich has bridgeless mode enabled by default in new arch).

💡 Motivation and Context

We need to support bridgeless mode.

Main changes to make fabric working were:

  • change a context from which we emit an event (event emitter, not dispatcher);
  • remove checks for _jsThread on iOS (since it's bridgeless mode -> these variable will be always false);

Also in this PR I had to remove flipper integration to speed up delivery of this PR. Later on I'll probably add this integration back.

Closes #429 #394

📢 Changelog

JS

  • bumed deps;

iOS

  • removed _jsThread check as in Fabric it'll be always false;

Android

  • change context for emitting events (now we need to use appContext);

🤔 How Has This Been Tested?

tested locally + on CI using both architectures.

📸 Screenshots (if appropriate):

Everything works as before 🙃

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added enhancement New feature or request deps update Upgrade dependencies of the project labels Apr 6, 2024
@kirillzyusko kirillzyusko self-assigned this Apr 6, 2024
Copy link
Contributor

github-actions bot commented Apr 6, 2024

📊 Package size report

Current size Target Size Difference
129703 bytes 129748 bytes -45 bytes 📉

@kirillzyusko kirillzyusko marked this pull request as ready for review April 30, 2024 15:24
@kirillzyusko kirillzyusko merged commit 590ff6e into main Apr 30, 2024
21 checks passed
@kirillzyusko kirillzyusko deleted the chore/react-native-0.74 branch April 30, 2024 16:43
kirillzyusko added a commit that referenced this pull request Jun 15, 2024
… 0.72 (#475)

## 📜 Description

Fixed compilation errors on RN 0.71 and `keyboard-controller` 1.12.

## 💡 Motivation and Context

`emitDeviceEvent` is available only in RN 0.72 and we don't want to
support RN 0.72 as the minimal version (because it's still quite new):


![image](https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/61c229df-aabc-483a-8d36-db7c03a17e82)

The original change was introduced in
#410
- it was needed because old implementation threw errors (crashes) in
bridgeless mode on Fabric.

In this Pr I made it compatible with bridgeless + it doesn't use newly
introduced methods, so it should have a support until RN 0.65 again.

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### Android

- don't use `emitDeviceEvent` as it's available only in RN 0.72;
- revert to previous code variant, but send an event from
`ReactApplicationContext` class instance;

## 🤔 How Has This Been Tested?

Tested on Pixel 7 Pro (Android 14), Fabric + RN 0.74

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps update Upgrade dependencies of the project enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Exception in HostFunction: expected 1 arguments, got 0
1 participant