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

Address useSelect different value performance warnings #53738

Open
1 of 3 tasks
dcalhoun opened this issue Aug 16, 2023 · 1 comment
Open
1 of 3 tasks

Address useSelect different value performance warnings #53738

dcalhoun opened this issue Aug 16, 2023 · 1 comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Performance Related to performance efforts

Comments

@dcalhoun
Copy link
Member

dcalhoun commented Aug 16, 2023

Description

Address warnings outputted from the native mobile editor as a result of #53666. I encountered this warning in a couple of locations; Link Picker, Reusable blocks in the block inserter. There are likely several other places to uncover and address.

Known locations:

Example warning
WARN  The 'useSelect' hook returns different values when called with the same state and parameters. This can lead to unnecessary rerenders.
    at ReusableBlocksTab (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:375969:24)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at AnimatedComponent (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:53928:38)
    at AnimatedComponentWrapper
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at InserterTabs (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:375626:25)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at TouchableHighlight (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:82799:36)
    at TouchableHighlight
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at KeyboardAvoidingView (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:356711:36)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at AnimatedComponent (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:53928:38)
    at AnimatedComponentWrapper
    at withAnimatable(View) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:346937:38)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at AppContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48667:36)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at VirtualizedListContextResetter (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:58647:24)
    at RCTModalHostView
    at Modal (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:93586:36)
    at ReactNativeModal (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:346246:36)
    at BottomSheet (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:345579:36)
    at WithPreferredColorScheme(BottomSheet) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:229333:62)
    at InserterMenu (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:374795:24)
    at Dropdown (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:292935:36)
    at Inserter (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:374386:36)
    at WithPreferredColorScheme(Inserter) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:229333:62)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithSelect(WithPreferredColorScheme(Inserter)) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at WithDispatch(WithSelect(WithPreferredColorScheme(Inserter))) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:231389:65)
    at RCTScrollContentView
    at RCTScrollView
    at ScrollView (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:50191:36)
    at ScrollView
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at HeaderToolbar (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:436329:23)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithViewportMatch(HeaderToolbar) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at WithDispatch(WithViewportMatch(HeaderToolbar)) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:231389:65)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithSelect(WithDispatch(WithViewportMatch(HeaderToolbar))) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at Header (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:436243:36)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at KeyboardAvoidingView (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:93373:36)
    at AnimatedComponent (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:53928:38)
    at AnimatedComponentWrapper
    at KeyboardAvoidingView (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:357668:28)
    at RCTSafeAreaView
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at TooltipSlot (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:318367:25)
    at Layout (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:435914:36)
    at WithPreferredColorScheme(Layout) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:229333:62)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithSelect(WithPreferredColorScheme(Layout)) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at RNCSafeAreaProvider
    at SafeAreaProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:351403:24)
    at BlockRefsProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:407822:24)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:407708:25)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:407755:37)
    at WithRegistryProvider(Component)
    at BlockContextProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:367990:21)
    at EntityProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:404018:20)
    at EntityProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:404018:20)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:432531:34)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:432849:40)
    at WithRegistryProvider(Component)
    at EditorProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:432666:14)
    at NativeEditorProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:432006:36)
    at WithDispatch(NativeEditorProvider) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:231389:65)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithSelect(WithDispatch(NativeEditorProvider)) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at SlotFillProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:318746:36)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at GestureHandlerRootView
    at Editor (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:435703:36)
    at WithDispatch(Editor) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:231389:65)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:230843:49)
    at WithSelect(WithDispatch(Editor)) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:228854:38)
    at Gutenberg (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:1204:38)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48789:43)
    at AppContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:48667:36)
    at gutenberg(RootComponent) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=com.automattic.jetpack:85056:28)
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Server._symbolicate (/Users/davidcalhoun/Sites/a8c/gutenberg-mobile/node_modules/metro/src/Server.js:1050:31)
    at async Server._processRequest (/Users/davidcalhoun/Sites/a8c/gutenberg-mobile/node_modules/metro/src/Server.js:444:7)

Step-by-step reproduction instructions

This is one example, there are likely others.

  1. Open the mobile editor.
  2. Add a Paragraph block.
  3. Tap the link button to insert a hyperlink.
  4. Tap "Search or type URL."
  5. Type a query into the search field.

Expected behaviour

No warnings are outputted.

Actual behaviour

Warnings are outputted.

Screenshots or screen recording (optional)

Minimized Expanded
minimized expanded

WordPress information

  • WordPress version: 6.3
  • Gutenberg version: c7324af
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: iPhone 13 mini simulator
  • Operating system: iOS 16.4
  • WordPress app version: Gutenberg c7324af
@dcalhoun dcalhoun added [Type] Performance Related to performance efforts Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Aug 16, 2023
@geriux
Copy link
Member

geriux commented Aug 18, 2023

Updated the ticket to link #53813 which addresses the warning for the SearchResults and ReusableBlocksTab components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Performance Related to performance efforts
Projects
None yet
Development

No branches or pull requests

2 participants