chore: Convert js files into typescript#115
Open
sabbir1991 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the Phase 2 migration of remaining assets/src JavaScript media support scripts to TypeScript and updates webpack entry points accordingly.
Changes:
- Replaced
media-frame.jsandmedia-sync-filter.jswith TypeScript equivalents. - Added local TypeScript interfaces/types for WordPress media frame interactions.
- Updated webpack entries to point to the new
.tssources.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
webpack.config.js |
Points media bundle entries to the new TypeScript files. |
assets/src/js/media-sync-filter.ts |
TypeScript migration of the media sync filter script. |
assets/src/js/media-sync-filter.js |
Removed after migration. |
assets/src/js/media-frame.ts |
TypeScript migration of media frame customization and snackbar handling. |
assets/src/js/media-frame.js |
Removed after migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+282
to
+283
| const detail = ( event as CustomEvent< SnackbarNoticeDetail > ) | ||
| .detail?.detail; |
Collaborator
|
(PS: we use conventiontional commits and WPCS. Part of that is using imperative tense. I.e. [it should] "Convert JS files to Typescript" . I updated here, and the last one before merge. Just letting you know why) |
justlevine
reviewed
May 15, 2026
| } | ||
| }; | ||
|
|
||
| const isAttachmentModel = ( |
Collaborator
There was a problem hiding this comment.
Please restore/add docblocks and comments to all of these functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrate the remaining Phase 2 JS source files to TypeScript and finish the source-side JS to TS conversion for OneMedia.
Why
Phase 1 covered the higher-impact media sharing UI files. Phase 2 finishes the lower-risk support scripts that were still in JS, so the
assets/srcsource tree is now fully migrated to TypeScript.Related Issue(s):
How
assets/src/js/media-frame.jstoassets/src/js/media-frame.tsassets/src/js/media-sync-filter.jstoassets/src/js/media-sync-filter.ts.tsfiles.jsor.jsxsource files underassets/srcTesting Instructions
npm run lint:js:typesnpm run lint:js -- assets/src/js/media-frame.ts assets/src/js/media-sync-filter.ts webpack.config.jsmedia-frame.tsandmedia-sync-filter.ts.jssource files underassets/srcScreenshots
N/A
Additional Info
assets/src.jsfiles in the plugin are config files, generated build output, or vendor/test artifactsChecklist
npm run changeset.