Comments (5)
Hi @SYoder1.
We don't have a reliable way of detecting whether the target of the bundle is going to be a native or web platform (correct me here if I'm wrong @bartlomiejbloniarz), therefore to omit the data that's unnecessary on web we have an option that you should pass to the plugin, namely omitNativeOnlyData
.
You can read more about it in our docs.
Please let me know if enabling this option fixes the bundle inflation.
from react-native-reanimated.
Hi @SYoder1, thanks for opening this issue.
Is this expected to increase the bundle size by that much?
The plugin needs to stringify all functions marked as 'worklet;'
so they can be copied to a secondary runtime so that might be a reason of the bundle size increase. However, there's no secondary runtime on web so we might want to skip that step (to save up on bundle size) and only auto-generate dependency arrays.
@tjzel What do you think?
from react-native-reanimated.
Hey @tjzel, I tried it out and saw small improvements with omitNativeOnlyData
, I also tried it with substituteWebPlatformChecks
and didn't see any changes
While still scratching my head at it, I noticed that the project compiles reanimated in the webpack config. I can't find any place in the docs that say to do this, so do you know if its needed at all? It actually makes the biggest difference around 50%.
const babelLoaderConfiguration = {
test: /\.js$|jsx?$/,
// Add every directory that needs to be compiled by Babel during the build.
include: [
path.resolve(__dirname, 'index.web.js'), // Entry to your application
path.resolve(__dirname, 'App.jsx'), // Change this to your main App file
path.resolve(appDirectory, 'node_modules/react-native-reanimated'),
],
use: {
loader: 'babel-loader',
options: {
cacheDirectory: true,
presets,
plugins: ['react-native-web'],
},
},
};
from react-native-reanimated.
Honestly I'm not that proficient with Webpack. I also don't exactly understand what do you mean by "project compiling Reanimated in the webpack config". Could you elaborate a little more on this?
Anyway, I think it should work without this setting, we never had something like this in our Webpack configs when we used them.
from react-native-reanimated.
I am not an expert in webpack either, and there was a comment in the code for a long time ago "// Add every directory that needs to be compiled by Babel during the build." and reanimated was part of it.
I think what was happening was we were recompiling reanimated from typescript to a esmodule at build time, instead of using the module that is part of the package.
from react-native-reanimated.
Related Issues (20)
- [Bug]: 3.10.0 - Uncaught exception 'NSUnknownKeyException', reason: '[<RCTUIManager 0x600002acc230> valueForUndefinedKey:] HOT 9
- Exception in Hostfunction: not implemented HOT 36
- onPress not work correctly HOT 4
- Shared transitions break when parent element uses justifyContent
- Property 'fill' was whitelisted both as UI and native prop. Please remove it from one of the lists. HOT 3
- SharedValue is an type of object, and sometimes a number HOT 6
- Animated.createAnimatedComponent() TypeError: Cannot read property 'remove' of undefined HOT 1
- [Android-IOS] [3.11.0] Animation update incorrect when setState after set shared value HOT 5
- NodesManager causing an app crash because of the "Map already consumed" HOT 2
- error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] HOT 3
- [Reanimated] Babel plugin exception: TypeError: (0 , types_12.cloneNode) is not a function HOT 1
- Unable to run on Android HOT 3
- ReferenceError: _updateDataSynchronously is not defined HOT 2
- [3.6.0] pod install error after upgrading 3.6.0 HOT 4
- Problems with react-native-reanimated v3.11.0 e react-native v 0.74.1 HOT 5
- Unable to resolve module ./publicGlobals HOT 4
- 【Bug】Modal displays incorrectly if use reanimated HOT 7
- [3.11.0] Plugin does not traverse node_modules, only the root of the project HOT 2
- Flickering in animation after updating react native HOT 8
- 1st item in an inverted list is no longer animated after a while with itemLayoutAnimation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-reanimated.