Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌲 Reduce bundle size on Web by 80% (#3278)
- Loading branch information
Showing
25 changed files
with
160 additions
and
97 deletions.
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
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
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
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
export { default as createAnimatedComponent } from './createAnimatedComponent'; | ||
export { | ||
addWhitelistedNativeProps, | ||
addWhitelistedUIProps, | ||
} from './ConfigHelper'; | ||
|
||
export { default as Text } from './reanimated2/component/Text'; | ||
export { default as View } from './reanimated2/component/View'; | ||
export { default as ScrollView } from './reanimated2/component/ScrollView'; | ||
export { default as Image } from './reanimated2/component/Image'; | ||
export { default as FlatList } from './reanimated2/component/FlatList'; |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
// tree-shaken side effects | ||
import './reanimated2/js-reanimated/global'; | ||
|
||
export * from './reanimated2'; | ||
export * as default from './Animated'; |
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
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,6 @@ | ||
import { Image } from 'react-native'; | ||
import createAnimatedComponent from '../../createAnimatedComponent'; | ||
|
||
const AnimatedImage = createAnimatedComponent(Image as any); | ||
|
||
export default AnimatedImage; |
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,6 @@ | ||
import { ScrollView } from 'react-native'; | ||
import createAnimatedComponent from '../../createAnimatedComponent'; | ||
|
||
const AnimatedScrollView = createAnimatedComponent(ScrollView); | ||
|
||
export default AnimatedScrollView; |
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,6 @@ | ||
import { Text } from 'react-native'; | ||
import createAnimatedComponent from '../../createAnimatedComponent'; | ||
|
||
const AnimatedText = createAnimatedComponent(Text as any); | ||
|
||
export default AnimatedText; |
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,6 @@ | ||
import { View } from 'react-native'; | ||
import createAnimatedComponent from '../../createAnimatedComponent'; | ||
|
||
const AnimatedView = createAnimatedComponent(View); | ||
|
||
export default AnimatedView; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
// In order to keep bundle size down, we treat this file as a polyfill for Web. | ||
|
||
import { shouldBeUseWeb } from '../PlatformChecker'; | ||
|
||
if (shouldBeUseWeb()) { | ||
global._frameTimestamp = null; | ||
global._setGlobalConsole = (_val) => { | ||
// noop | ||
}; | ||
global._measure = () => { | ||
console.warn( | ||
"[Reanimated] You can't use `measure` with Chrome Debugger or with web version" | ||
); | ||
return { | ||
x: 0, | ||
y: 0, | ||
width: 0, | ||
height: 0, | ||
pageX: 0, | ||
pageY: 0, | ||
}; | ||
}; | ||
global._scrollTo = () => { | ||
console.warn( | ||
"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version" | ||
); | ||
}; | ||
global._dispatchCommand = () => { | ||
console.warn( | ||
"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version" | ||
); | ||
}; | ||
global._setGestureState = () => { | ||
console.warn( | ||
"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version" | ||
); | ||
}; | ||
} |
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
Oops, something went wrong.