Skip to content

Remove AllowedPHPVersion type - #2720

Merged
fredrikekelund merged 5 commits into
f26d/fix-some-unsafe-type-assertionsfrom
f26d/remove-allowed-php-version-type
Mar 11, 2026
Merged

Remove AllowedPHPVersion type#2720
fredrikekelund merged 5 commits into
f26d/fix-some-unsafe-type-assertionsfrom
f26d/remove-allowed-php-version-type

Conversation

@fredrikekelund

@fredrikekelund fredrikekelund commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Related issues

N/A

How AI was used in this PR

Barely at all. I identified the underlying problem and fixed it by hand.

Proposed Changes

Note

This PR builds upon the changes in #2719.

The AllowedPHPVersion type is misleading. It's just a string type, but SupportedPHPVersion is really our canonical definition of which PHP versions we support. This PR removes AllowedPHPVersion and replaces it with SupportedPHPVersion.

I also took the opportunity to remove apps/studio/src/lib/wordpress-server-types.ts in its entirety, since the only other definition there was the WordPressServerProcess interface. We only have a single implementation of that interface now, so I think it makes more sense to remove it.

Tagging @bcotrim for review, since wordpress-server-types.ts was originally implemented in #2281.

Testing Instructions

Code review should suffice

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@fredrikekelund
fredrikekelund requested review from a team and bcotrim March 6, 2026 10:45
@fredrikekelund fredrikekelund self-assigned this Mar 6, 2026

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good cleanup 👍
We could probably remove the provider constants slice now, but I would consider a good follow-up PR. Let me know if you want me to take care of that.
I did not notice any regressions when testing the app, PHP versions behave as expected when creating/editing sites.

@fredrikekelund

Copy link
Copy Markdown
Contributor Author

We could probably remove the provider constants slice now, but I would consider a good follow-up PR. Let me know if you want me to take care of that.

Thanks for confirming that 👍 I was under the same impression. I created STU-1378 to track this, and assigned the issue to you, @bcotrim

@fredrikekelund
fredrikekelund merged commit 7f91189 into f26d/fix-some-unsafe-type-assertions Mar 11, 2026
3 of 5 checks passed
@fredrikekelund
fredrikekelund deleted the f26d/remove-allowed-php-version-type branch March 11, 2026 11:30
fredrikekelund added a commit that referenced this pull request Mar 11, 2026
* Fix some unsafe type assertions

* More fixes

* Cleanup

* Typo

* Narrow type

* Fix tests

* Fix more types

* Change import

* Inline `isStepDefinition` function

* Fix type errors

* Address review feedback

* Remove `AllowedPHPVersion` type (#2720)

* Remove `AllowedPHPVersion` type

* Remove unused `setProviderConstants` action

* Fix type error

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants