Repository navigation
Conversation
|
This looks good to me, I also wanted to remove this dependency since it's so old, from 2013. I'm already including a newer version of Jackson in the app, so I have to increase version of Jackson of this dependency in my React fork. One question though: If Jackson was indeed in so few files in the entire repository, why was it a dependency in the first place? Did it provide certain speed or space improvement over regular Android JSON classes? My experiences with |
|
@hey99xx : Thanks for your post. |
|
@mkonicek do you know the answer to @belemaire's question about why Jackson is used? Can you merge this PR or assign it to someone who's responsible for the debugger WebSocket code? |
|
I'll see if someone can take a look at this. |
|
We used jackson for performance reasons, although it historically has been used in the bridge implementation. Now that we only use it in debugger client it's reasonable to drop that dependency in favour of using builitin (slower) parser. Another option would be to make it dev only dependency but I think just getting rid of it completely makes better sense |
|
@kmagiera thanks! Let's try to remove the dependency then. @belemaire can you add to your first comment a test plan that shows you tested the modified code paths and that they still work? |
|
Thanks all for your comments and the history note, make sense. @kmagiera : Even so, he option of only making it a dev dependency won't entirely solve the problem. In our Android application we're also using Jackson during dev and for tests etc so some kind of versioning conflict still could happen. Don't know if I make sense ;P @ide : In my initial comment for this PR I mentioned that I had done prep-work adding tests in #10516 which got merged a few weeks back. |
|
@belemaire I mean non-automated tests, what steps did you take to make sure this code works? Just 2-3 sentences is fine. |
|
@belemaire Thanks for working on this, we should merge this. Every pull request should have a Test Plan to make sure the code doesn't break anything: https://github.com/facebook/react-native/blob/master/.github/PULL_REQUEST_TEMPLATE.md In this case, the PR summary should contain an explanation of how you tested debugging in Chrome works, e.g. "I ran this app, set a breakpoint here, here's a screenshot showing the Chrome debugger stopped at that breakpoint. Tried reloading JS, the app still works and Chrome debugger stopped at the breakpoint again. Disabled Chrome debugging, app works fine, Reload JS works fine." or similar. The reason we have this test plan is because it helps reviewers understand the code doesn't break anything. Every commit internally at fb needs to have a test plan too. Sometimes the test plan misses something important, and the reviewer doesn't realize that either, and the code does break something. That's why the more detailed test plan the better. Thanks for adding the unit tests in #10516! If the unit tests you added make it 100% certain debugging in Chrome still works with this pull request, you could simply say "Test Plan: Unit tests added in #10516". But since Chrome debugging is very complex it still seems safer to manually check the end-to-end workflow. |
ddcf8e0 to
2ecca17
Compare
|
@mkonicek @ide : Thanks for the precisions. I totally get it. Even more because going through manual testing, I actually found a bug that was not covered by unit tests and made the app crash on start-up. Will keep that in mind for future PRs. I updated the code to fix this bug and also added a few unit tests to cover these cases. Please find manual test plan below : The following test plan / steps have been conducted two times. First time, using current master code (without this PR code) and a second time using this PR modified code.
Please let me know if you need more. |
|
Thanks a lot for testing this thoroughly @belemaire! The Circle CI build failed with an unrelated error. I just hit rebuild. |
2ecca17 to
4ed5b5b
Compare
|
@mkonicek : Thanks for looking into this and relaunching a build. |
|
Tests passed now. @facebook-github-bot shipit |
|
@mkonicek has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
This PR removes dependency to Jackson third-party library in Android React Native.
Looking at some older PRs that got merged, it seems like some work had already been done to move away from Jackson.
Anyway, there was only two classes left with a dependency on Jackson. I refactored the code to use android built-in
JsonReaderandJsonWriterclasses instead.Prep work was done in #10516 introducing a few unit tests around serialization, to make sure that refactoring around serialization would not break things.
All references to Jackson in build systems files (BUCK files & build.gradle) have also been removed now that no code depend anymore on this third-party library.
Motivation behind this work is that third-party dependencies in Android React Native can prove to be a pain when trying to integrate React Native components into an already existing large Android application (I know this is not the most common use case for react-native ... yet ;P), that might also depend on similar third-party libraries at a different version. Getting rid of Jackson was the easiest starter work as it's usage in the current code was very limited.