Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(major) - Tracking PR for v11 #4549

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d451054
Remove replaceNode
JoviDeCroock Nov 10, 2024
0c90e4e
Leverage Object.assign
JoviDeCroock Nov 10, 2024
84bee25
Remove IE11 unmount hack
JoviDeCroock Nov 10, 2024
f181fca
Remove select IE11 fix
JoviDeCroock Nov 10, 2024
6768d16
Switch to queueMicrotask
JoviDeCroock Nov 10, 2024
6253d00
Expand todo
JoviDeCroock Nov 10, 2024
d618181
Remove SuspenseList
JoviDeCroock Nov 10, 2024
8f5571f
Remove component.base
JoviDeCroock Nov 10, 2024
0895cde
Remove more compat IE11 stuff
JoviDeCroock Nov 10, 2024
b0a2b8e
test: Drop unused/broken test (#4653)
rschristian Feb 11, 2025
66e5e3e
Review feedback v11 (#4655)
JoviDeCroock Feb 12, 2025
75762d0
Forward ref by default (#4658)
JoviDeCroock Feb 12, 2025
78354fc
Use Object.is instead of the adhoc func
JoviDeCroock Feb 12, 2025
f410bc1
Move `defaultProps` into `preact/compat` (#4657)
JoviDeCroock Feb 13, 2025
64ddbab
Look at impact of removing deprecated lifecycles (#4656)
JoviDeCroock Feb 13, 2025
23f153a
Remove unused imports
JoviDeCroock Feb 13, 2025
12cbea5
fix: Mangle `_listeners` as `__l` instead of `l` (#4463)
rschristian Feb 13, 2025
27caad2
Comment denoted hydration (#4636)
JoviDeCroock Feb 13, 2025
e78c9b0
Move back to function
JoviDeCroock Feb 13, 2025
58ad122
Save bytes
JoviDeCroock Feb 13, 2025
752c178
refactor: Switch to Object.is for hook args (#4663)
rschristian Feb 14, 2025
eebf192
Golf hydration 2.0
JoviDeCroock Feb 14, 2025
815efbf
Remove constant
JoviDeCroock Feb 14, 2025
db07f21
Revert "Remove constant"
JoviDeCroock Feb 14, 2025
4196ef3
refactor: Breaking changes to outputs & pkg.json (#4652)
rschristian Feb 14, 2025
d7386d0
Remove automatic px suffix (#4665)
JoviDeCroock Feb 14, 2025
42aada3
Remove contains with a simple parentNode check (#4666)
JoviDeCroock Feb 14, 2025
80111ac
Prune portals (#4667)
JoviDeCroock Feb 14, 2025
b0bbfd9
Remove SuspenseList mechanism (#4668)
JoviDeCroock Feb 14, 2025
8bc5e86
Remove static dom bail (#4670)
JoviDeCroock Feb 14, 2025
54d35bf
Add mangle entry for _excess
JoviDeCroock Feb 14, 2025
a3bf23b
Prove bailout still happens
JoviDeCroock Feb 16, 2025
393d05d
types: Require initial value in `useRef` (#4683)
rschristian Feb 18, 2025
85b6bee
Cleanup IE11 mentions
JoviDeCroock Feb 26, 2025
f96274f
Change kb mentions
JoviDeCroock Mar 1, 2025
620e0f3
Remove unused constat
JoviDeCroock Mar 1, 2025
6e5de3f
refactor: Skip dom check for inferring lower-cased event names (#4720)
rschristian Mar 9, 2025
65e5f4b
refactor: Restrict aria roles by element type (#4607)
rschristian Mar 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

</a>
</p>
<p align="center">Fast <b>3kB</b> alternative to React with the same modern API.</p>
<p align="center">Fast <b>4kB</b> alternative to React with the same modern API.</p>

**All the power of Virtual DOM components, without the overhead:**

- Familiar React API & patterns: ES6 Class, hooks, and Functional Components
- Extensive React compatibility via a simple [preact/compat] alias
- Everything you need: JSX, <abbr title="Virtual DOM">VDOM</abbr>, [DevTools], <abbr title="Hot Module Replacement">HMR</abbr>, <abbr title="Server-Side Rendering">SSR</abbr>.
- Highly optimized diff algorithm and seamless hydration from Server Side Rendering
- Supports all modern browsers and IE11
- Supports all modern browsers
- Transparent asynchronous rendering with a pluggable scheduler

### 💁 More information at the [Preact Website ➞](https://preactjs.com)
Expand Down
4 changes: 2 additions & 2 deletions compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"description": "A React compatibility layer for Preact",
"main": "dist/compat.js",
"module": "dist/compat.module.js",
"module": "dist/compat.mjs",
"umd:main": "dist/compat.umd.js",
"source": "src/index.js",
"types": "src/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"exports": {
".": {
"types": "./src/index.d.ts",
"browser": "./dist/compat.module.js",
"module": "./dist/compat.mjs",
"umd": "./dist/compat.umd.js",
"import": "./dist/compat.mjs",
"require": "./dist/compat.js"
Expand Down
18 changes: 2 additions & 16 deletions compat/src/forwardRef.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import { options } from 'preact';
import { assign } from './util';

let oldDiffHook = options._diff;
options._diff = vnode => {
if (vnode.type && vnode.type._forwarded && vnode.ref) {
vnode.props.ref = vnode.ref;
vnode.ref = null;
}
if (oldDiffHook) oldDiffHook(vnode);
};

export const REACT_FORWARD_SYMBOL =
(typeof Symbol != 'undefined' &&
Symbol.for &&
Symbol.for('react.forward_ref')) ||
0xf47;
export const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref');

/**
* Pass ref down to a child. This is mainly used in libraries with HOCs that
Expand All @@ -38,7 +24,7 @@ export function forwardRef(fn) {
// mobx-react throws.
Forwarded.render = Forwarded;

Forwarded.prototype.isReactComponent = Forwarded._forwarded = true;
Forwarded.prototype.isReactComponent = true;
Forwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';
return Forwarded;
}
3 changes: 1 addition & 2 deletions compat/src/hooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState, useLayoutEffect, useEffect } from 'preact/hooks';
import { is } from './util';

/**
* This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84
Expand Down Expand Up @@ -47,7 +46,7 @@ function didSnapshotChange(inst) {
const prevValue = inst._value;
try {
const nextValue = latestGetSnapshot();
return !is(prevValue, nextValue);
return !Object.is(prevValue, nextValue);
} catch (error) {
return true;
}
Expand Down
Loading
Loading