Skip to content

Commit

Permalink
[with-tv] move to SDK 50 (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglowder authored Jan 18, 2024
1 parent 2fec9df commit 52769ef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions with-tv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ npx expo prebuild
yarn ios # Build for Apple TV
yarn android # Build for Android TV
```

#### TV specific file extensions

This project contains an [example Metro configuration](./metro.config.js) that allows Metro to resolve application source files with TV-specific code, indicated by specific file extensions (`*.ios.tv.tsx`, `*.android.tv.tsx`, `*.tv.tsx`). This config is not enabled by default, since it will impact bundling performance, but is available for developers who need this capability.
24 changes: 24 additions & 0 deletions with-tv/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

// When enabled, the optional code below will allow Metro to resolve
// and bundle source files with TV-specific extensions
// (e.g., *.ios.tv.tsx, *.android.tv.tsx, *.tv.tsx)
//
// Metro will still resolve source files with standard extensions
// as usual if TV-specific files are not found for a module.
//
/*
if (process.env?.EXPO_TV === '1') {
const originalSourceExts = config.resolver.sourceExts;
const tvSourceExts = [
...originalSourceExts.map((e) => `tv.${e}`),
...originalSourceExts,
];
config.resolver.sourceExts = tvSourceExts;
}
*/

module.exports = config;
8 changes: 4 additions & 4 deletions with-tv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "1.0.0",
"dependencies": {
"@react-native-tvos/config-tv": "~0.0.4",
"expo": "^50.0.0-preview.4",
"expo-splash-screen": "~0.26.0",
"expo-status-bar": "~1.11.0",
"expo": "^50.0.0",
"expo-splash-screen": "~0.26.3",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "npm:react-native-tvos@~0.73.1-0"
"react-native": "npm:react-native-tvos@^0.73.1-3"
},
"devDependencies": {
"@babel/core": "~7.20.0",
Expand Down

0 comments on commit 52769ef

Please sign in to comment.