-
Notifications
You must be signed in to change notification settings - Fork 19
chore: Bump reanimated to latest versions #432
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
604ffd1
Bump reanimated to latest versions
MatiPl01 ea311b0
Some progress
MatiPl01 cace761
Fix fabric example
MatiPl01 b43a5f7
Patch reanimated 3.19.0
MatiPl01 1483d1d
Some progress
MatiPl01 e0d607c
Patch reanimated 4.0.1
MatiPl01 389eb08
Finish reanimated upgrade
MatiPl01 bbc3de5
Merge branch 'main' into chore/bump-reanimated
MatiPl01 b03e4ef
Fix TS error
MatiPl01 f875d91
Update example/app/scripts/metro.js
MatiPl01 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 hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,46 @@ | ||
const path = require('path'); | ||
|
||
function getDependencies(currentAppDir = '.', excludeCommon = []) { | ||
const commonAppDir = path.resolve(__dirname, '..'); | ||
const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); | ||
const currentAppPkg = require(path.resolve(currentAppDir, 'package.json')); | ||
|
||
const excludedCommonDeps = new Set(excludeCommon); | ||
|
||
const allDeps = new Set([ | ||
...[ | ||
...Object.keys(commonAppPkg.dependencies ?? {}), | ||
...Object.keys(commonAppPkg.devDependencies ?? {}) | ||
].filter(dep => !excludedCommonDeps.has(dep)), | ||
...Object.keys(currentAppPkg.dependencies ?? {}), | ||
...Object.keys(currentAppPkg.devDependencies ?? {}) | ||
]); | ||
|
||
const result = {}; | ||
|
||
for (const dep of allDeps) { | ||
// Find versions in both package.json files | ||
const commonVersion = | ||
commonAppPkg.dependencies?.[dep] ?? commonAppPkg.devDependencies?.[dep]; | ||
const currentVersion = | ||
currentAppPkg.dependencies?.[dep] ?? currentAppPkg.devDependencies?.[dep]; | ||
|
||
if (!commonVersion || !currentVersion || commonVersion === currentVersion) { | ||
result[dep] = { | ||
root: path.resolve(currentAppDir, `../../node_modules/${dep}`) | ||
}; | ||
} else { | ||
// Include from the local node_modules only if the dependency is present | ||
// in the current app and versions are different | ||
result[dep] = { | ||
root: path.resolve(currentAppDir, `node_modules/${dep}`) | ||
}; | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
|
||
module.exports = { | ||
getDependencies | ||
}; |
This file contains hidden or 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,37 @@ | ||
const path = require('path'); | ||
const escape = require('escape-string-regexp'); | ||
const { | ||
wrapWithReanimatedMetroConfig | ||
} = require('react-native-reanimated/metro-config'); | ||
|
||
function createMetroConfig(defaultConfig, currentAppDir, options = {}) { | ||
const { excludeFromRoot = [] } = options; | ||
|
||
const monorepoRoot = path.resolve(currentAppDir, '../..'); | ||
|
||
const config = { ...defaultConfig }; | ||
config.resolver ??= {}; | ||
|
||
config.watchFolders = [currentAppDir, monorepoRoot]; | ||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(currentAppDir, 'node_modules'), | ||
path.resolve(currentAppDir, '../app/node_modules'), | ||
path.resolve(monorepoRoot, 'node_modules') | ||
]; | ||
config.resolver.disableHierarchicalLookup = true; | ||
|
||
if (excludeFromRoot.length > 0) { | ||
config.resolver.blockList = excludeFromRoot.map( | ||
m => | ||
new RegExp( | ||
`^${escape(path.join(monorepoRoot, 'node_modules', m))}\\/.*$` | ||
) | ||
); | ||
} | ||
|
||
return wrapWithReanimatedMetroConfig(config); | ||
} | ||
|
||
module.exports = { | ||
createMetroConfig | ||
}; |
This file contains hidden or 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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
const path = require('path'); | ||
const { getDefaultConfig } = require('expo/metro-config'); | ||
const { createMetroConfig } = require('../app/scripts/metro'); | ||
|
||
const monorepoRoot = path.resolve(__dirname, '../..'); | ||
const defaultConfig = getDefaultConfig(__dirname); | ||
|
||
const config = getDefaultConfig(__dirname); | ||
|
||
config.watchFolders = [__dirname, monorepoRoot]; | ||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(__dirname, 'node_modules'), | ||
path.resolve(__dirname, '../app/node_modules'), | ||
path.resolve(monorepoRoot, 'node_modules') | ||
]; | ||
config.resolver.disableHierarchicalLookup = true; | ||
|
||
module.exports = config; | ||
module.exports = createMetroConfig(defaultConfig, __dirname); |
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.