-
Notifications
You must be signed in to change notification settings - Fork 294
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
Support for New Architecture - iOS & Android (Fabric) #931
Closed
Closed
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
6dcb22d
Init `fabricfixture` app
j-piasecki 80f4b02
Setup codegen
j-piasecki 72933ad
Update podspec
j-piasecki 1ad219c
Implement view components
j-piasecki b1edc02
Move `CellContainer` to objective c
j-piasecki 9b76327
Fix `AutoLayoutView` subviews and footer
j-piasecki 377f4cd
Implement `onBlankAreaEvent` on iOS
j-piasecki e3d228f
Update Android view managers
j-piasecki 9b9eeb2
Add generated files for Paper
j-piasecki 342377d
Make `onBlankAreaEvent` work on Android
j-piasecki 016ce13
Update syntax in podspec
j-piasecki 0687e83
Remove space
j-piasecki e25181c
Update codegen specs to use only TS
j-piasecki 5695dd8
Bump React Native
j-piasecki e1fa7ca
Get fabricfixture working
markrickert 3a57e73
Upgrade fabricfixture to react-native 0.72.5 - iOS
markrickert a7ff840
Upgrade fabricfixture to react-native 0.72.5 - Android
markrickert 42f8c26
Cleanup
markrickert 8823a55
Change RN_FABRIC_ENABLED to RCT_NEW_ARCH_ENABLED
markrickert 092f784
Update RNFlashList.podspec
markrickert d2f2e30
Recommended PR changes.
markrickert 0548cbc
Upgrade fabricfixture to react-native 0.72.10 and get builds working
markrickert c3d68aa
Gets the fixture app working again in latest Mac OS 14.3 & Xcode 15.2
markrickert a7c0777
Fix fixture app’s eslint rules to inherit from the base and pass CI l…
markrickert 4131972
Adds @react-native/eslint-config to the main package.
markrickert 0ddf2c0
Another attempt at getting the linter to pass.
markrickert 5f2f9b1
Update fabricfixture to latest released react-native: 0.73.3
markrickert 0093be5
Get normal fixture android app running on modern java setup.
markrickert 1eb4662
Update the podspec to remove unnecessary new arch stuff
markrickert e303991
Remove unnecessary codegen srcDirs addition in build.gradle
markrickert 69acae2
Refactor the emitBlankAreaEvent event emitter to work with both paper…
markrickert e3f38c7
Fix RNFlashList-Swift.h import based on suggestion
markrickert 0e48b1d
Upgrade react-native fixture to rn 0.73.6
markrickert 6329ccd
Get versions up to date for fabric in the react-native fixture app
markrickert 0932c96
Remove fabricfixture
markrickert f6c2004
Fix unnecessary ci script.
markrickert c1ba66a
Linter Fixes
markrickert dbcc26b
More linter fixes.
markrickert cc4f6a7
Attempt to fix CI Pipelines.
markrickert c9f7534
Trying to get ios to build in CI
markrickert 195d1f5
Maybe static frameworks will build?
markrickert 41eaca0
fix blank area event name
naqvitalha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
android/src/fabric/java/com/shopify/reactnative/flash_list/ReactContextExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.shopify.reactnative.flash_list | ||
|
||
import com.facebook.react.bridge.ReactContext | ||
import com.facebook.react.fabric.FabricUIManager | ||
import com.facebook.react.uimanager.UIManagerHelper | ||
import com.facebook.react.uimanager.common.UIManagerType | ||
import com.facebook.react.bridge.WritableMap | ||
|
||
fun ReactContext.dispatchEvent(nativeTag: Int, eventName: String, event: WritableMap) { | ||
val fabricUIManager = UIManagerHelper.getUIManager(this, UIManagerType.FABRIC) as FabricUIManager | ||
fabricUIManager.receiveEvent(nativeTag, eventName, event) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
android/src/main/kotlin/com/shopify/reactnative/flash_list/events/OnBlankAreaEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes | ||
package com.shopify.reactnative.flash_list.events | ||
|
||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
import com.facebook.react.uimanager.events.RCTEventEmitter | ||
|
||
class OnBlankAreaEvent(surfaceId: Int, viewId: Int, val offsetStart: Double, val offsetEnd: Double) : | ||
Event<OnBlankAreaEvent>(surfaceId, viewId) { | ||
|
||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getEventData(): WritableMap { | ||
val eventData: WritableMap = Arguments.createMap() | ||
eventData.putDouble("offsetStart", offsetStart) | ||
eventData.putDouble("offsetEnd", offsetEnd) | ||
return eventData | ||
} | ||
|
||
override fun dispatch(rctEventEmitter: RCTEventEmitter) { | ||
rctEventEmitter.receiveEvent(viewTag, eventName, eventData) | ||
} | ||
|
||
companion object { | ||
const val EVENT_NAME: String = "onBlankAreaEvent" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GeneratePropsJavaDelegate.js | ||
*/ | ||
|
||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
import androidx.annotation.Nullable; | ||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class AutoLayoutViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & AutoLayoutViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public AutoLayoutViewManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
@Override | ||
public void setProperty(T view, String propName, @Nullable Object value) { | ||
switch (propName) { | ||
case "horizontal": | ||
mViewManager.setHorizontal(view, value == null ? false : (boolean) value); | ||
break; | ||
case "scrollOffset": | ||
mViewManager.setScrollOffset(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "windowSize": | ||
mViewManager.setWindowSize(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "renderAheadOffset": | ||
mViewManager.setRenderAheadOffset(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "enableInstrumentation": | ||
mViewManager.setEnableInstrumentation(view, value == null ? false : (boolean) value); | ||
break; | ||
case "disableAutoLayout": | ||
mViewManager.setDisableAutoLayout(view, value == null ? false : (boolean) value); | ||
break; | ||
default: | ||
super.setProperty(view, propName, value); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naqvitalha The
RCT_NEW_ARCH_ENABLED
isn't actually set anywhere.And then it would also be required to check if the flag is set at the top level (cannot add suggestion there 😞):