Skip to content

Commit

Permalink
Remove more compat IE11 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 10, 2024
1 parent 641eedd commit af99557
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 62 deletions.
3 changes: 1 addition & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
- https://github.com/preactjs/preact/pull/4362
- https://github.com/preactjs/preact/pull/4358
- https://github.com/preactjs/preact/pull/4361
- https://github.com/preactjs/preact/pull/4460
- https://github.com/preactjs/preact/pull/4453
- Backing VNodes
- Enable removing classes from the bundle
- Remove deprecated lifecycle methods
- Try to get rid of DOM pointers
- Separate mount/update paths
Expand Down
5 changes: 0 additions & 5 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,6 @@ declare namespace React {
export function flushSync<R>(fn: () => R): R;
export function flushSync<A, R>(fn: (a: A) => R, a: A): R;

export function unstable_batchedUpdates(
callback: (arg?: any) => void,
arg?: any
): void;

export type PropsWithChildren<P = unknown> = P & {
children?: preact.ComponentChildren | undefined;
};
Expand Down
13 changes: 0 additions & 13 deletions compat/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ function findDOMNode(component) {
);
}

/**
* Deprecated way to control batched rendering inside the reconciler, but we
* already schedule in batches inside our rendering code
* @template Arg
* @param {(arg: Arg) => void} callback function that triggers the updated
* @param {Arg} [arg] Optional argument that can be passed to the callback
*/
// eslint-disable-next-line camelcase
const unstable_batchedUpdates = (callback, arg) => callback(arg);

/**
* In React, `flushSync` flushes the entire tree and forces a rerender. It's
* implmented here as a no-op.
Expand Down Expand Up @@ -237,8 +227,6 @@ export {
memo,
forwardRef,
flushSync,
// eslint-disable-next-line camelcase
unstable_batchedUpdates,
StrictMode,
Suspense,
lazy,
Expand Down Expand Up @@ -285,7 +273,6 @@ export default {
memo,
forwardRef,
flushSync,
unstable_batchedUpdates,
StrictMode,
Suspense,
lazy,
Expand Down
8 changes: 1 addition & 7 deletions compat/src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ const CAMEL_REPLACE = /[A-Z0-9]/g;
const IS_DOM = typeof document !== 'undefined';

// Input types for which onchange should not be converted to oninput.
// type="file|checkbox|radio", plus "range" in IE11.
// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range")
const onChangeInputType = type =>
(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'
? /fil|che|rad/
: /fil|che|ra/
).test(type);
const onChangeInputType = type => /fil|che|rad/.test(type);

// Some libraries like `react-virtualized` explicitly check for this.
Component.prototype.isReactComponent = {};
Expand Down
2 changes: 0 additions & 2 deletions compat/test/browser/exports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('compat exports', () => {
expect(Compat.Children.toArray).to.exist.and.be.a('function');
expect(Compat.Children.only).to.exist.and.be.a('function');
expect(Compat.unmountComponentAtNode).to.exist.and.be.a('function');
expect(Compat.unstable_batchedUpdates).to.exist.and.be.a('function');
expect(Compat.version).to.exist.and.be.a('string');
expect(Compat.startTransition).to.be.a('function');
});
Expand Down Expand Up @@ -99,7 +98,6 @@ describe('compat exports', () => {
expect(Named.Children.toArray).to.exist.and.be.a('function');
expect(Named.Children.only).to.exist.and.be.a('function');
expect(Named.unmountComponentAtNode).to.exist.and.be.a('function');
expect(Named.unstable_batchedUpdates).to.exist.and.be.a('function');
expect(Named.version).to.exist.and.be.a('string');
});
});
33 changes: 0 additions & 33 deletions compat/test/browser/unstable_batchedUpdates.test.js

This file was deleted.

0 comments on commit af99557

Please sign in to comment.