Skip to content

Commit 0c17009

Browse files
Renamed .website to .web for simplicity
1 parent 1bd5630 commit 0c17009

25 files changed

Lines changed: 14 additions & 15 deletions

File tree

config/eslint/eslint.seatbelt.tsv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109
"../../src/components/MagicCodeInput.tsx" "react-hooks/refs" 1
110110
"../../src/components/MagicCodeInput.tsx" "react-hooks/set-state-in-effect" 3
111111
"../../src/components/MapView/MapView.tsx" "react-hooks/set-state-in-effect" 1
112-
"../../src/components/MapView/MapView.website.tsx" "react-hooks/set-state-in-effect" 1
113-
"../../src/components/MapView/MapViewImpl.website.tsx" "react-hooks/set-state-in-effect" 1
112+
"../../src/components/MapView/MapView.web.tsx" "react-hooks/set-state-in-effect" 1
113+
"../../src/components/MapView/MapViewImpl.web.tsx" "react-hooks/set-state-in-effect" 1
114114
"../../src/components/MapView/ToggleDistanceUnitButton/index.android.tsx" "no-restricted-syntax" 1
115115
"../../src/components/MessagesRow.tsx" "no-restricted-syntax" 1
116116
"../../src/components/Modal/BaseModal.tsx" "react-hooks/set-state-in-effect" 1
@@ -364,8 +364,8 @@
364364
"../../src/libs/actions/IOU/index.ts" "@typescript-eslint/no-deprecated/getPolicyTagsData" 2
365365
"../../src/libs/actions/IOU/index.ts" "rulesdir/no-onyx-connect" 10
366366
"../../src/libs/actions/ImportTransactions.ts" "no-restricted-syntax" 1
367-
"../../src/libs/actions/InputFocus/index.website.ts" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
368-
"../../src/libs/actions/InputFocus/index.website.ts" "no-restricted-syntax" 1
367+
"../../src/libs/actions/InputFocus/index.web.ts" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
368+
"../../src/libs/actions/InputFocus/index.web.ts" "no-restricted-syntax" 1
369369
"../../src/libs/actions/Link.ts" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
370370
"../../src/libs/actions/Link.ts" "no-restricted-syntax" 3
371371
"../../src/libs/actions/MapboxToken.ts" "no-restricted-syntax" 2
@@ -491,7 +491,7 @@
491491
"../../src/pages/Share/ShareRootPage.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
492492
"../../src/pages/TransactionDuplicate/Confirmation.tsx" "react-hooks/refs" 12
493493
"../../src/pages/Travel/TravelUpgrade.tsx" "react-hooks/set-state-in-effect" 1
494-
"../../src/pages/ValidateLoginPage/index.website.tsx" "react-hooks/set-state-in-effect" 1
494+
"../../src/pages/ValidateLoginPage/index.web.tsx" "react-hooks/set-state-in-effect" 1
495495
"../../src/pages/domain/Groups/PreferredWorkspaceToggle.tsx" "@typescript-eslint/no-deprecated/ConfirmModal" 1
496496
"../../src/pages/domain/Saml/SamlLoginSectionContent.tsx" "@typescript-eslint/no-deprecated/ConfirmModal" 1
497497
"../../src/pages/inbox/DeleteTransactionNavigateBackHandler.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
@@ -525,7 +525,7 @@
525525
"../../src/pages/inbox/report/ReportActionsList.tsx" "react-hooks/set-state-in-effect" 3
526526
"../../src/pages/inbox/report/TripSummary.tsx" "rulesdir/no-default-id-values" 1
527527
"../../src/pages/inbox/report/UserTypingEventListener.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 4
528-
"../../src/pages/inbox/report/shouldUseEmojiPickerSelection/index.website.ts" "no-restricted-syntax" 1
528+
"../../src/pages/inbox/report/shouldUseEmojiPickerSelection/index.web.ts" "no-restricted-syntax" 1
529529
"../../src/pages/inbox/report/useReportActionsNewActionLiveTail.ts" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
530530
"../../src/pages/inbox/report/withReportOrNotFound.tsx" "react-hooks/refs" 3
531531
"../../src/pages/inbox/sidebar/SidebarLinksData.tsx" "react-hooks/refs" 1
@@ -694,7 +694,7 @@
694694
"../../src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 2
695695
"../../src/stories/ReportActionItemImages.stories.tsx" "no-restricted-syntax" 1
696696
"../../src/stories/TextInput.stories.tsx" "react-hooks/set-state-in-effect" 1
697-
"../../src/styles/utils/autoCompleteSuggestion/index.website.ts" "no-restricted-syntax" 1
697+
"../../src/styles/utils/autoCompleteSuggestion/index.web.ts" "no-restricted-syntax" 1
698698
"../../src/types/onyx/Account.ts" "no-restricted-syntax" 1
699699
"../../src/types/onyx/AccountData.ts" "no-restricted-syntax" 1
700700
"../../src/types/onyx/BankAccount.ts" "no-restricted-syntax" 1

config/webpack/webpack.common.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,9 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
396396
'@selectors': path.resolve(dirname, '../../src/selectors/'),
397397
},
398398

399-
// React Native libraries may have web-specific module implementations that appear with the extension `.web.js`
400-
// without this, web will try to use native implementations and break in not very obvious ways.
401-
// This is also why we have to use .website.js for our own web-specific files...
402-
extensions: ['.web.js', '.website.js', '.js', '.jsx', '.web.ts', '.website.ts', '.website.tsx', '.ts', '.web.tsx', '.tsx'],
399+
// Resolve web-specific implementations (`.web.*`) before bare files so React Native
400+
// libraries and our own app-level overrides both pick up their browser variants.
401+
extensions: ['.web.js', '.js', '.jsx', '.web.ts', '.web.tsx', '.ts', '.tsx'],
403402
fallback: {
404403
'process/browser': require.resolve('process/browser'),
405404
crypto: false,

contributingGuides/philosophies/CROSS-PLATFORM.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Put all platform specific code in dedicated files and folders (see below) and re
2828
In most cases, the code written for this repo should be platform-independent. In such cases, each module should have a single file, `index.js`, which defines the module's exports. There are, however, some cases in which a feature is intrinsically tied to the underlying platform. In such cases, the following file extensions can be used to export platform-specific code from a module:
2929
- Mobile => `index.native.js`
3030
- iOS Native App/Android Native App => `index.ios.js`/`index.android.js`
31-
- Web => `index.website.js`
31+
- Web => `index.web.js`
3232

3333
**Note:** `index.js` should be the default and only platform-specific implementations should be done in their respective files. i.e: If you have mobile-specific implementation in `index.native.js`, then the web implementation can be contained in a shared `index.js`.
3434

35-
`index.ios.js` and `index.android.js` are used when the app is running natively on respective platforms. These files are not used when users access the app through mobile browsers, but `index.website.js` is used instead. `index.native.js` are for both iOS and Android native apps. `index.native.js` should not be included in the same module as `index.ios.js` or `index.android.js`.
35+
`index.ios.js` and `index.android.js` are used when the app is running natively on respective platforms. These files are not used when users access the app through mobile browsers, but `index.web.js` is used instead. `index.native.js` are for both iOS and Android native apps. `index.native.js` should not be included in the same module as `index.ios.js` or `index.android.js`.
3636

3737
### Supporting Mobile Web
3838
The above platform-specific files only work because they are compiled when the app is built for the different platforms. This means that a different mechanism needs to be used for Mobile Web (since "mobile web" and "web" are the same at build time).

src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.website.ts renamed to src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.web.ts

File renamed without changes.
File renamed without changes.

src/components/MapView/MapView.website.tsx renamed to src/components/MapView/MapView.web.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan
99
import type {MapViewProps} from './MapViewTypes';
1010
import PendingMapView from './PendingMapView';
1111

12-
const MapViewImpl = lazy(() => import('./MapViewImpl.website'));
12+
const MapViewImpl = lazy(() => import('./MapViewImpl.web'));
1313

1414
function MapView({ref, ...props}: MapViewProps) {
1515
const {isOffline} = useNetwork();
File renamed without changes.

src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts renamed to src/libs/Navigation/OnyxTabNavigatorConfig/index.web.ts

File renamed without changes.

0 commit comments

Comments
 (0)