Skip to content
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

Async storage warning on React Native 0.59 #34

Closed
shaundon opened this issue Mar 14, 2019 · 27 comments
Closed

Async storage warning on React Native 0.59 #34

shaundon opened this issue Mar 14, 2019 · 27 comments

Comments

@shaundon
Copy link
Contributor

Describe the bug
React Native's async storage has been deprecated. This means that when using Storybook with RN 0.59, a warning appears (see screenshot).

This is on @storybook/react-native: 4.1.14. I'm unsure if 5.x is affected.

To Reproduce
Steps to reproduce the behavior:

  1. Be on RN 0.59
  2. Use Storybook 4.x
  3. See warning

Expected behavior
A warning not to appear 🙈

Screenshots
Simulator Screen Shot - iPhone 8 - 2019-03-13 at 18 05 13

System:

  • Framework: [React Native]
  • Version: [e.g. 4.1.14]

Additional context
I'm going to try and make a PR for this - it should be trivial to fix by moving over to the community-supported version of async storage.

@shilman
Copy link
Member

shilman commented Mar 14, 2019

@shaundon Great catch. Would be great to get this into the 5.1 release which will re-introduce React Native (we didn't release a 5.0 version due to timing issues).

cc @benoitdion

@shaundon
Copy link
Contributor Author

@shilman no worries - how would you feel about also putting it in a 4.1.x patch release too? The reason being we're still using Storybook 4.1 and upgrading to 5 is going to be a larger task that we're not in a position to undertake yet, so it'd be good to get this fixed in both versions.

@shaundon
Copy link
Contributor Author

⬆️ There's a PR for it - hopefully I've done everything correctly! Let me know if there's anything I've missed.

@benoitdion
Copy link
Member

Even though this is a trivial change I'd like to defer this to the 5.x release since this does bring in an additional dependency. react-native-async-storage's peer dependency version of react-native is 57 and storybook's 4.x is 51.

@shaundon
Copy link
Contributor Author

On the next branch, the RN version is 52 - so won't the peer dependency concern continue to be an issue in the 5.x release?

@benoitdion
Copy link
Member

It would be. Added a comment to your PR recommending we bump our peer dependency to 57.

@shilman storybook 5.x is a good opportunity to bump our react native peer dependency version. Both expo and react-native-web have support for >= 57 so that's pretty safe.

@benoitdion
Copy link
Member

fixed in storybookjs/storybook#6079. Thanks @shaundon!

@shilman
Copy link
Member

shilman commented Mar 16, 2019

Huzzah!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.7 containing PR storybookjs/storybook#6079 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

@shaundon
Copy link
Contributor Author

Amazing, thanks! The repo I work on is still on 4.1.x but I'll have a go with a branch using 5.1.0-alpha soon.

@yurykorzun
Copy link

yurykorzun commented Mar 26, 2019

The fix was reversed - storybookjs/storybook@0d7581a
It looks like we are stuck with the warning for a while react-native-async-storage/async-storage#14

@lucasbento
Copy link

lucasbento commented Apr 8, 2019

@benoitdion: any plans on reversing the reversed commit (haha) anytime soon? I see that the issue you linked is closed and seems to have been solved.

@benoitdion
Copy link
Member

Absolutely. I'd love to give this another try. Testing takes a bit of time since we need to validate the entire matrix (expo, ejected, app using AsyncStorage, app using community AsyncStorage)

@bericp1
Copy link

bericp1 commented May 8, 2019

Hey @benoitdion: any word on if this has made it into any recent alphas? Couldn't find any other issue tracking this and this one is still closed. I can submit a PR to reverse the reversed commit if that's helpful at all.

Normally warnings are manageable but this one covers the entire toolbar at the bottom even when it
s minimized. 😢

@benoitdion
Copy link
Member

not the answer you're looking for but you could use YellowBox.ignoreWarnings for now.

We could try this again now though, they've made a lot of improvements to the community asyncstorage now it should be ready

@bericp1
Copy link

bericp1 commented May 9, 2019

Oh nice I didn't know that RN API existed. Obviously not preferable but we can use that for the time being. We use a react-native-config variable anyway to control rendering of storybook vs. the app in the entry point so we can do it only for storybook which is acceptable.

Cheers!

@joan-saum
Copy link

Any news about this issue ? I have @storybook/react-native in 5.1.9 and still got that warning :/

@shilman shilman reopened this Jul 2, 2019
@barbieri
Copy link

barbieri commented Jul 10, 2019

meanwhile to quiet the warning one can use the following fixup:

const ReactNative = require('react-native');
Object.defineProperty(ReactNative, 'AsyncStorage', {
  get(): any {
    return require('@react-native-community/async-storage').default;
  },
});

@stale
Copy link

stale bot commented Jul 31, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@techgerm
Copy link

techgerm commented Jul 31, 2019

This is still the sole issue that's holding us back from upgrading to React Native ^0.60 now that it has been released.
@benoitdion any plans on trying to merge this again soon?

@techgerm
Copy link

techgerm commented Aug 7, 2019

@shilman Was this labeled as has workaround since we can quiet the warning?

From my understanding, there is no current workaround to actually upgrade to React Native 0.60 without having this issue resolved and that is the bigger problem here than just seeing a warning.

If this issue is only concerned about hiding the warning, should I open a separate issue detailing how this is preventing folks from upgrading to React Native ^0.60?

@shilman
Copy link
Member

shilman commented Aug 7, 2019

@germanp173 Yeah I was referring to the comment above for how to quiet the warning. Re: the upgrade, any interest in putting together a PR for this? I think that would be the easiest way to help push things forward here.

@techgerm
Copy link

techgerm commented Aug 7, 2019

@shilman roger that ... I'll see if I can put one together this weekend, thanks 👍

@joan-saum
Copy link

@germanp173 did you work on it by any chance ? :) If yes, could you reference your PR here? I think some people like me are subscribe to this issue

@Gongreg
Copy link
Member

Gongreg commented Aug 19, 2019

Hey, Since nobody worked on this I've created a PR for this issue. I am using approach that should support both expo/React Native <=0.59 and React Native >= .60 users. Tell me what you think about it.

@storybookjs storybookjs deleted a comment from stale bot Sep 9, 2019
@shilman
Copy link
Member

shilman commented Nov 5, 2019

Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.39 containing PR storybookjs/storybook#7801 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Nov 5, 2019
@cmejet
Copy link

cmejet commented Nov 18, 2019

This did seem to resolve, looking forward to next release coming out!

@jgreen210
Copy link

@shilman shilman transferred this issue from storybookjs/storybook Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests