Skip to content

Commit

Permalink
[core] Remove unused use client (#38967)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Oct 30, 2023
1 parent 8df1870 commit 0d40384
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 38 deletions.
1 change: 0 additions & 1 deletion packages/mui-base/src/ClickAwayListener/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
'use client';
export * from './ClickAwayListener';
1 change: 0 additions & 1 deletion packages/mui-base/src/Dropdown/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export * from './Dropdown';
export * from './Dropdown.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/FocusTrap/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { FocusTrap } from './FocusTrap';
export * from './FocusTrap.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/FormControl/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { FormControl } from './FormControl';

export { FormControlContext } from './FormControlContext';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Modal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Modal } from './Modal';
export * from './Modal.types';
export * from './modalClasses';
1 change: 0 additions & 1 deletion packages/mui-material/src/GlobalStyles/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
'use client';
export { default } from './GlobalStyles';
32 changes: 0 additions & 32 deletions packages/rsc-builder/buildRsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,6 @@ async function processFile(
await fse.writeFile(filename, newContents);
}

function getIndexFile(directory: string) {
const items = fse.readdirSync(directory);

const indexFile = items.reduce((prev, curr) => {
if (!/^index.(js|ts)/.test(curr)) {
return prev;
}
return curr;
}, '');

return {
filename: path.join(directory, indexFile),
};
}

async function findAll(
directories: string[],
grep: RegExp | null,
Expand Down Expand Up @@ -124,24 +109,11 @@ async function run(argv: yargs.ArgumentsCamelCase<CommandOptions>) {
];
}

const indexFile = getIndexFile(projectSrc);

try {
processFile(indexFile.filename);
} catch (error: any) {
error.message = `${path.relative(process.cwd(), indexFile.filename)}: ${error.message}`;
throw error;
}

const components = await findAll(directories, grep, findComponents);

components.forEach(async (component) => {
try {
processFile(component.filename);

if (component.indexFilename) {
processFile(component.indexFilename);
}
} catch (error: any) {
error.message = `${path.relative(process.cwd(), component.filename)}: ${error.message}`;
throw error;
Expand All @@ -153,10 +125,6 @@ async function run(argv: yargs.ArgumentsCamelCase<CommandOptions>) {
hooks.forEach(async (hook) => {
try {
processFile(hook.filename);

if (hook.indexFilename) {
processFile(hook.indexFilename);
}
} catch (error: any) {
error.message = `${path.relative(process.cwd(), hook.filename)}: ${error.message}`;
throw error;
Expand Down

1 comment on commit 0d40384

@og2t
Copy link

@og2t og2t commented on 0d40384 Apr 2, 2024

Choose a reason for hiding this comment

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

use client was not unused. Required for nextjs server app router. Any chance to bring it back?

Please sign in to comment.