Components: Rename PolymorphicComponent* types to WordPressComponent*#34330
Components: Rename PolymorphicComponent* types to WordPressComponent*#34330
PolymorphicComponent* types to WordPressComponent*#34330Conversation
|
Size Change: 0 B Total Size: 1.04 MB ℹ️ View Unchanged
|
From what I can gather, until recently our preferred option in TypeScript files was to keep the type imports separate from importing runtime code. I believe this technique was used in an attempt to keep the bundle size as small as possible, e.g. import { myFunction } from './file';
import type { MyType } from './file';Recently, though, it was discussed and agreed that optimisation isn't really necessary, and so we started switching to merging those import statements into one, e.g. import { myFunction, MyType } from './file';Still, it is possible to still encounter an import type { MyType, MyOtherType } from './file';Following the rationale that I just explained, I had a look at the code in this PR and merged import declarations where possible in |
6508cd9 to
faa2953
Compare
|
All CI tasks seemed to be failing after the last commit — I've tried to rebase on top of Update: the issues seem to persist Update: all good after last rebase! Going to merge |
faa2953 to
c53dec6
Compare
c53dec6 to
9747a6a
Compare
Description
Renames the following types:
PolymorphicComponentWordPressComponentPolymorphicComponentPropsWordPressComponentPropsPolymorphicComponentFromPropsWordPressComponentFromPropsThis PR also renames the file containing the type definitions from
polymoprhic-component.tstowordpress-component.ts, and adds a CHANGELOG entry.How has this been tested?
The project builds correctly, tests pass, smoke tested in Storybook.
Screenshots
N/A
Types of changes
Refactor (type renaming)
Checklist:
*.native.jsfiles for terms that need renaming or removal).Closes #34291