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

Expo image #30905

Merged
merged 115 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
30594c2
Add expo-modules to application.
mczernek Sep 29, 2023
199d5d6
Update package-lock.json after adding expo-modules.
mczernek Sep 29, 2023
87caddc
Bump kotlin to 1.8.20 to make it compatible with expo-modules.
mczernek Sep 29, 2023
e38d43d
Prettier on metro.config.js
mczernek Oct 2, 2023
4a40e3f
Add patch for plaid-sdk
mczernek Oct 3, 2023
ca47d62
Display icons with expo-image
WojtekBoman Oct 6, 2023
49f341a
Fix displaying svg icons with own fill colors, fix prop types for icons
WojtekBoman Oct 9, 2023
acca9e1
Add displayInDefaultIconColor prop, refactor ReceiptDropUI
WojtekBoman Oct 10, 2023
8278968
Refactor CardPreview component
WojtekBoman Oct 10, 2023
cb4cef1
Refactor GenericErrorPage, AboutPage and SignInPageLayout's Footer
WojtekBoman Oct 10, 2023
26d8084
Add icon name prop to components which display icons
WojtekBoman Oct 11, 2023
0a6caa7
Update SidebarLinks
WojtekBoman Oct 11, 2023
215f008
Add names to icon components
WojtekBoman Oct 12, 2023
aae9daf
Add jest-expo, refactor tests
WojtekBoman Oct 13, 2023
86e6e77
Add avatarImageName prop to Avatar components
WojtekBoman Oct 13, 2023
f7d79c4
Add fixes to svg files
WojtekBoman Oct 13, 2023
d8b3805
Refactor passing prop displayInDefaultIconColor
WojtekBoman Oct 16, 2023
1a0363a
Add fixes to display, lib versions, image prop types
WojtekBoman Oct 16, 2023
c56ffe4
Add lint fixes
WojtekBoman Oct 16, 2023
6702b34
Add missing icon names
WojtekBoman Oct 16, 2023
362d717
Update package-lock.json
WojtekBoman Oct 17, 2023
8e3cfd4
Update package-lock.json
WojtekBoman Oct 17, 2023
46165f7
Run prettier
WojtekBoman Oct 17, 2023
7277fb9
Fix display SidebarLinks
WojtekBoman Oct 17, 2023
f70ff14
Fix displaying avatar fill color
WojtekBoman Oct 17, 2023
abc6444
Add ImageSVG component, remove unused code
WojtekBoman Oct 18, 2023
95ffd02
Refactor ImageSVG properties description
WojtekBoman Oct 18, 2023
575e5d4
Remove icon name props and add testID
WojtekBoman Oct 19, 2023
d69f0e4
Fix types for svg files
WojtekBoman Oct 19, 2023
eb79bed
Refactor image source prop types
WojtekBoman Oct 19, 2023
bad91c2
Add code fixes
WojtekBoman Oct 19, 2023
6cdde08
Refactor code, add type fixes
WojtekBoman Oct 19, 2023
b83c44a
Remove unnecessary code, lint fixes
WojtekBoman Oct 19, 2023
358168a
Add fix to sourcePropTypes
WojtekBoman Oct 19, 2023
87d7141
Fix passing pointerEvents and preserveAspectRatio props to ImageSVG c…
WojtekBoman Oct 20, 2023
d47cba5
Bump expo-image version
WojtekBoman Oct 23, 2023
126d419
Fix onLoad prop in Image component, fix prop types
WojtekBoman Oct 24, 2023
ca31c37
Fix propTypes in WalletSection
WojtekBoman Oct 24, 2023
5cd6252
Bump expo-image version, add code fixes
WojtekBoman Nov 2, 2023
a5add23
Fix import CONST in ReceiptDropUI
WojtekBoman Nov 2, 2023
5bdf3a6
Merge branch 'main' into expo-image
WojtekBoman Nov 8, 2023
2477d53
Merge branch 'main' into expo-image
WojtekBoman Nov 13, 2023
2d143fc
Merge branch 'main' into expo-image
WojtekBoman Nov 14, 2023
450d83d
Merge branch 'main' into expo-image
WojtekBoman Nov 14, 2023
e10f7a1
Bump expo-image version
WojtekBoman Nov 14, 2023
cf7765a
Refactor default fill color value in BlockingView, Icon and HeaderWit…
WojtekBoman Nov 14, 2023
0f7cbe9
Add ts fixes
WojtekBoman Nov 14, 2023
9cf42a4
Merge branch 'main' into expo-image
WojtekBoman Nov 15, 2023
2fdbbf3
Adjust ImageView to use expo-image
WojtekBoman Nov 15, 2023
76ab7df
Fix displaying attachments
WojtekBoman Nov 15, 2023
c0d46f9
Merge branch 'main' into expo-image
WojtekBoman Nov 15, 2023
b8dc114
Merge branch 'main' into expo-image
WojtekBoman Nov 16, 2023
7d845b6
Merge branch 'main' into expo-image
WojtekBoman Nov 17, 2023
b34572e
Merge branch 'main' into expo-image
WojtekBoman Nov 17, 2023
c661aa9
Fix zoom images in AttachmentCarouselPage
WojtekBoman Nov 17, 2023
806449b
Fix setting scaledImage width and height
WojtekBoman Nov 17, 2023
1ef612e
Fix icon colors
WojtekBoman Nov 17, 2023
819a669
Merge branch 'main' into expo-image
WojtekBoman Nov 19, 2023
da40585
Fix default image size in AttachmentCarouselPage
WojtekBoman Nov 20, 2023
6aa5a98
Merge branch 'main' into expo-image
WojtekBoman Nov 20, 2023
0f6ad45
Fix hiding fallback image
WojtekBoman Nov 20, 2023
eca74d0
Merge branch 'main' into expo-image
WojtekBoman Nov 21, 2023
015a6ce
Fix icon color in the BaseOptionsSelector component
WojtekBoman Nov 21, 2023
2bc5843
Fix package.json files format
WojtekBoman Nov 22, 2023
92d5953
Fix formatting package.json
WojtekBoman Nov 22, 2023
7bfac55
Fix formatting package-lock.json
WojtekBoman Nov 22, 2023
74f1be8
Merge branch 'main' into expo-image
WojtekBoman Nov 22, 2023
eff757e
Merge branch 'main' into expo-image
WojtekBoman Nov 23, 2023
cac6174
Merge branch 'main' into expo-image
WojtekBoman Nov 24, 2023
1a2da77
Fix expensify-wordmark svg fill color
WojtekBoman Nov 24, 2023
a7e66d8
Merge branch 'main' into expo-image
WojtekBoman Nov 27, 2023
571bc7f
Merge branch 'main' into expo-image
WojtekBoman Dec 1, 2023
bbda53a
Add IconAsset type, add lint fixes
WojtekBoman Dec 1, 2023
e2d8e56
Refactor default fill prop value in the Avatar component
WojtekBoman Dec 1, 2023
8ed175b
Merge branch 'main' into expo-image
WojtekBoman Dec 4, 2023
694470e
Refactor getDefaultWorkspaceAvatarTestID description
WojtekBoman Dec 4, 2023
33adfff
Remove react-native-plaid-link-sdk patch
WojtekBoman Dec 4, 2023
063c459
Fix displaying google icon
WojtekBoman Dec 4, 2023
93f7548
Merge branch 'main' into expo-image
WojtekBoman Dec 4, 2023
692c787
Merge branch 'main' into expo-image
WojtekBoman Dec 5, 2023
03435e5
Move setIsActive to onLoadEnd in AttachmentCarouselPage
WojtekBoman Dec 5, 2023
047cc65
Merge branch 'main' into expo-image
WojtekBoman Dec 5, 2023
65ab438
Merge branch 'main' into expo-image
WojtekBoman Dec 6, 2023
e78a719
Fix lint
WojtekBoman Dec 6, 2023
b2cd949
Merge branch 'main' into expo-image
WojtekBoman Dec 6, 2023
827cf90
Merge branch 'main' into expo-image
WojtekBoman Dec 7, 2023
edd627a
Merge branch 'main' into expo-image
WojtekBoman Dec 8, 2023
9647214
Remove expo-asset and unnecessary comments
WojtekBoman Dec 11, 2023
95e49d0
Migrate ImageSVG to TS
WojtekBoman Dec 11, 2023
a8d3096
Merge branch 'main' into expo-image
WojtekBoman Dec 11, 2023
4d7b90c
Fix ts in HeaderUtils
WojtekBoman Dec 11, 2023
17f0b67
Adjust home background fill color
WojtekBoman Dec 11, 2023
a4ec7dc
Merge branch 'main' into expo-image
WojtekBoman Dec 11, 2023
221fe4e
Merge branch 'main' into expo-image
WojtekBoman Dec 11, 2023
c483c8a
Merge branch 'main' into expo-image
WojtekBoman Dec 12, 2023
4d78a56
Fix imports order
WojtekBoman Dec 12, 2023
45c8e31
Merge branch 'main' into expo-image
WojtekBoman Dec 12, 2023
4900127
Merge branch 'main' into expo-image
WojtekBoman Dec 13, 2023
f8448ca
Merge branch 'main' into expo-image
WojtekBoman Dec 13, 2023
5574239
Replace themeColors with useTheme
WojtekBoman Dec 13, 2023
57d57ec
Adjust new components to expo-image
WojtekBoman Dec 13, 2023
ba157c1
Remove assets registry
WojtekBoman Dec 13, 2023
c939df1
Merge branch 'main' into expo-image
WojtekBoman Dec 13, 2023
842830f
Merge branch 'main' into expo-image
WojtekBoman Dec 14, 2023
09a703d
Merge branch 'main' into expo-image
WojtekBoman Dec 15, 2023
1da3052
Refactor BackgroundImage, remove unnecessary props
WojtekBoman Dec 15, 2023
fabb0b0
Merge branch 'main' into expo-image
WojtekBoman Dec 15, 2023
b739e34
Merge branch 'main' into expo-image
WojtekBoman Dec 20, 2023
dcc4994
Add contentFit prop to MenuItem
WojtekBoman Dec 20, 2023
b856010
Merge branch 'main' into expo-image
WojtekBoman Dec 20, 2023
06638b2
Merge branch 'main' into expo-image
WojtekBoman Dec 20, 2023
0deaafd
chore: merge current main
WoLewicki Dec 21, 2023
3dc4373
Refactor BankIcons nad PaymentMethodList
WojtekBoman Dec 22, 2023
e55ca4d
Run prettier on BankIconsUtils
WojtekBoman Dec 22, 2023
7c4ef3f
Merge branch 'main' into expo-image
WojtekBoman Dec 22, 2023
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ yalc.lock

# Local https certificate/key
config/webpack/*.pem

# Expo
.expo
dist/
web-build/
5 changes: 5 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
}

project.ext.envConfigFiles = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.expensify.chat;
import expo.modules.ReactActivityDelegateWrapper;

import android.os.Bundle;
import android.content.pm.ActivityInfo;
Expand Down Expand Up @@ -31,11 +32,11 @@ protected String getMainComponentName() {
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new DefaultReactActivityDelegate(
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change required? Can we skip it?

This post seems to imply we don't have to:
https://x.com/tsapeta/status/1734249424216355227?s=20

Copy link
Contributor

@roryabraham roryabraham Dec 12, 2023

Choose a reason for hiding this comment

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

I don't feel strongly or have experience to back this up, my instinct is that departing from the "standard config" for an app including Expo Modules is likely to cause more potential headaches than not.

Copy link
Contributor

Choose a reason for hiding this comment

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

@WojtekBoman or someone else from SWM/Expo- Can you confirm @roryabraham's instincts and/or assumptions above? Thanks.

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 is the required configuration to use expo in the project :) More information here: https://docs.expo.dev/bare/installing-expo-modules/

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so that tweet is incorrect? Or maybe I am not understanding it?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know, theoretically it is not required to add those changes, but because that's what the expo-modules documentation states I think we should keep it. Especially if we're going to use another module - expo-av for video playback.

I think it is also safer to keep those changes, because the expo team would assume that the modules setup is done according to the documentation. It will save us some potential problems during future upgrades.

this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled());
DefaultNewArchitectureEntryPoint.getFabricEnabled()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package com.expensify.chat;
import android.content.res.Configuration;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;

import android.content.Context;
import android.database.CursorWindow;
Expand All @@ -23,7 +26,7 @@

public class MainApplication extends MultiDexApplication implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new DefaultReactNativeHost(this) {
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
Expand All @@ -44,7 +47,7 @@ protected List<ReactPackage> getPackages() {

@Override
protected String getJSMainModuleName() {
return "index";
return ".expo/.virtual-metro-entry";
}

@Override
Expand All @@ -56,7 +59,7 @@ protected boolean isNewArchEnabled() {
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
};
});

@Override
public ReactNativeHost getReactNativeHost() {
Expand Down Expand Up @@ -98,5 +101,12 @@ public void onCreate() {
} catch (Exception e) {
e.printStackTrace();
}
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
androidXCore = "1.0.2"
multiDexEnabled = true
googlePlayServicesVersion = "17.0.0"
kotlinVersion = '1.6.20'
kotlinVersion = '1.8.10'

// This property configures the type of Mapbox SDK used by the @rnmapbox/maps library.
// "mapbox" indicates the usage of the Mapbox SDK.
Expand Down
3 changes: 3 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ includeBuild('../node_modules/react-native') {
substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
}
}

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
4 changes: 2 additions & 2 deletions assets/emojis/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SvgProps} from 'react-native-svg';
import IconAsset from '@src/types/utils/IconAsset';

type Emoji = {
code: string;
Expand All @@ -8,7 +8,7 @@ type Emoji = {

type HeaderEmoji = {
header: true;
icon: React.FC<SvgProps>;
icon: IconAsset;
code: string;
};

Expand Down
2 changes: 1 addition & 1 deletion assets/images/expensify-logo--adhoc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/images/expensify-logo--dev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading