Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .claude/scripts/checkReactCompilerOptimization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function findPlatformVariants(resolvedPath: string): PlatformVariant[] {
const variants: PlatformVariant[] = [];

// Platform suffixes to check
const platforms = ['native', 'ios', 'android', 'web', 'desktop'];
const platforms = ['native', 'ios', 'android', 'web'];

const ext = path.extname(basename);
const nameWithoutExt = path.basename(basename, ext);
Expand Down
1 change: 0 additions & 1 deletion .github/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"paths": {
"@assets/*": ["../assets/*"],
"@components/*": ["../src/components/*"],
"@desktop/*": ["../desktop/*"],
"@github/*": ["../.github/*"],
"@hooks/*": ["../src/hooks/*"],
"@libs/*": ["../src/libs/*"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# - git diff is used to see the files that were added on this branch
# - gh pr view is used to list files touched by this PR. Git diff may give false positives if the branch isn't up-to-date with main
# - wc counts the words in the result of the intersection
count_new_js=$(comm -1 -2 <(git diff --name-only --diff-filter=A origin/main HEAD -- 'src/*.js' '__mocks__/*.js' '.storybook/*.js' 'assets/*.js' 'config/*.js' 'desktop/*.js' 'jest/*.js' 'scripts/*.js' 'tests/*.js' '.github/libs/*.js' '.github/scripts/*.js' ':!src/libs/SearchParser/*.js') <(gh pr view ${{ github.event.pull_request.number }} --json files | jq -r '.files | map(.path) | .[]') | wc -l)
count_new_js=$(comm -1 -2 <(git diff --name-only --diff-filter=A origin/main HEAD -- 'src/*.js' '__mocks__/*.js' '.storybook/*.js' 'assets/*.js' 'config/*.js' 'jest/*.js' 'scripts/*.js' 'tests/*.js' '.github/libs/*.js' '.github/scripts/*.js' ':!src/libs/SearchParser/*.js') <(gh pr view ${{ github.event.pull_request.number }} --json files | jq -r '.files | map(.path) | .[]') | wc -l)
if [ "$count_new_js" -gt "0" ]; then
echo "ERROR: Found new JavaScript files in the project; use TypeScript instead."
exit 1
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ yarn-error.log

# Bundled code
dist/
desktop-build/

# BUCK
buck-out/
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# The GH actions don't seem to compile and verify themselves well when Prettier is applied to them
.github/actions/javascript/**/index.js
.well-known
desktop/dist/**/*.js
dist/**/*.js
.rock
assets/animations
Expand Down
1 change: 0 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
importOrder: [
'@assets/(.*)$',
'@components/(.*)$',
'@desktop/(.*)$',
'@github/(.*)$',
'@hooks/(.*)$',
'@libs/(.*)$',
Expand Down
7 changes: 2 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- **Language**: TypeScript
- **State Management**: React Native Onyx
- **Navigation**: React Navigation
- **Platforms**: iOS, Android, Web, Desktop (Electron)
- **Platforms**: iOS, Android, Web

## HybridApp Architecture (Critical Context)

Expand All @@ -22,7 +22,7 @@
- Mobile builds **must** be initiated from the Mobile-Expensify directory

### Build Modes
- **Standalone**: Pure NewDot application (web/desktop)
- **Standalone**: Pure NewDot application (web)
- **HybridApp**: Combined OldDot + NewDot (mobile apps)
- Controlled via `STANDALONE_NEW_DOT` environment variable

Expand Down Expand Up @@ -236,9 +236,6 @@ npm run ios
# Android build
npm run android

# Desktop build
npm run desktop

# Web build
npm run web
```
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ For detailed setup instructions for each platform, see the following guides:
* **🕸 Web Development**: [Web Setup Instructions](contributingGuides/SETUP_WEB.md)
* **📱 iOS Development**: [iOS Setup Instructions](contributingGuides/SETUP_IOS.md)
* **🤖 Android Development**: [Android Setup Instructions](contributingGuides/SETUP_ANDROID.md)
* **🖥 Desktop Development**: [Desktop Setup Instructions](contributingGuides/SETUP_DESKTOP.md)

## General Troubleshooting
1. If you are having issues with **_Getting Started_**, please reference [React Native's Documentation](https://reactnative.dev/docs/environment-setup)
Expand All @@ -74,7 +73,7 @@ variables referenced here get updated since your local `.env` file is ignored.
- `USE_NGROK` - Flag to turn `ngrok` testing on or off
- `USE_WDYR` - Flag to turn [`Why Did You Render`](https://github.com/welldone-software/why-did-you-render) testing on or off
- `USE_REDUX_DEVTOOLS` - Flag to enable [Redux DevTools](https://github.com/reduxjs/redux-devtools) for Onyx state debugging
- `USE_WEB_PROXY`⚠️- Used in web/desktop development, it starts a server along the local development server to proxy
- `USE_WEB_PROXY`⚠️- Used in web development, it starts a server along the local development server to proxy
requests to the backend. External contributors should set this to `true` otherwise they'll have CORS errors.
If you don't want to start the proxy server set this explicitly to `false`
- `CAPTURE_METRICS` (optional) - Set this to `true` to capture performance metrics and see them in Flipper
Expand Down
10 changes: 5 additions & 5 deletions assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Fonts

All fonts used by web, desktop and native apps are located inside `assets/fonts/` folder. The native app will use fonts with `.otf` or `.ttf` formats, where the web app will use fonts with `.otf`, `.ttf`, `.woff` or `.woff2` formats.
All fonts used by web and native apps are located inside `assets/fonts/` folder. The native app will use fonts with `.otf` or `.ttf` formats, where the web app will use fonts with `.otf`, `.ttf`, `.woff` or `.woff2` formats.

### Adding / Removing fonts

Expand Down Expand Up @@ -50,11 +50,11 @@ To add or remove a font used in the native app:
1. Remove all the font family variants from the [FontFamilyKey type](https://github.com/Expensify/App/blob/main/src/styles/utils/FontUtils/fontFamily/types.ts).
2. Remove all the font family variants from the [singleFontFamily file](https://github.com/Expensify/App/blob/main/src/styles/utils/FontUtils/fontFamily/singleFontFamily/index.ts).

#### Web / Desktop
#### Web

The font files used by the web / desktop apps are stored inside `assets/fonts/web/` folder.
The font files used by the web app are stored inside `assets/fonts/web/` folder.

To add or remove a font used in the web / desktop app:
To add or remove a font used in the web app:

1. Add or remove the desired font files inside `assets/fonts/web/` folder.
2. If you are adding a new font family into the project:
Expand Down Expand Up @@ -130,7 +130,7 @@ To add or remove a font used in the Expensify Help web app:

### Using the fonts

#### Native / Web / Desktop
#### Native / Web

To use your fonts in the app, just import the desired font from [FontUtils](https://github.com/Expensify/App/blob/main/src/styles/utils/FontUtils/index.ts) and use in your style objects.

Expand Down
18 changes: 6 additions & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ const defaultPluginsForWebpack = [
'@babel/plugin-transform-export-namespace-from',
];

// The Fullstory annotate plugin generated a few errors when executed in Electron. Let's
// ignore it for desktop builds.
if (!process.env.ELECTRON_ENV && process.env.npm_lifecycle_event !== 'desktop') {
console.debug('This is not a desktop build, adding babel-plugin-annotate-react');
defaultPluginsForWebpack.push([
'@fullstory/babel-plugin-annotate-react',
{
native: true,
},
]);
}
defaultPluginsForWebpack.push([
'@fullstory/babel-plugin-annotate-react',
{
native: true,
},
]);

if (process.env.DEBUG_BABEL_TRACE) {
defaultPluginsForWebpack.push(traceTransformer);
Expand Down Expand Up @@ -125,7 +120,6 @@ const metro = {
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': './src',
'@userActions': './src/libs/actions',
'@desktop': './desktop',
'@github': './.github',
'@selectors': './src/selectors',
},
Expand Down
94 changes: 0 additions & 94 deletions config/electronBuilder.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/webpack/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type Environment = {
file?: string;
platform?: 'web' | 'desktop';
platform?: 'web';
};

export default Environment;
33 changes: 8 additions & 25 deletions config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function mapEnvironmentToLogoSuffix(environmentFile: string): string {
}

/**
* Get a production grade config for web or desktop
* Get a production grade config for web
*/
const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment): Configuration => {
const isDevelopment = file === '.env' || file === '.env.development';

if (!isDevelopment) {
const releaseName = `${process.env.npm_package_name}@${process.env.npm_package_version}`;
console.debug(`[SENTRY ${platform.toUpperCase()}] Release: ${releaseName}`);
console.debug(`[SENTRY ${platform.toUpperCase()}] Assets Path: ${platform === 'desktop' ? './desktop/dist/www/**/*.{js,map}' : './dist/**/*.{js,map}'}`);
console.debug(`[SENTRY ${platform.toUpperCase()}] Assets Path: ${'./dist/**/*.{js,map}'}`);
}

/* eslint-disable @typescript-eslint/naming-convention */
Expand Down Expand Up @@ -173,7 +173,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
: []),
...(platform === 'web' ? [new CustomVersionFilePlugin()] : []),
new webpack.DefinePlugin({
...(platform === 'desktop' ? {} : {process: {env: {}}}),
process: {env: {}},
// Define EXPO_OS for web platform to fix expo-modules-core warning
'process.env.EXPO_OS': JSON.stringify('web'),
__REACT_WEB_CONFIG__: JSON.stringify(dotenv.config({path: file}).parsed),
Expand Down Expand Up @@ -202,9 +202,9 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
},
},
sourcemaps: {
// Use relative path from project root - works for both web (dist/) and desktop (desktop/dist/www/)
assets: platform === 'desktop' ? './desktop/dist/www/**/*.{js,map}' : './dist/**/*.{js,map}',
filesToDeleteAfterUpload: platform === 'desktop' ? './desktop/dist/www/**/*.map' : './dist/**/*.map',
// Use relative path from project root - works for web (dist/)
assets: './dist/**/*.{js,map}',
filesToDeleteAfterUpload: './dist/**/*.map',
},
debug: false,
telemetry: false,
Expand Down Expand Up @@ -306,7 +306,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
lodash: 'lodash-es',
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
// Module alias for web & desktop
// Module alias for web
// https://webpack.js.org/configuration/resolve/#resolvealias
'@assets': path.resolve(dirname, '../../assets'),
'@components': path.resolve(dirname, '../../src/components/'),
Expand All @@ -319,30 +319,13 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': path.resolve(dirname, '../../src/'),
'@userActions': path.resolve(dirname, '../../src/libs/actions/'),
'@desktop': path.resolve(dirname, '../../desktop'),
'@selectors': path.resolve(dirname, '../../src/selectors/'),
},

// React Native libraries may have web-specific module implementations that appear with the extension `.web.js`
// without this, web will try to use native implementations and break in not very obvious ways.
// This is also why we have to use .website.js for our own web-specific files...
// Because desktop also relies on "web-specific" module implementations
// This also skips packing web only dependencies to desktop and vice versa
extensions: [
'.web.js',
...(platform === 'desktop' ? ['.desktop.js'] : []),
'.website.js',
'.js',
'.jsx',
'.web.ts',
...(platform === 'desktop' ? ['.desktop.ts'] : []),
'.website.ts',
...(platform === 'desktop' ? ['.desktop.tsx'] : []),
'.website.tsx',
'.ts',
'.web.tsx',
'.tsx',
],
extensions: ['.web.js', '.website.js', '.js', '.jsx', '.web.ts', '.website.ts', '.website.tsx', '.ts', '.web.tsx', '.tsx'],
fallback: {
'process/browser': require.resolve('process/browser'),
crypto: false,
Expand Down
Loading
Loading