fausto95 / rn-async-storage-flipper Goto Github PK
View Code? Open in Web Editor NEWReact Native's Async Storage logger for Flipper
React Native's Async Storage logger for Flipper
Implement a React component instead of the current implementation for the plugin UI
It looks like the plugin has both a dependency and peerDependency on react-native-flipper
v0.37.0
, which is causing peer requirements to fail (for version 0.83.0) in yarn.
If you need this provided for developing locally, is it safe to remove dependencies
entirely and rely on devDependencies
?
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch [email protected]
for the project I'm working on.
Typescript error as referenced in #46
Here is the diff that solved my problem:
diff --git a/node_modules/rn-async-storage-flipper/index.d.ts b/node_modules/rn-async-storage-flipper/index.d.ts
index 704da6a..08d7117 100644
--- a/node_modules/rn-async-storage-flipper/index.d.ts
+++ b/node_modules/rn-async-storage-flipper/index.d.ts
@@ -1,10 +1,10 @@
interface Storage {
- getAllKeys(callback?: (error?: Error, keys?: string[]) => void): Promise<string[]>;
+ getAllKeys(callback?: (error?: Error | null, keys?: readonly string[] | null) => void): Promise<readonly string[]>;
multiGet(
keys: string[],
- callback?: (errors?: Error[], result?: [string, string | null][]) => void
- ): Promise<[string, string | null][]>;
+ callback?: (errors: readonly (Error | null)[] | null | undefined, result?: readonly [string, string | null][]) => void
+ ): Promise<void | readonly [string, string | null][]>;
}
export default function RNAsyncStorageFlipper(_storage: Storage): void;
This issue body was partially generated by patch-package.
When a key/value is displayed in Flipper and you delete that key with something like await AsyncStorage.removeItem(KEY)
the state of the table still shows that the key with old values is there.
RN: 0.62.2
Flipper: 0.49.0
@react-native-community/async-storage: 1.11.0
On cold starts, we might not have the data in the client, we should have a button to send a message to the RN client in order to get data back.
It would be cool if we could apply this plugin only in development mode, much like react-query-native-devtools
does.
Hi,
Thanks for the library. I am a big fan of it. I am a little confused about how to use it though.
The README mentions that we should use RNAsyncStorageFlipper(AsyncStorage)
- but do we do this just once, or do we run this every time we want to update the reading from the Database? Because I do it once in App.js
and the values never update.
Thanks.
The peerDependecies
for rn-async-storage-flipper
are too restrictive:
@react-native-async-storage/async-storage: 1.15.4
, react-native: 0.63.2
and react-native-flipper: 0.87.0
I got two warning when running npm install
:
npm WARN [email protected] requires a peer of react-native@^0.62.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native-flipper@^0.37.0 but none is installed. You must install peer dependencies yourself.
npm semver consider react-native: 0.63.2
not compatible with ^0.62.0
because the major version is 0
(Same behavior with react-native-flipper
)
Please remove peerDependecies
or make them less restrictive in particular for react-native
and react-native-flipper
because these libraries are updated very often
When pressing "Get Data" it triggers a flipper "crash":
With only this information available in the crash reporter:
I see no mentions of sendMeData anywhere other than
But I see no attempts to register this receiver or anything like it.
I'm using Flipper 0.81.0 but also tried the most recent 0.84 (which has a performance regression issue).
Any idea what could cause this? From what I can tell it's using client.call() which is deprecated:
https://fbflipper.com/docs/extending/js-plugin-api
When the data is persisted and we refresh the page, we should diff the current data we have and the incoming one to determine if we need to update
It's in the peer deps and the "real" deps and is a fairly old version. I can make a PR, but wondered if there's any intent around the fact that it's in both places.
rn-async-storage-flipper
depends on @react-native-community/async-storage
, but they've split off into their own org: @react-native-async-storage/async-storage
IMHO it's their fault for doing this in a minor, BUT:
error TS2345: Argument of type 'AsyncStorageStatic' is not assignable to parameter of type 'Storage'.
Types of property 'getAllKeys' are incompatible.
Type '(callback?: CallbackWithResult<readonly string[]> | undefined) => Promise<readonly string[]>' is not assignable to type '(callback?: ((error?: Error | undefined, keys?: string[] | undefined) => void) | undefined) => Promise<string[]>'.
Types of parameters 'callback' and 'callback' are incompatible.
Types of parameters 'error' and 'error' are incompatible.
Type 'Error | null | undefined' is not assignable to type 'Error | undefined'.
Type 'null' is not assignable to type 'Error | undefined'.
Which happens on:
RNAsyncStorageFlipper(AsyncStorage);
NPM page for this package (https://www.npmjs.com/package/flipper-plugin-async-storage) has 2 broken links:
Probably they became broken after Github changed URL structure
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.