Skip to content

Commit

Permalink
Remove SuspenseList
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 10, 2024
1 parent f5cdbd7 commit abf813b
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 751 deletions.
4 changes: 1 addition & 3 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as _hooks from '../../hooks';
import * as preact from '../../src';
import { JSXInternal } from '../../src/jsx';
import * as _Suspense from './suspense';
import * as _SuspenseList from './suspense-list';

interface SignalLike<T> {
value: T;
Expand Down Expand Up @@ -67,11 +66,10 @@ declare namespace React {
export import ReactElement = preact.VNode;
export import Consumer = preact.Consumer;
export import ErrorInfo = preact.ErrorInfo;

// Suspense
export import Suspense = _Suspense.Suspense;
export import lazy = _Suspense.lazy;
export import SuspenseList = _SuspenseList.SuspenseList;

// Compat
export import StrictMode = preact.Fragment;
Expand Down
3 changes: 0 additions & 3 deletions compat/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { memo } from './memo';
import { forwardRef } from './forwardRef';
import { Children } from './Children';
import { Suspense, lazy } from './suspense';
import { SuspenseList } from './suspense-list';
import { createPortal } from './portals';
import { is } from './util';
import {
Expand Down Expand Up @@ -241,7 +240,6 @@ export {
unstable_batchedUpdates,
StrictMode,
Suspense,
SuspenseList,
lazy,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
};
Expand Down Expand Up @@ -289,7 +287,6 @@ export default {
unstable_batchedUpdates,
StrictMode,
Suspense,
SuspenseList,
lazy,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
};
14 changes: 0 additions & 14 deletions compat/src/suspense-list.d.ts

This file was deleted.

127 changes: 0 additions & 127 deletions compat/src/suspense-list.js

This file was deleted.

4 changes: 2 additions & 2 deletions compat/src/suspense.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Suspense.prototype.render = function (props, state) {

/**
* Checks and calls the parent component's _suspended method, passing in the
* suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified
* suspended vnode. This is a way for a parent to get notified
* that one of its children/descendants suspended.
*
* The parent MAY return a callback. The callback will get called when the
Expand All @@ -232,7 +232,7 @@ Suspense.prototype.render = function (props, state) {
* @param {import('./internal').VNode} vnode
* @returns {((unsuspend: () => void) => void)?}
*/
export function suspended(vnode) {
function suspended(vnode) {
/** @type {import('./internal').Component} */
let component = vnode._parent._component;
return component && component._suspended && component._suspended(vnode);
Expand Down
Loading

0 comments on commit abf813b

Please sign in to comment.