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

Bump react-native-live-markdown (use worklets) #53627

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions __mocks__/@expensify/react-native-live-markdown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {MarkdownTextInput} from '@expensify/react-native-live-markdown';
import type {parseExpensiMark} from '@expensify/react-native-live-markdown';

global.jsi_setMarkdownRuntime = jest.fn();
global.jsi_registerMarkdownWorklet = jest.fn();
global.jsi_unregisterMarkdownWorklet = jest.fn();

const parseExpensiMarkMock: typeof parseExpensiMark = () => {
'worklet';

return [];
};

export {MarkdownTextInput, parseExpensiMarkMock as parseExpensiMark};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay if we have this mock here or should we move it to react-native-live-markdown somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part of the mock can be moved. But I'm not sure about the react-native part. Maybe we can just avoid throwing an error if NativeLiveMarkdownModule is not available? (same as it was before). The global.jsi_setMarkdownRuntime check is probably enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! Left couple of comments there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do I need to wait for the above PR to be completed, and then start testing this PR?

Copy link
Contributor

@tomekzaw tomekzaw Dec 11, 2024

Choose a reason for hiding this comment

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

Yes, let's wait for that PR with the mock. I've asked my collegaues to review that PR (it looks good for me, just wanted another pair of eyes on it). I hope we can merge that PR today. Then we can bump here and ask for QA.

Copy link
Contributor

@tomekzaw tomekzaw Dec 11, 2024

Choose a reason for hiding this comment

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

@s77rt I've just merged the PR introducing the mock to react-native-live-markdown (Expensify/react-native-live-markdown#578). Let's bump live-markdown to 0.1.207, remove mock in this PR and we should be ready to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! This is ready for test

15 changes: 15 additions & 0 deletions __mocks__/react-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ jest.doMock('react-native', () => {

const reactNativeMock = Object.setPrototypeOf(
{
TurboModuleRegistry: {
...ReactNative.TurboModuleRegistry,
get(name: string) {
if (name === 'LiveMarkdownModule') {
return {install: () => true} as ReactNative.TurboModule;
}
return ReactNative.TurboModuleRegistry.get(name);
},
getEnforcing(name: string) {
if (name === 'LiveMarkdownModule') {
return {install: () => true} as ReactNative.TurboModule;
}
return ReactNative.TurboModuleRegistry.getEnforcing(name);
},
},
NativeModules: {
...ReactNative.NativeModules,
BootSplash: {
Expand Down
4 changes: 0 additions & 4 deletions ios/NewExpensify.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
"${PODS_ROOT}/../../node_modules/@expensify/react-native-live-markdown/parser/react-native-live-markdown-parser.js",
"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVGFilters.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
Expand All @@ -658,7 +657,6 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/react-native-live-markdown-parser.js",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNSVGFilters.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
Expand Down Expand Up @@ -843,7 +841,6 @@
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
"${PODS_ROOT}/../../node_modules/@expensify/react-native-live-markdown/parser/react-native-live-markdown-parser.js",
"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVGFilters.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
Expand All @@ -864,7 +861,6 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/react-native-live-markdown-parser.js",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNSVGFilters.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
Expand Down
26 changes: 14 additions & 12 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ PODS:
- RNGoogleSignin (10.0.1):
- GoogleSignIn (~> 7.0)
- React-Core
- RNLiveMarkdown (0.1.187):
- RNLiveMarkdown (0.1.205):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -2411,9 +2411,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNLiveMarkdown/newarch (= 0.1.187)
- RNLiveMarkdown/newarch (= 0.1.205)
- RNReanimated/worklets
- Yoga
- RNLiveMarkdown/newarch (0.1.187):
- RNLiveMarkdown/newarch (0.1.205):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -2433,6 +2434,7 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/worklets
- Yoga
- RNLocalize (2.2.6):
- React-Core
Expand Down Expand Up @@ -2503,7 +2505,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated (3.16.3):
- RNReanimated (3.16.4):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -2523,10 +2525,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.3)
- RNReanimated/worklets (= 3.16.3)
- RNReanimated/reanimated (= 3.16.4)
- RNReanimated/worklets (= 3.16.4)
- Yoga
- RNReanimated/reanimated (3.16.3):
- RNReanimated/reanimated (3.16.4):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -2546,9 +2548,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.3)
- RNReanimated/reanimated/apple (= 3.16.4)
- Yoga
- RNReanimated/reanimated/apple (3.16.3):
- RNReanimated/reanimated/apple (3.16.4):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -2569,7 +2571,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated/worklets (3.16.3):
- RNReanimated/worklets (3.16.4):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -3271,12 +3273,12 @@ SPEC CHECKSUMS:
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 8781e2529230a1bc3ea8d75e5c3cd071b6c6aed7
RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0
RNLiveMarkdown: 8338447b39fcd86596c74b9e0e9509e365a2dd3b
RNLiveMarkdown: bf0f16b1e8c3320d600a5931d270e19afef9fa92
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4
RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28
RNReactNativeHapticFeedback: 73756a3477a5a622fa16862a3ab0d0fc5e5edff5
RNReanimated: 03ba2447d5a7789e2843df2ee05108d93b6441d6
RNReanimated: d95f865e1e42c34ca56b987e0719a8c72fc02dbc
RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2
RNShare: bd4fe9b95d1ee89a200778cc0753ebe650154bb0
RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852
Expand Down
56 changes: 41 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
"@expensify/react-native-live-markdown": "0.1.187",
"@expensify/react-native-live-markdown": "0.1.205",
"@expo/metro-runtime": "~3.2.3",
"@firebase/app": "^0.10.10",
"@firebase/performance": "^0.6.8",
Expand Down Expand Up @@ -108,7 +108,7 @@
"date-fns-tz": "^3.2.0",
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"expensify-common": "2.0.106",
"expensify-common": "2.0.109",
"expo": "51.0.31",
"expo-av": "14.0.7",
"expo-image": "1.12.15",
Expand Down Expand Up @@ -161,7 +161,7 @@
"react-native-plaid-link-sdk": "11.11.0",
"react-native-qrcode-svg": "6.3.11",
"react-native-quick-sqlite": "git+https://github.com/margelo/react-native-nitro-sqlite#99f34ebefa91698945f3ed26622e002bd79489e0",
"react-native-reanimated": "3.16.3",
"react-native-reanimated": "3.16.4",
"react-native-release-profiler": "^0.2.1",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.10.9",
Expand Down
Loading
Loading