-
Notifications
You must be signed in to change notification settings - Fork 3.6k
refactor: space app barrel exports #7573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,9 +4,11 @@ import { observer } from "mobx-react"; | |||||||||||||||||||||||
| import { useSearchParams } from "next/navigation"; | ||||||||||||||||||||||||
| import useSWR from "swr"; | ||||||||||||||||||||||||
| // components | ||||||||||||||||||||||||
| import { IssuesLayoutsRoot } from "@/components/issues"; | ||||||||||||||||||||||||
| import { IssuesLayoutsRoot } from "@/components/issues/issue-layouts"; | ||||||||||||||||||||||||
| // hooks | ||||||||||||||||||||||||
| import { usePublish, useLabel, useStates } from "@/hooks/store"; | ||||||||||||||||||||||||
| import { usePublish } from "@/hooks/store/publish"; | ||||||||||||||||||||||||
| import { useLabel } from "@/hooks/store/use-label"; | ||||||||||||||||||||||||
| import { useStates } from "@/hooks/store/use-state"; | ||||||||||||||||||||||||
|
Comment on lines
+7
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify named export path and consider importing directly from root to avoid the folder barrel. If the goal is to eliminate barrels, import the component directly from its module file. Apply this minimal change if -import { IssuesLayoutsRoot } from "@/components/issues/issue-layouts";
+import { IssuesLayoutsRoot } from "@/components/issues/issue-layouts/root";Also validate that 🏁 Script executed: #!/bin/bash
# Check that IssuesLayoutsRoot is exported (named or default)
rg -n "export .*IssuesLayoutsRoot|export \\{[^}]*IssuesLayoutsRoot" -A 2Length of output: 381 🏁 Script executed: #!/bin/bash
# List all files directly under the issue-layouts directory
find apps/space/core/components/issues/issue-layouts -maxdepth 1 -type fLength of output: 453 🏁 Script executed: #!/bin/bash
# Check if IssuesLayoutsRoot is re-exported in the barrel file
rg -n "IssuesLayoutsRoot" -A 5 apps/space/core/components/issues/issue-layouts/index.tsLength of output: 87 🏁 Script executed: #!/bin/bash
# Display the contents of the barrel file to verify exports
sed -n '1,200p' apps/space/core/components/issues/issue-layouts/index.tsLength of output: 96 Import • In -import { IssuesLayoutsRoot } from "@/components/issues/issue-layouts";
+import { IssuesLayoutsRoot } from "@/components/issues/issue-layouts/root";This makes the dependency explicit and removes the indirection through the barrel. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| type Props = { | ||||||||||||||||||||||||
| params: { | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| import { PageNotFound } from "@/components/ui/not-found"; | ||
| import { PublishStore } from "@/store/publish/publish.store"; | ||
| import type { PublishStore } from "@/store/publish/publish.store"; | ||
|
|
||
| type Props = { | ||
| peekId: string | undefined; | ||
| publishSettings: PublishStore; | ||
| }; | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| export const ViewLayoutsRoot = (props: Props) => <PageNotFound />; | ||
| export const ViewLayoutsRoot = (_props: Props) => <PageNotFound />; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1 @@ | ||
| export * from "./auth-root"; | ||
|
|
||
| export * from "./auth-header"; | ||
| export * from "./auth-banner"; | ||
|
|
||
| export * from "./email"; | ||
| export * from "./password"; | ||
| export * from "./unique-code"; |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,12 +3,13 @@ import React from "react"; | |
| import { type EditorRefApi, type ILiteTextEditorProps, LiteTextEditorWithRef, type TFileHandler } from "@plane/editor"; | ||
| import type { MakeOptional } from "@plane/types"; | ||
| import { cn } from "@plane/utils"; | ||
| // components | ||
| import { EditorMentionsRoot, IssueCommentToolbar } from "@/components/editor"; | ||
| // helpers | ||
| import { getEditorFileHandlers } from "@/helpers/editor.helper"; | ||
| import { isCommentEmpty } from "@/helpers/string.helper"; | ||
| import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; | ||
| // local imports | ||
| import { EditorMentionsRoot } from "./embeds/mentions"; | ||
| import { IssueCommentToolbar } from "./toolbar"; | ||
|
Comment on lines
+10
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainImports correctly de-barreled; verify local paths resolve Switching to local module imports for mentions and toolbar aligns with the PR goal and avoids barrel side effects. Run this to ensure there are no remaining editor barrel imports and that these local modules exist: 🏁 Script executed: #!/bin/bash
# 1) Check for residual editor barrel imports
rg -n $'from\\s+[\'"]@/components/editor[\'"]|from\\s+[\'"]@/components/editor/' -S || true
# 2) Confirm the local files referenced here exist
fd -a --hidden --follow --strip-cwd-prefix $'apps/space/core/components/editor/embeds/mentions.tsx\napps/space/core/components/editor/toolbar.tsx' \
--exec bash -lc 'for f; do [[ -f "$f" ]] && echo "FOUND $f" || echo "MISSING $f"; done' _Length of output: 3204 🏁 Script executed: #!/bin/bash
# 1) Check for any remaining @/components/editor barrel imports within apps/space
rg -n "from\s+['\"]@/components/editor(/|['\"])" --glob "apps/space/**/*" || true
# 2) Confirm the local modules referenced by lite-text-editor.tsx actually exist
for f in \
apps/space/core/components/editor/embeds/mentions.tsx \
apps/space/core/components/editor/toolbar.tsx; do
if [[ -f "$f" ]]; then
echo "FOUND $f"
else
echo "MISSING $f"
fi
doneLength of output: 1108 Missing local module & residual barrel imports detected The import in apps/space/core/components/editor/lite-text-editor.tsx: import { EditorMentionsRoot } from "./embeds/mentions";points to apps/space/core/components/editor/embeds/mentions.tsx, which does not exist. Please either:
Additionally, there are still editor imports using the
Please update these to match the new file structure or confirm they resolve correctly. 🤖 Prompt for AI Agents |
||
|
|
||
| type LiteTextEditorWrapperProps = MakeOptional< | ||
| Omit<ILiteTextEditorProps, "fileHandler" | "mentionHandler">, | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1 @@ | ||
| // filters | ||
| export * from "./root"; | ||
| export * from "./selection"; | ||
|
|
||
| // properties | ||
| export * from "./state"; | ||
| export * from "./priority"; | ||
| export * from "./labels"; | ||
|
|
||
| // helpers | ||
| export * from "./helpers"; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| export * from "./kanban/base-kanban-root"; | ||
| export * from "./list/base-list-root"; | ||
| export * from "./properties"; | ||
| export * from "./root"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Replace remaining barrel imports with file-level modules
Great move on de-barreling most imports. Two spots still import from folder-level barrels. To fully meet the PR objective and improve tree-shaking, import from the concrete modules.
Check repo-wide for remaining barrels for these modules and confirm granular modules exist:
Also applies to: 9-13
🏁 Script executed:
Length of output: 2180
Replace all remaining barrel imports for issues/navbar and hooks/store/publish
We still have multiple occurrences of barrel imports that need to switch to the concrete modules to complete the de-barreling effort and improve tree-shaking:
• apps/space/app/issues/[anchor]/client-layout.tsx
• apps/space/app/views/[anchor]/page.tsx
• apps/space/app/issues/[anchor]/page.tsx
• apps/space/app/views/[anchor]/layout.tsx
(And similarly in core components under
apps/space/core/components/issues/...)Please update each to:
Before applying, verify these files exist in the
apps/space/core/…directory:This will complete the PR objective and ensure all barrel imports are replaced.
🤖 Prompt for AI Agents