Use static closures when not using $this#50723
Conversation
Yes, it was almost identical, inspired by @westonruter's PR in WordPress/performance#729 👍 |
spacedmonkey
left a comment
There was a problem hiding this comment.
This is nearly there. I have one nitpic, then I will approve.
Once approved, it can be merged with the admin permissions if the JS linting errors are the only blocker in the CI check. |
|
@aristath Sorry that I didn't check for your PR first! What do we think about including |
…dd/static-closures * 'trunk' of https://github.com/WordPress/gutenberg: (26 commits) Add transparent outline to input control BackdropUI focus style. (#50772) Added wrapper element for RichText in File block (#50607) Remove the experimental flag of the command center (#50781) Update the document title in the site editor to open the command center (#50369) Remove `unwrap` from transforms and add `ungroup` to more blocks (#50385) Add new experimental version of DropdownMenu (#49473) Force display of in custom css input boxes to LTR (#50768) Polish experimental navigation block (#50670) Support negation operator in selectors in the Interactivity API (#50732) Minor updates to theme.json schema pages (#50742) $revisions_controller is not used. Let's delete it. (#50763) Remove OffCanvasEditor (#50705) Mobile - E2E test - Update code to use the new navigateUp helper (#50736) Try: Smaller external link icon (#50728) Block Editor: Remove unused 'useIsDimensionsSupportValid' method (#50735) Fix flaky media inserter drag-and-dropping e2e test (#50740) docs: Fix change log typo (#50737) Edit Site: Fix `useEditedEntityRecord()` loading state (#50730) Fix labelling, description, and focus style of the block transform to pattern previews (#50577) Fix Global Styles sidebar block selection on zoom out mode (#50708) ...
|
Flaky tests detected in 89b582f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5026422903
|
|
So include |
aristath
left a comment
There was a problem hiding this comment.
This looks good to me 👍
So include
slevomat/coding-standardor not?
I suppose we could merge the improvements from this PR without including slevomat/coding-standard just to get this part out of the way, and create a separate issue to include the slevomat/coding-standard package where we can focus more on that discussion 👍
Backports Gutenberg changes from WordPress/gutenberg#50723. Amends [55822]. Fixes #58323. Props westonruter, spacedmonkey, flixos90. git-svn-id: https://develop.svn.wordpress.org/trunk@56038 602fd350-edb4-49c9-b593-d223f7449a82
Backports Gutenberg changes from WordPress/gutenberg#50723. Amends [55822]. Fixes #58323. Props westonruter, spacedmonkey, flixos90. Built from https://develop.svn.wordpress.org/trunk@56038 git-svn-id: https://core.svn.wordpress.org/trunk@55550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Backports Gutenberg changes from WordPress/gutenberg#50723. Amends [55822]. Fixes #58323. Props westonruter, spacedmonkey, flixos90. Built from https://develop.svn.wordpress.org/trunk@56038 git-svn-id: http://core.svn.wordpress.org/trunk@55550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Add
statickeyword to closures that don't use$thisWhy?
Since closures capture a reference to
$this, memory leaks can ensue.This applies the same change that was just made in Core-58323
How?
I used the
SlevomatCodingStandard.Functions.StaticClosuresniff to apply the change withphpcbf.Testing Instructions
n/a
Testing Instructions for Keyboard
n/a
Screenshots or screencast