Skip to content

refactor (v10): Mirror non-JSX types to the 'preact' namespace#4904

Merged
rschristian merged 3 commits intov10.xfrom
refactor/backport-jsx-namespace-change
Aug 28, 2025
Merged

refactor (v10): Mirror non-JSX types to the 'preact' namespace#4904
rschristian merged 3 commits intov10.xfrom
refactor/backport-jsx-namespace-change

Conversation

@rschristian
Copy link
Member

@rschristian rschristian commented Aug 27, 2025

Closes #4903
Non-breaking form of #4878

Duplicates our DOM types into a new dom.d.ts file (matching v11), exporting them under the Preact namespace (so you can do import type { HTMLAttributes } from 'preact';), but maintains back-compat . This will allow library authors to switch to the Preact namespace and keep compatibility with v10 & v11 going forward.

There's obviously some duplication here but unfortunately it's necessary -- turns out you can't label namespace aliases (i.e., export import ...) as deprecated. We need to keep the current types where they are so that users are warned they're using deprecated APIs.

@github-actions
Copy link

github-actions bot commented Aug 27, 2025

📊 Tachometer Benchmark Results

Summary

A summary of the benchmark results will show here once they finish.

Results

The full results of your benchmarks will show here once they finish.

tachometer-reporter-action v2 for CI

@rschristian rschristian marked this pull request as draft August 27, 2025 04:40
@rschristian rschristian changed the title refactor: Move non-JSX types out of JSX namespace but re-export them refactor (v10): Mirror non-JSX types to the 'preact' namespace Aug 27, 2025
@rschristian rschristian marked this pull request as ready for review August 27, 2025 18:03
@rschristian rschristian merged commit 0be5d20 into v10.x Aug 28, 2025
4 checks passed
@rschristian rschristian deleted the refactor/backport-jsx-namespace-change branch August 28, 2025 14:17
@maxpatiiuk
Copy link

Hi
Do you know when this change will be available on npm for preact@10?

@rschristian
Copy link
Member Author

rschristian commented Sep 9, 2025

Next time we cut a release, but when that happens is TBD. We don't schedule things.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments