-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: extract web example #2333
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
node_modules/ | ||
.expo/ | ||
dist/ | ||
npm-debug.* | ||
*.jks | ||
*.p8 | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import App from '../apps/examples'; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"expo": { | ||
"name": "web-example", | ||
"slug": "web-example", | ||
"version": "1.0.0", | ||
"web": { | ||
"favicon": "./assets/favicon.png" | ||
}, | ||
"plugins": [ | ||
"expo-asset" | ||
] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
plugins: ['react-native-reanimated/plugin'], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import '@expo/metro-runtime'; | ||
|
||
import { registerRootComponent } from 'expo'; | ||
|
||
import App from './App'; | ||
|
||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App); | ||
// It also ensures that whether you load the app in Expo Go or in a native build, | ||
// the environment is set up appropriately | ||
registerRootComponent(App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Learn more https://docs.expo.io/guides/customizing-metro | ||
const { getDefaultConfig } = require('expo/metro-config'); | ||
const path = require('path'); | ||
|
||
const config = getDefaultConfig(__dirname); | ||
|
||
// npm v7+ will install ../node_modules/react-native because of peerDependencies. | ||
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native, | ||
// excludes the one from the parent folder when bundling. | ||
config.resolver.blockList = [ | ||
...Array.from(config.resolver.blockList ?? []), | ||
new RegExp(path.resolve('..', 'node_modules', 'react-native')), | ||
new RegExp(path.resolve('..', 'node_modules', 'react')), | ||
]; | ||
|
||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(__dirname, './node_modules'), | ||
path.resolve(__dirname, '../node_modules'), | ||
]; | ||
|
||
config.watchFolders = [path.resolve(__dirname, '..')]; | ||
|
||
config.transformer.getTransformOptions = async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
}, | ||
}); | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "web-example", | ||
"main": "index.js", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"start": "expo start --web", | ||
"reset-project": "node ./scripts/reset-project.js", | ||
"test": "jest --watchAll", | ||
"lint": "expo lint" | ||
}, | ||
"jest": { | ||
"preset": "jest-expo" | ||
}, | ||
"dependencies": { | ||
"@expo/vector-icons": "^14.0.2", | ||
"@react-navigation/native": "^6.0.2", | ||
"expo": "~51.0.2", | ||
"expo-asset": "~10.0.10", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-native": "0.74.0", | ||
"react-native-reanimated": "3.9.0-nightly-20240421-474f6983d", | ||
"react-native-svg": "link:../", | ||
"react-native-svg-transformer": "^1.4.0", | ||
"react-native-web": "0.19.11" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.20.0", | ||
"@expo/metro-runtime": "~3.2.1", | ||
"@react-native/metro-config": "^0.74.85", | ||
"@types/jest": "^29.5.12", | ||
"@types/react": "~18.2.45", | ||
"@types/react-test-renderer": "^18.0.7", | ||
"jest": "^29.2.1", | ||
"jest-expo": "~51.0.3", | ||
"react-test-renderer": "18.2.0", | ||
"typescript": "~5.3.3" | ||
}, | ||
"private": true | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bump reanimated to the newest version in all apps as a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WoLewicki Can I do it in the next PR based on this one?