Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

A test run at breaking async storage out of what is normally shipped.#16

Merged
rmevans9 merged 6 commits into
betafrom
async-storage-breakout
Jul 15, 2019
Merged

A test run at breaking async storage out of what is normally shipped.#16
rmevans9 merged 6 commits into
betafrom
async-storage-breakout

Conversation

@rmevans9

@rmevans9 rmevans9 commented Mar 6, 2019

Copy link
Copy Markdown
Contributor

This would be a breaking change because it introduces these two things:

  1. useReactNative no longer takes the configuration for async storage and doesn't turn it on at all
  2. The client id is basically nullified and thus users could run into issues with Android simulators duplicating connections.

The changes a user would have to do it their config are:

import Reactotron from "reactotron-react-native"
+ import useAsyncStorageClientId from "reactotron-react-native/dist/useAsyncStorageClientId"
+ import asyncStoragePlugin from "reactotron-react-native/dist/plugins/asyncStorage"

{...}

Reactotron.configure({
  name: "Demo App",
+  ...useAsyncStorageClientId,
})

Reactotron.useReactNative({
-  asyncStorage: { ignore: ['secret'] }
})

+ Reactotron.use(asyncStoragePlugin({ ignore: ["secret"] }))

@jamonholmgren jamonholmgren left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there somewhere you can document the new API?

@rmevans9

rmevans9 commented Mar 6, 2019

Copy link
Copy Markdown
Contributor Author

Yeah, right now the documentation for all things reactotron live on the main repo. If I am going to merge this there would have to be a matching PR on that repo to document this change.

I have been going back and forth on pushing the documentation that is specific to each reactotron repo to the repo itself. I am open to suggestion on that front as well.

@jamonholmgren

Copy link
Copy Markdown
Member

I am okay with it living on the main repo!

@rmevans9

Copy link
Copy Markdown
Contributor Author

I've changed directions on this a little bit so that we are not so dependent on specific implementations. This now works with anything that has a setItem(KEY, VALUE) and getItem(KEY). This is the change to the configuration users will have to implement:

import { AsyncStorage } from 'react-native' // OR import it from the community one
{...}
Reactotron.setAsyncStorageHandler(AsyncStorage)
{...}
Reactotron.useReactNative()
{...}
Reactotron.connect()

@djMax

djMax commented May 17, 2019

Copy link
Copy Markdown

I like the sethandler approach a lot better than the original, so +1 from the peanut gallery.

@rmevans9

Copy link
Copy Markdown
Contributor Author

@djMax I hardly call a consumer of this library the peanut gallery. Thanks for your input!

I am thinking that is the direction this is going to go. It will have to be a breaking change so I will need to update some docs and make sure to get this called out when I go to merge this. I will have this all wrapped up before .60 lands in stable 👍

@jhonlly

jhonlly commented Jun 15, 2019

Copy link
Copy Markdown

Hi everyone. I'm trying to use with @react-native-community/async-storage but not working. I use "reactotron-react-native": "3.6.2". How I can use it?

Thanks.

@rmevans9

Copy link
Copy Markdown
Contributor Author

I need to get this merged then you should be good to go. I will try and work on that this weekend

@lucaashrq

Copy link
Copy Markdown

Any update for this issue?

@rodrigofeijao

Copy link
Copy Markdown

@rmevans9 Let me know if you need any help on this. would be amazing having this out asap. Apparently there's a bunch of people complaining about it.

@rmevans9 rmevans9 changed the base branch from master to beta July 15, 2019 00:30
@rmevans9

Copy link
Copy Markdown
Contributor Author

I will be releasing this as a beta version tonight.

@rmevans9 rmevans9 merged commit 395a612 into beta Jul 15, 2019
@rmevans9 rmevans9 deleted the async-storage-breakout branch July 15, 2019 00:33
@infinitered-circleci

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rmevans9 rmevans9 restored the async-storage-breakout branch September 19, 2019 02:32
@rmevans9 rmevans9 deleted the async-storage-breakout branch September 19, 2019 02:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants