Skip to content

Fix missing wp-views script dependency notice#3084

Open
pfefferle wants to merge 5 commits intotrunkfrom
fix/wp-views-dependency
Open

Fix missing wp-views script dependency notice#3084
pfefferle wants to merge 5 commits intotrunkfrom
fix/wp-views-dependency

Conversation

@pfefferle
Copy link
Member

Proposed changes:

  • Fix the wp-views unregistered dependency notice introduced in WordPress 6.9.1 by bundling @wordpress/views instead of externalizing it.

The webpack config was externalizing @wordpress/views to the wp-views script handle, but WordPress core does not register that handle. The default DependencyExtractionWebpackPlugin already lists @wordpress/views in its BUNDLED_PACKAGES, so removing the custom override lets it be bundled correctly.

Other information:

  • Have you written new tests for your changes, if applicable?

Not applicable — this is a build configuration fix.

Testing instructions:

  • Start wp-env with npm run env-start
  • Navigate to the ActivityPub admin app page
  • Verify no PHP notice about wp-views in the debug log
  • Verify the admin app loads and functions correctly

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Fixed - for any bug fixes

Message

Fix a missing script dependency notice on the admin page in WordPress 6.9.1 and later.

The webpack config was externalizing @wordpress/views to wp-views,
but WordPress core does not register that script handle. This caused
a missing dependency notice in WP 6.9.1+ and a potential runtime
error. The default DependencyExtractionWebpackPlugin already lists
@wordpress/views in BUNDLED_PACKAGES, so removing the custom override
lets it be bundled correctly.
Copilot AI review requested due to automatic review settings March 23, 2026 16:35
@pfefferle pfefferle added the Bug Something isn't working label Mar 23, 2026
@pfefferle pfefferle self-assigned this Mar 23, 2026
@pfefferle pfefferle requested a review from a team March 23, 2026 16:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the build configuration to stop externalizing @wordpress/views as wp-views, avoiding the unregistered dependency notice in WordPress 6.9.1+ by bundling the package instead.

Changes:

  • Removes the custom DependencyExtractionWebpackPlugin override that mapped @wordpress/views to wp-views.
  • Re-adds DependencyExtractionWebpackPlugin with default behavior so @wordpress/views is bundled.
  • Updates built assets and asset manifests to reflect the new dependency graph (notably removing wp-views from index.asset.php).

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.config.js Removes custom dependency extraction override and relies on default bundling for @wordpress/views.
build/app/index.asset.php Drops wp-views from the generated dependency list.
build/app/index.js Regenerated bundle output reflecting updated dependency extraction and chunking.
build/app/vendors.js Regenerated vendor bundle output after dependency extraction change.
build/app/vendors.asset.php Updates vendor asset version hash after rebuild.
build/app/tanstack-router.asset.php Updates asset version hash after rebuild.
build/app/feed-content.701ed0f6.js Removes an outdated chunk file generated prior to the rebuild.
.github/changelog/3084-from-description Adds changelog entry for the fix.
Comments suppressed due to low confidence (1)

build/app/index.js:1

  • The regenerated runtime now points chunk id 579 to app/feed-content.51a9b6b8.js, but this PR shows build/app/feed-content.701ed0f6.js being removed and does not include the newly referenced chunk file. Unless build/app/feed-content.51a9b6b8.js is added elsewhere in the PR, the app will 404 when loading that chunk and break the admin UI. Ensure the new chunk file is committed (or the chunk naming remains consistent) alongside the updated index.js.
(()=>{"use strict";var e,t,i,r,n,a={6007(e,t,i){i.d(t,{A:()=>a,k:()=>n});var r=i(790);const n="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Crect width='200' height='200' fill='%23f0f0f0'/%3E%3Cpath fill='%23c6c6c6' d='M32,201 C22,201 12,201 1,201 C1,134 1,68 1,1 C68,1 134,1 201,1 C201,68 201,134 201,201 C194,201 186,201 178,201 C174,184 165,172 149,166 C145,164 139,163 134,162 C131,161 128,160 126,158 C123,156 122,154 126,151 C147,137 154,112 145,89 C139,70 122,58 104,59 C90,59 79,66 71,77 C54,101 60,135 84,151 C88,154 88,155 84,158 C81,160 78,161 75,162 C53,167 38,179 32,201z'/%3E%3C/svg%3E";function a({item:e}){const t=e.actor_info?.icon||n,i=e.actor_info?.name||e.actor_info?.username||"";return(0,r.jsx)("img",{alt:i,src:t,className:"activitypub-avatar",onError:e=>{e.target.src=n},...!i&&{role:"presentation"}})}},9993(e,t,i){i.d(t,{l:()=>w,M:()=>x});var r=i(3582),n=i(7143),a=i(6427),s=i(7723),o=i(7947),c=i(7028),l=i(3560),d=i(4539),p=i(5506),u=i(2285),m=i(8087),v=i(7884),f=i(618),h=i(3834),b=i(6087),_=i(4242),g=i(9304),y=i(790);const x={Article:{label:(0,s.__)("Articles","activitypub"),icon:o.A},Note:{label:(0,s.__)("Notes & Updates","activitypub"),icon:c.A},Image:{label:(0,s.__)("Photos & Images","activitypub"),icon:l.A},Event:{label:(0,s.__)("Events & Meetups","activitypub"),icon:d.A},Video:{label:(0,s.__)("Videos","activitypub"),icon:p.A},Audio:{label:(0,s.__)("Music & Podcasts","activitypub"),icon:u.A},Document:{label:(0,s.__)("Documents & Files","activitypub"),icon:m.A},Page:{label:(0,s.__)("Pages","activitypub"),icon:v.A},Place:{label:(0,s.__)("Places & Locations","activitypub"),icon:f.A}};function w(){const e=(0,n.useSelect)(e=>e(h.E).getActiveActorId(),[]),t=null!==e,{records:i,isResolving:o}=(0,r.useEntityRecords)("taxonomy","ap_object_type",t?{per_page:-1,user_id:e}:void 0),{selectedObjectTypeId:c,updateObjectTypeFilter:l}=function(){const e=(0,g.Zp)(),{view:t,updateView:i}=(0,_.l)({kind:"postType",name:"ap_post",slug:"feed",defaultView:{type:"list",filters:[]}});return{selectedObjectTypeId:(0,b.useMemo)(()=>{var e;const i=t.filters?.find(e=>"ap_object_type"===e.field);return null!==(e=i?.value)&&void 0!==e?e:null},[t.filters]),updateObjectTypeFilter:(0,b.useCallback)((r,n={})=>{const a=t.filters||[],s=a.findIndex(e=>"ap_object_type"===e.field);let o;o=null===r?a.filter(e=>"ap_object_type"!==e.field):-1!==s?a[s].value===r?a.filter(e=>"ap_object_type"!==e.field):[...a.slice(0,s),{field:"ap_object_type",operator:"is",value:r},...a.slice(s+1)]:[...a,{field:"ap_object_type",operator:"is",value:r}],i({...t,filters:o,page:1}),e({search:e=>{const{postId:t,...i}=e;return i}}),n.onComplete&&n.onComplete()},[t,i,e])}}();if(o||!i||0===i.length)return null;const d=i.filter(e=>!!x[e.name]);if(d.length<=1)return null;const p=Object.keys(x),u=[...d].sort((e,t)=>p.indexOf(e.name)-p.indexOf(t.name));return(0,y.jsx)(a.MenuGroup,{className:"object-types-menu",children:u.map(e=>{const t=x[e.name];return(0,y.jsxs)(a.MenuItem,{onClick:()=>{return t=e.id,l(c===t?null:t);var t},className:"menu-item","aria-pressed":c===e.id,"aria-label":/* translators: %s: object type name */ /* translators: %s: object type name */

…bpackPlugin

Instead of removing and re-adding the plugin, keep the original instance
from @wordpress/scripts. The default plugin already bundles @wordpress/views
(listed in BUNDLED_PACKAGES) since WordPress core does not register a
corresponding wp-views script handle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants