Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#64647 closed enhancement (fixed)

Interactivity API: Update loading bar to use private router store

Reported by: luisherranz's profile luisherranz Owned by: luisherranz's profile luisherranz
Milestone: 7.0 Priority: normal
Severity: normal Version:
Component: Interactivity API Keywords: has-patch
Focuses: Cc:

Description

The Interactivity Router store contains internal properties (state.navigation.hasStarted, state.navigation.hasFinished) that are not part of the public API. Gutenberg PR #70882 moves these properties to a new private core/router/private store and adds deprecation warnings when they are accessed through the public core/router store.

The loading bar markup in WordPress Core (WP_Interactivity_API::print_router_markup()) currently uses data-wp-interactive="core/router" to bind to these internal navigation properties. This needs to be updated to data-wp-interactive="core/router/private" so it accesses the private store directly, avoiding the deprecation warnings.

Change History (3)

This ticket was mentioned in PR #10942 on WordPress/wordpress-develop by @luisherranz.


4 weeks ago
#1

  • Keywords has-patch added

The Interactivity Router store contains internal properties (state.navigation.hasStarted, state.navigation.hasFinished) that are not part of the public API. Gutenberg PR #70882 moves these properties to a new private core/router/private store and adds deprecation warnings when they are accessed through the public core/router store.

This PR updates the loading bar markup in WP_Interactivity_API::print_router_markup() to use data-wp-interactive="core/router/private" instead of data-wp-interactive="core/router", so it accesses the private store directly and avoids triggering the deprecation warnings.

Trac ticket: https://core.trac.wordpress.org/ticket/64647
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/70882

#2 @luisherranz
4 weeks ago

  • Owner set to luisherranz
  • Resolution set to fixed
  • Status changed from new to closed

In 61653:

Interactivity API: Use the private router store for the loading bar markup.

Update the data-wp-interactive directive in the loading bar from core/router to core/router/private so that internal navigation state properties (hasStarted, hasFinished) are not exposed as part of the public core/router store API.

Props westonruter.
Fixes #64647.

@luisherranz commented on PR #10942:


4 weeks ago
#3

Thanks, Weston! 🙏❤️

Note: See TracTickets for help on using tickets.