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

refactor: Restrict aria roles by element type #4607

Open
wants to merge 46 commits into
base: v11-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
050e48d
test: Add simple test for button roles
rschristian Dec 13, 2024
ef98c0b
refactor: Make roles signalish
rschristian Dec 13, 2024
6c8ef5a
test: Add tests for `never` roles
rschristian Dec 15, 2024
ea500fe
refactor: Remove half-implemented select roles
rschristian Dec 16, 2024
14c2a7d
fix: Ensure attributes w/ `never` roles can be constructed
rschristian Dec 16, 2024
06f0025
refactor: Restrict more complex aria roles
rschristian Dec 17, 2024
b99c942
refactor: Remove unused input type interface, fix select multiple type
rschristian Dec 17, 2024
c64d69a
fix: Ensure partials extend EventTarget
rschristian Dec 17, 2024
6b6431e
revert: Bring back input type attribute
rschristian Dec 17, 2024
8ac8cab
test: Fix test typo
rschristian Dec 17, 2024
9013f3b
refactor: Remove 'generic' aria role from allowed values
rschristian Feb 14, 2025
64030ca
Remove replaceNode
JoviDeCroock Nov 10, 2024
04b34c1
Leverage Object.assign
JoviDeCroock Nov 10, 2024
45776c3
Remove IE11 unmount hack
JoviDeCroock Nov 10, 2024
3ec09e2
Remove select IE11 fix
JoviDeCroock Nov 10, 2024
459613a
Switch to queueMicrotask
JoviDeCroock Nov 10, 2024
b33247d
Expand todo
JoviDeCroock Nov 10, 2024
02ce2cf
Remove SuspenseList
JoviDeCroock Nov 10, 2024
b8c2dde
Remove component.base
JoviDeCroock Nov 10, 2024
33e686d
Remove more compat IE11 stuff
JoviDeCroock Nov 10, 2024
17648d8
test: Drop unused/broken test (#4653)
rschristian Feb 11, 2025
38c1a72
Review feedback v11 (#4655)
JoviDeCroock Feb 12, 2025
6f36d1b
Forward ref by default (#4658)
JoviDeCroock Feb 12, 2025
63e9645
Use Object.is instead of the adhoc func
JoviDeCroock Feb 12, 2025
d011d93
Move `defaultProps` into `preact/compat` (#4657)
JoviDeCroock Feb 13, 2025
b0cbba9
Look at impact of removing deprecated lifecycles (#4656)
JoviDeCroock Feb 13, 2025
52b8172
Remove unused imports
JoviDeCroock Feb 13, 2025
fcfd6e4
fix: Mangle `_listeners` as `__l` instead of `l` (#4463)
rschristian Feb 13, 2025
0390525
Comment denoted hydration (#4636)
JoviDeCroock Feb 13, 2025
145d986
Move back to function
JoviDeCroock Feb 13, 2025
893eba7
Save bytes
JoviDeCroock Feb 13, 2025
9db6bd5
refactor: Switch to Object.is for hook args (#4663)
rschristian Feb 14, 2025
263fd47
Golf hydration 2.0
JoviDeCroock Feb 14, 2025
a557edf
Remove constant
JoviDeCroock Feb 14, 2025
3fe986c
Revert "Remove constant"
JoviDeCroock Feb 14, 2025
0559697
refactor: Breaking changes to outputs & pkg.json (#4652)
rschristian Feb 14, 2025
cbde0d7
Remove automatic px suffix (#4665)
JoviDeCroock Feb 14, 2025
206b990
Remove contains with a simple parentNode check (#4666)
JoviDeCroock Feb 14, 2025
2688b10
Prune portals (#4667)
JoviDeCroock Feb 14, 2025
7f55f1a
Remove SuspenseList mechanism (#4668)
JoviDeCroock Feb 14, 2025
972b601
Remove static dom bail (#4670)
JoviDeCroock Feb 14, 2025
2661f05
Add mangle entry for _excess
JoviDeCroock Feb 14, 2025
1ef1703
Prove bailout still happens
JoviDeCroock Feb 16, 2025
cd834ba
types: Require initial value in `useRef` (#4683)
rschristian Feb 18, 2025
3330ed2
Cleanup IE11 mentions
JoviDeCroock Feb 26, 2025
ec1fefd
refactor: Restrict aria roles by element type
rschristian Dec 13, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- 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