Skip to content

fix(pfe-tools): use WDS plugin for TS redirect instead of koa middleware#3144

Open
bennypowers wants to merge 1 commit into
staging/pfv6from
fix/pfe-tools-ts-redirect
Open

fix(pfe-tools): use WDS plugin for TS redirect instead of koa middleware#3144
bennypowers wants to merge 1 commit into
staging/pfv6from
fix/pfe-tools-ts-redirect

Conversation

@bennypowers
Copy link
Copy Markdown
Member

Summary

  • Convert liveReloadTsChangesMiddleware from koa middleware to a WDS serve hook plugin
  • The middleware ran AFTER koa-send (static file serving), so when a .js file didn't exist on disk, koa-send returned 404 before the middleware could rewrite the path to .ts
  • As a WDS plugin with serve hook, the path rewrite runs BEFORE static file resolution
  • Fixes 404 errors for elements with only .ts source files (no pre-compiled .js), such as pf-v6-tooltip

Test plan

  • npx wtr elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.spec.ts passes with no compiled .js in elements/
  • Full test suite: 820 passed, 1 failed (pre-existing select test), 31 skipped
  • No import errors for pf-v6-tooltip or other elements

The liveReloadTsChangesMiddleware ran as koa middleware, which executes
AFTER WDS static file serving (koa-send). When a .js file didn't exist
on disk, koa-send returned 404 before the middleware could redirect to
the .ts source.

Convert to a WDS plugin with a serve hook, which runs BEFORE static
file resolution. This fixes 404 errors for elements that only have .ts
source files (no pre-compiled .js).

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

⚠️ No Changeset found

Latest commit: 4b95cc3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "fix(pfe-tools): use WDS plugin for TS redirect instead of koa middleware"
}

@github-actions
Copy link
Copy Markdown
Contributor

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 7d94b15
😎 Deploy Preview https://deploy-preview-3144--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions Bot added the AT passed Automated testing has passed label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 7d94b15: Report

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

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant