Repository: rollup/rollup
File: src/Module.ts (TypeScript)

Code before:
					.filter(Boolean) as ResolvedId[];
			},
			get dynamicallyImportedIds() {
				// We cannot use this.dynamicDependencies because this is needed before
				// dynamicDependencies are populated
				return dynamicImports.map(({ id }) => id).filter((id): id is string => id != null);
			},
			get dynamicImporters() {
				return dynamicImporters.sort();
			},
			get exportedBindings() {
				const reexportBindings: Record<string, string[]> = {};
				for (const [name, { source }] of reexportDescriptions) {
					reexportBindings[source] ??= [];
					reexportBindings[source].push(name);
				}

				const exportAllSourceBindings: Record<string, ['*']> = {};
				for (const source of exportAllSources) {
					exportAllSourceBindings[source] = ['*'];
				}

				const exportBindings: Record<string, string[]> =
					exports.size > 0 ? { '.': [...exports.keys()] } : {};

				return { ...exportBindings, ...reexportBindings, ...exportAllSourceBindings };
			},
			get exports() {
				return [
					...exports.keys(),
					...reexportDescriptions.keys(),
					...[...exportAllSources].map(() => '*')
				];
			},
			get hasDefaultExport() {
				// This information is only valid after parsing
				if (!module.ast) {
					return null;
				}
				return module.exports.has('default') || reexportDescriptions.has('default');
			},
			get hasModuleSideEffects() {
				warnDeprecation(
					'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',
					true,
					options
				);
				return this.moduleSideEffects;
			},
			id,
			get implicitlyLoadedAfterOneOf() {

Review comment (performance):
If you do it this way, in a module where you have both an export-all and a regular reexport from the same module

```js
export * from 'foo';
export { foo as bar } from 'foo';
```

as I see it, the export-all would overwrite the reexport in `exportedBindings`, leaving only

```
{ foo: ['*'] }
```

due to the use of spread operators.

But why spread at all, why don't you just create an `exportedBindings` object and put all properties on that one? Then you could just rewrite the second loop like

```js
for (const source of exportAllSources) {
  exportedBindings[source] ??= [];
  exportedBindings[source].push('*');
}
```

For a minimal performance gain (avoiding one computed property access), one could also combine the two lines into one

```js
for (const source of exportAllSources) {
  (exportedBindings[source] ??= []).push('*');
}
```

but only if you think this is still readable.

Code after:
					.filter(Boolean) as ResolvedId[];
			},
			get dynamicallyImportedIds() {
				// We cannot use this.dynamicDependencies because this is needed before
				// dynamicDependencies are populated
				return dynamicImports.map(({ id }) => id).filter((id): id is string => id != null);
			},
			get dynamicImporters() {
				return dynamicImporters.sort();
			},
			get exportedBindings() {
				const exportBindings: Record<string, string[]> = { '.': [...exports.keys()] };

				for (const [name, { source }] of reexportDescriptions) {
					(exportBindings[source] ??= []).push(name);
				}

				for (const source of exportAllSources) {
					(exportBindings[source] ??= []).push('*');
				}

				return exportBindings;
			},
			get exports() {
				return [
					...exports.keys(),
					...reexportDescriptions.keys(),
					...[...exportAllSources].map(() => '*')
				];
			},
			get hasDefaultExport() {
				// This information is only valid after parsing
				if (!module.ast) {
					return null;
				}
				return module.exports.has('default') || reexportDescriptions.has('default');
			},
			get hasModuleSideEffects() {
				warnDeprecation(
					'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',
					true,
					options
				);
				return this.moduleSideEffects;
			},
			id,
			get implicitlyLoadedAfterOneOf() {
				// eslint-disable-next-line unicorn/prefer-spread
				return Array.from(implicitlyLoadedAfter, getId).sort();
			},
			get implicitlyLoadedBefore() {