Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 20 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,22 @@
"@faker-js/faker": "^8.4.1",
"@jdb8/eslint-plugin-monorepo": "^1.0.1",
"@octokit/rest": "*",
"@parcel/bundler-library": "^2.15.4",
"@parcel/config-default": "^2.15.4",
"@parcel/bundler-library": "^2.16.0",
"@parcel/config-default": "^2.16.0",
"@parcel/config-storybook": ">=0.0.2",
"@parcel/core": "^2.15.4",
"@parcel/optimizer-data-url": "^2.15.4",
"@parcel/optimizer-terser": "^2.15.4",
"@parcel/packager-react-static": "^2.15.4",
"@parcel/packager-ts": "^2.15.4",
"@parcel/reporter-cli": "^2.15.4",
"@parcel/resolver-glob": "^2.15.4",
"@parcel/transformer-inline": "^2.15.4",
"@parcel/transformer-inline-string": "^2.15.4",
"@parcel/transformer-react-static": "^2.15.4",
"@parcel/transformer-svg-react": "^2.15.4",
"@parcel/transformer-typescript-types": "^2.15.4",
"@parcel/core": "^2.16.0",
"@parcel/optimizer-data-url": "^2.16.0",
"@parcel/optimizer-terser": "^2.16.0",
"@parcel/packager-react-static": "^2.16.0",
"@parcel/packager-ts": "^2.16.0",
"@parcel/reporter-bundle-analyzer": "^2.16.0",
"@parcel/reporter-cli": "^2.16.0",
"@parcel/resolver-glob": "^2.16.0",
"@parcel/transformer-inline": "^2.16.0",
"@parcel/transformer-inline-string": "^2.16.0",
"@parcel/transformer-react-static": "^2.16.0",
"@parcel/transformer-svg-react": "^2.16.0",
"@parcel/transformer-typescript-types": "^2.16.0",
"@react-spectrum/parcel-namer-s2": "^0.3.0",
"@react-spectrum/s2-icon-builder": "^0.3.0",
"@spectrum-css/component-builder": "workspace:^",
Expand Down Expand Up @@ -183,7 +184,7 @@
"npm-cli-login": "^1.0.0",
"nyc": "^10.2.0",
"p-queue": "^6.2.1",
"parcel": "^2.15.4",
"parcel": "^2.16.0",
"parcel-optimizer-strict-mode": "workspace:^",
"patch-package": "^6.2.0",
"playwright": "^1.45.3",
Expand Down Expand Up @@ -293,5 +294,8 @@
]
}
]
}
},
"locales": [
"en-US"
]
}
9 changes: 0 additions & 9 deletions packages/@react-aria/collections/src/CollectionBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {forwardRefType, Key, Node} from '@react-types/shared';
import {Hidden} from './Hidden';
import React, {createContext, ForwardedRef, forwardRef, JSX, ReactElement, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';
import {useIsSSR} from '@react-aria/ssr';
import {useLayoutEffect} from '@react-aria/utils';
import {useSyncExternalStore as useSyncExternalStoreShim} from 'use-sync-external-store/shim/index.js';

const ShallowRenderContext = createContext(false);
Expand Down Expand Up @@ -114,14 +113,6 @@ function useCollectionDocument<T extends object, C extends BaseCollection<T>>(cr
return document.getCollection();
}, [document]);
let collection = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
useLayoutEffect(() => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug found on the illustrations page when wrapping a collection in Suspense: when switching illustration types, the content would not update in the collection. This was because during Suspense React "unmounts" effects by calling their cleanup functions, but doesn't actually remove the component from the DOM. Before it re-mounts the effect, it removes the old content from the collection. We had this optimization where we ignored removals when unmounted, so these would never be processed. I tested in Storybook with our large collection stories and didn't notice a performance issue without this, so perhaps we fixed the original issue somewhere else in the meantime.

document.isMounted = true;
return () => {
// Mark unmounted so we can skip all of the collection updates caused by
// React calling removeChild on every item in the collection.
document.isMounted = false;
};
}, [document]);
return {collection, document};
}

Expand Down
5 changes: 2 additions & 3 deletions packages/@react-aria/collections/src/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class BaseNode<T> {
}

removeChild(child: ElementNode<T>): void {
if (child.parentNode !== this || !this.ownerDocument.isMounted) {
if (child.parentNode !== this) {
return;
}

Expand Down Expand Up @@ -411,7 +411,6 @@ export class Document<T, C extends BaseCollection<T> = BaseCollection<T>> extend
isSSR = false;
nodeId = 0;
nodesByProps: WeakMap<object, ElementNode<T>> = new WeakMap<object, ElementNode<T>>();
isMounted = true;
private collection: C;
private nextCollection: C | null = null;
private subscriptions: Set<() => void> = new Set();
Expand All @@ -426,7 +425,7 @@ export class Document<T, C extends BaseCollection<T> = BaseCollection<T>> extend
}

get isConnected(): boolean {
return this.isMounted;
return true;
}

createElement(type: string): ElementNode<T> {
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-spectrum/s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
},
"devDependencies": {
"@adobe/spectrum-tokens": "^13.10.0",
"@parcel/macros": "^2.15.4",
"@parcel/macros": "^2.16.0",
"@react-aria/test-utils": "^1.0.0-alpha.8",
"@storybook/jest": "^0.2.3",
"@testing-library/dom": "^10.1.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/dev/parcel-config-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"access": "public"
},
"dependencies": {
"@parcel/config-default": "^2.13.1",
"@parcel/core": "^2.13.1",
"@parcel/config-default": "^2.16.0",
"@parcel/core": "^2.16.0",
"@parcel/resolver-storybook": ">=0.0.0",
"@parcel/transformer-js": "^2.13.1",
"@parcel/transformer-react-refresh-wrap": "^2.13.1",
"@parcel/transformer-js": "^2.16.0",
"@parcel/transformer-react-refresh-wrap": "^2.16.0",
"@parcel/transformer-storybook": ">=0.0.2"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-namer-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
2 changes: 1 addition & 1 deletion packages/dev/parcel-namer-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
2 changes: 1 addition & 1 deletion packages/dev/parcel-namer-s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
},
"rsp": {
"type": "cli"
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-optimizer-strict-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
2 changes: 1 addition & 1 deletion packages/dev/parcel-packager-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
69 changes: 68 additions & 1 deletion packages/dev/parcel-packager-ssg/SSGPackager.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,28 @@ module.exports = new Packager({
if (resolved.type !== 'js') {
deps.set(getSpecifier(dep), {skipped: true});
} else {
deps.set(getSpecifier(dep), {id: resolved.id});
let resolution = {id: resolved.id};

// Dependencies may be re-targeted to follow re-exports.
for (let [name, sym] of dep.symbols) {
let rewritten = sym.meta?.rewritten;
/* eslint-disable max-depth */
if (typeof rewritten === 'string') {
if (Array.isArray(resolution)) {
resolution.push([rewritten, resolved.id, name]);
} else {
resolution = [[rewritten, resolved.id, name]];
}
}
}

let specifier = getSpecifier(dep);
let cur = deps.get(specifier);
if (Array.isArray(cur) && Array.isArray(resolution)) {
cur.push(...resolution);
} else {
deps.set(specifier, resolution);
}
}
} else {
deps.set(getSpecifier(dep), {specifier: dep.specifier});
Expand All @@ -97,6 +118,52 @@ module.exports = new Packager({
return {};
}

// Synthesize a module to follow re-exports.
if (Array.isArray(resolution)) {
var m = {__esModule: true};
resolution.forEach(function (v) {
var key = v[0];
var id = v[1];
var exp = v[2];
var x = load(id);
if (key === '*') {
Object.keys(x).forEach(function (key) {
if (
key === 'default' ||
key === '__esModule' ||
// $FlowFixMe
Object.prototype.hasOwnProperty.call(m, key)
) {
return;
}

Object.defineProperty(m, key, {
enumerable: true,
get: function () {
return x[key];
}
});
});
} else if (exp === '*') {
Object.defineProperty(m, key, {
enumerable: true,
value: x
});
} else {
Object.defineProperty(m, key, {
enumerable: true,
get: function () {
if (exp === 'default') {
return x.__esModule ? x.default : x;
}
return x[exp];
}
});
}
});
return m;
}

if (resolution?.id) {
return load(resolution.id);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/parcel-packager-ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4",
"@parcel/utils": "^2.15.4"
"@parcel/plugin": "^2.16.0",
"@parcel/utils": "^2.16.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/dev/parcel-resolver-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/core": "^2.15.4",
"@parcel/node-resolver-core": "^3.6.4",
"@parcel/plugin": "^2.15.4"
"@parcel/core": "^2.16.0",
"@parcel/node-resolver-core": "^3.7.0",
"@parcel/plugin": "^2.16.0"
}
}
6 changes: 3 additions & 3 deletions packages/dev/parcel-resolver-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/core": "^2.15.4",
"@parcel/node-resolver-core": "^3.6.4",
"@parcel/plugin": "^2.15.4"
"@parcel/core": "^2.16.0",
"@parcel/node-resolver-core": "^3.7.0",
"@parcel/plugin": "^2.16.0"
}
}
8 changes: 4 additions & 4 deletions packages/dev/parcel-resolver-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"parcel": "^2.8.0"
},
"dependencies": {
"@parcel/core": "^2.13.1",
"@parcel/node-resolver-core": "^3.1.2",
"@parcel/plugin": "^2.13.1",
"@parcel/utils": "^2.13.1"
"@parcel/core": "^2.16.0",
"@parcel/node-resolver-core": "^3.7.0",
"@parcel/plugin": "^2.16.0",
"@parcel/utils": "^2.16.0"
},
"scripts": {
"build": "rm -rf dist && swc . -d dist --config-file ../../.swcrc",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-css-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.0.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
6 changes: 3 additions & 3 deletions packages/dev/parcel-transformer-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"@babel/parser": "^7.24.0",
"@babel/traverse": "^7.24.0",
"@babel/types": "^7.24.0",
"@parcel/plugin": "^2.15.4",
"@parcel/plugin": "^2.16.0",
"doctrine": "^3.0.0"
},
"devDependencies": {
"@parcel/core": "^2.15.4",
"@parcel/fs": "^2.15.4"
"@parcel/core": "^2.16.0",
"@parcel/fs": "^2.16.0"
}
}
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
},
"dependencies": {
"@internationalized/string-compiler": "^3.0.0",
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-transformer-mdx-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"dependencies": {
"@mdx-js/mdx": "next",
"@mdx-js/react": "next",
"@parcel/core": "^2.15.4",
"@parcel/plugin": "^2.15.4",
"@parcel/core": "^2.16.0",
"@parcel/plugin": "^2.16.0",
"dprint-node": "^1.0.7",
"js-yaml": "^3.13.1",
"mdast-util-toc": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-mdx-extract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"parcel": "^2.12.0"
},
"dependencies": {
"@parcel/plugin": "^2.15.4",
"@parcel/plugin": "^2.16.0",
"remark-mdx": "^2.0.0-rc.2",
"remark-parse": "^10.0.1",
"unified": "^10.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-mdx-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@mdx-js/mdx": "next",
"@mdx-js/react": "next",
"@parcel/plugin": "^2.15.4"
"@parcel/plugin": "^2.16.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@babel/parser": "^7.23.0",
"@babel/types": "^7.23.0",
"@parcel/plugin": "^2.13.1",
"@parcel/plugin": "^2.16.0",
"@parcel/source-map": "^2.1.1",
"@storybook/csf-tools": "^8",
"@storybook/docs-tools": "^8",
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/s2-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
}
},
"dependencies": {
"@parcel/plugin": "^2.15.4",
"@parcel/rsc": "^2.15.4",
"@parcel/plugin": "^2.16.0",
"@parcel/rsc": "^2.16.0",
"@react-aria/focus": "^3.20.4",
"@react-aria/i18n": "^3.12.10",
"@react-aria/interactions": "^3.25.1",
Expand Down
Loading