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

Deprecated the selectors/actions and components that moved to the block editor module #15770

Merged

Conversation

youknowriad
Copy link
Contributor

Testing instructions

  • Check that if you call, wp.data.select( 'core/editor' ).getSelectedBlock() in the console it works but shows a warning.

  • Change an import RichText and use editor instead of block-editor in one of the core blocks and check that there are warnings on the console when used.

@youknowriad youknowriad added Framework Issues related to broader framework topics, especially as it relates to javascript [Package] Block editor /packages/block-editor labels May 22, 2019
@youknowriad youknowriad requested a review from talldan as a code owner May 22, 2019 08:37
@youknowriad youknowriad self-assigned this May 22, 2019
@youknowriad youknowriad requested a review from a team May 22, 2019 08:37
@youknowriad youknowriad force-pushed the update/deprecated-editor-action-selectors-components branch from 09069de to 054b6fb Compare May 22, 2019 09:59
@aduth
Copy link
Member

aduth commented May 22, 2019

This looks like a great way to keep ourselves honest and correct in code 👍

There's still one which needs to be updated. From the failing build:

wp.editor.withColors is deprecated and will be removed. Please use wp.blockEditor.withColors instead.

@youknowriad
Copy link
Contributor Author

@aduth I think this comes from a plugin :p I wonder if it's time to remove the "plugins" test :)

@aduth
Copy link
Member

aduth commented May 22, 2019

Alternatively, we may consider another exception in the console trapping to permit warnings (and optionally errors, though probably not to start) from plugins, determined based on ConsoleWarning#location (though, as I write this, the location is probably the deprecated script, not the plugin).

withColorContext,
withColors,
withFontSizes,
Autocomplete as RootAutocompete,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Autocomplete as RootAutocompete,
Autocomplete as RootAutocomplete,

};
}

export const Autocomplete = deprecateComponent( 'Autocomplete', RootAutocompete );
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const Autocomplete = deprecateComponent( 'Autocomplete', RootAutocompete );
export const Autocomplete = deprecateComponent( 'Autocomplete', RootAutocomplete );

@youknowriad
Copy link
Contributor Author

What do you all think about removing the plugins tests? cc @gziolo How can we unblock this?

@gziolo
Copy link
Member

gziolo commented May 29, 2019

We can either remove integration with 3rd party plugins or silence this warning on Travis. I would prefer the first one.

@youknowriad youknowriad force-pushed the update/deprecated-editor-action-selectors-components branch from 4a11571 to f53a700 Compare June 3, 2019 09:13
@youknowriad youknowriad force-pushed the update/deprecated-editor-action-selectors-components branch from f53a700 to d61578d Compare June 6, 2019 10:35
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

I double checked all deprecated components are still exposed to avoid issues with 3rd party plugins.

I think we should still include an entry in the changelog about all those functions and components which will now warn on JS console so folks using npm package could take same actions.

Otherwise, everything works and looks good.

@youknowriad
Copy link
Contributor Author

I'm hesitant about the docs as we don't have a formal process for Core deprecations yet. A document is indeed needed but probably not the one we have right now for plugin deprecations and also there's already a bunch of other Core deprecations.

@gziolo
Copy link
Member

gziolo commented Jun 7, 2019

I was thinking about something like:

in packages/editor/CHANGELOG.md:

### Deprecations

- It's now recommended to use the following components from `@wordpress/block-editor` package:
  - `Component1`
  - `Component2`

@youknowriad youknowriad merged commit a8e9692 into master Jun 10, 2019
@youknowriad youknowriad deleted the update/deprecated-editor-action-selectors-components branch June 10, 2019 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Package] Block editor /packages/block-editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants