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
Add in Latest Code From React Native #64
Conversation
shrug Add back inject Rework to use injectable currents Fix up exports NativeAnimatedHelper
Ah shit need to move back injectables Edit: Added it back |
package.json
Outdated
@@ -2,7 +2,7 @@ | |||
"name": "animated", | |||
"version": "0.2.0", | |||
"description": "Declarative Animations Library for React and React Native", | |||
"main": "lib/index.js", | |||
"main": "lib/targets/react-dom", |
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.
Why this change? Would react-native
and react-native-web
I need to import from animated/lib/targets/react-native
to get this working?
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.
Ah sorry. The index.js
doesn't exist anymore.
Now there is just AnimatedImplementation
and 2 targets.
Do you have an idea on how we can swap main
entry that when running on RN it points to lib/targets/react-native
and on web lib/targets/react-native
.
I know the react-native
packager will look at react-native
key in package.json. However not sure how that works inside of a library.
All in all. Do you know of a way I can support you on this? Add back index.js that just exports the RN implementation? Then also exports web
?
@necolas Updated
To the package.json to maintain imports but just disable them for browser. Let me know if that will break EDIT: Ah forgot this would only effect interactive-docs and not just the Should investigate a real build system for the web version. |
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.
I don't have the time to review this but I'm happy if it's still working!
@vjeux no worries, I figured. Interactive docs still build and run. Might actually go rebuild them to not have embedded babel on the page. |
I have no idea what the |
@necolas browser was just for the browserify build that generates the documentation. Need to probably drop the Native* stuff since it's just used for RN and or add a real build process vs just My ultimate goal with this is to bring this package and the RN implementation inline with each other for easier upgrading, and eventually RN depending on this library. So there is no So I removed it in favor of selecting specific targets. In the future the You are seemingly just pulling in the The https://github.com/animatedjs/animated/blob/master/src/targets/react-dom.js#L16 is what injects and overrides how styles are applied to DOM elements. |
Yeah I don't want to use the |
@necolas I will remove the ScrollView reference in this, as that was just react-native doing it's lazy loading and this is mostly for targeting web at the moment. Ideally this would be using ES6 imports but for some reason RN core hasn't switched over yet. Yes the idea would be that we could tell the packager via Either way a lot more work needs to be put into this before merging and I'll be sure to not break |
It looks like a potential RN diff would change https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/Animated.js#L15 var AnimatedImplementation = require('AnimatedImplementation'); to var AnimatedImplementation = require('animated'); …if this package continued to export the current |
Yeah I understand that. Why don't I just add back
Then we can solve the target issue later rather than in this upgrade. |
All patched up. Let me know what you think. |
@@ -28,8 +29,7 @@ | |||
}, | |||
"homepage": "https://github.com/animatedjs/animated#readme", | |||
"dependencies": { | |||
"invariant": "^2.2.0", | |||
"normalize-css-color": "^1.0.1" |
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.
seems like we could continue relying on this instead of copying over the implementation
@@ -45,7 +45,7 @@ | |||
"babel-preset-react": "^6.5.0", | |||
"babel-preset-react-native": "^1.4.0", | |||
"browserify": "^13.0.0", | |||
"react": "^15.4.0", | |||
"react-dom": "^15.4.0" | |||
"react": "^15.5.3", |
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.
did something change that made this library incompatible with react 15.4?
In general I'm a little bit bummed we are moving back to a flat file for this library. It's much harder to maintain. If we want to make it easier to stay in sync with RN, it might be better to submit a PR to RN core splitting it up into multiple files? I think we want to keep an Thanks for working on this! let's be careful though. I'd take a look through the commit history of this repo to make sure we aren't losing valuable bug fixes that have happened since the original "sync" from RN. |
I wasn't sure if you had split it out into separate files or if rn consolidated it all. I prefer separate files and I think best move is go submit a PR to RN like you said, and split out to files. I'm not sure why it's all in 1 big file honestly. Once all separate doing a diff should expose any potential areas that are different and or bug fixed to preserve. EDIT: Would it be easier to publish |
@browniefed I'd like to stay away from that if we can! |
@browniefed Any progress on this? Or is there anything I can help you with? |
Progress is being made in the RN repo. Janic has split everything out into it's separate files. Once that is accepted this can continue on. |
Closing this in favor of a different PR later. |
Ported latest react native code over. So much has changed. All things were moved into single file.
Added back in AnimatedTemplate (need to port this to RN)
Subscriptions on interpolations. Are added as well ( should port this to RN )