-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: enable dead code elimination in split-route to remove unused imports #5711
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...er-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "arrow-function.tsx"; | ||
| import * as React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "arrow-function.tsx"; | ||
| import * as React from 'react'; |
1 change: 0 additions & 1 deletion
1
...-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // Test errorComponent with false literal | ||
| import { Route } from "boolean-null-literals.tsx"; | ||
| const SplitComponent = () => <div>Test Component</div>; | ||
| export { SplitComponent as component }; |
2 changes: 0 additions & 2 deletions
2
...in/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +0,0 @@ | ||
| // Test errorComponent with false literal | ||
| import { Route } from "boolean-null-literals.tsx"; | ||
2 changes: 0 additions & 2 deletions
2
...tests/code-splitter/snapshots/react/1-default/boolean-null-literals@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +0,0 @@ | ||
| // Test errorComponent with false literal | ||
| import { Route } from "boolean-null-literals.tsx"; | ||
1 change: 0 additions & 1 deletion
1
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...es/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "chinese.tsx"; | ||
| interface DemoProps { | ||
| title: string; | ||
| } |
1 change: 0 additions & 1 deletion
1
...router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "chinese.tsx"; | ||
| interface DemoProps { | ||
| title: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...plugin/tests/code-splitter/snapshots/react/1-default/conditional-properties@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import { isEnabled } from '@features/feature-flags'; | ||
| import TrueImport from '@modules/true-component'; | ||
| import { FalseComponent } from '@modules/false-component'; | ||
| import { Route } from "conditional-properties.tsx"; | ||
| const SplitComponent = isEnabled ? TrueImport.Component : FalseComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...n/tests/code-splitter/snapshots/react/1-default/conditional-properties@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "conditional-properties.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...ests/code-splitter/snapshots/react/1-default/conditional-properties@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "conditional-properties.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...litter/snapshots/react/1-default/destructured-react-memo-imported-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...r/snapshots/react/1-default/destructured-react-memo-imported-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "destructured-react-memo-imported-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...napshots/react/1-default/destructured-react-memo-imported-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "destructured-react-memo-imported-component.tsx"; | ||
3 changes: 1 addition & 2 deletions
3
.../tests/code-splitter/snapshots/react/1-default/explicit-undefined-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "explicit-undefined-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...s/code-splitter/snapshots/react/1-default/explicit-undefined-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "explicit-undefined-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...ode-splitter/snapshots/react/1-default/explicit-undefined-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "explicit-undefined-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...tter/snapshots/react/1-default/export-default-component-and-normal-notFound@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "export-default-component-and-normal-notFound.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...snapshots/react/1-default/export-default-component-and-normal-notFound@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "export-default-component-and-normal-notFound.tsx"; | ||
| import React from 'react'; |
1 change: 0 additions & 1 deletion
1
...pshots/react/1-default/export-default-component-and-normal-notFound@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ugin/tests/code-splitter/snapshots/react/1-default/export-default-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "export-default-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...tests/code-splitter/snapshots/react/1-default/export-default-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "export-default-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...ts/code-splitter/snapshots/react/1-default/export-default-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import React from 'react'; | ||
| import { Route } from "export-default-component.tsx"; | ||
| import React from 'react'; |
3 changes: 1 addition & 2 deletions
3
...gin/tests/code-splitter/snapshots/react/1-default/function-declaration@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "function-declaration.tsx"; | ||
| import * as React from 'react'; |
3 changes: 1 addition & 2 deletions
3
.../tests/code-splitter/snapshots/react/1-default/function-declaration@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "function-declaration.tsx"; | ||
| import * as React from 'react'; |
1 change: 0 additions & 1 deletion
1
...router-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { test } from './test' with { type: 'macro' }; | ||
| import { Route } from "importAttribute.tsx"; | ||
| const SplitComponent = () => test; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...r-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "importAttribute.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...lugin/tests/code-splitter/snapshots/react/1-default/importAttribute@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "importAttribute.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...er/snapshots/react/1-default/imported-default-component-destructured-loader@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import importedComponent from '../../shared/imported'; | ||
| import { Route } from "imported-default-component-destructured-loader.tsx"; | ||
| const SplitComponent = importedComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...apshots/react/1-default/imported-default-component-destructured-loader@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-default-component-destructured-loader.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...hots/react/1-default/imported-default-component-destructured-loader@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-default-component-destructured-loader.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...in/tests/code-splitter/snapshots/react/1-default/imported-default-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import ImportedDefaultComponent from '../../shared/imported'; | ||
| import { Route } from "imported-default-component.tsx"; | ||
| const SplitComponent = ImportedDefaultComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...sts/code-splitter/snapshots/react/1-default/imported-default-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-default-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
.../code-splitter/snapshots/react/1-default/imported-default-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-default-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...lugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import ImportedDefaultComponent from '../../shared/imported'; | ||
| import { Route } from "imported-errorComponent.tsx"; | ||
| const SplitComponent = ImportedDefaultComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
.../tests/code-splitter/snapshots/react/1-default/imported-errorComponent@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { importedErrorComponent } from '../../shared/imported'; | ||
| import { Route } from "imported-errorComponent.tsx"; | ||
| const SplitErrorComponent = importedErrorComponent; | ||
| export { SplitErrorComponent as errorComponent }; |
1 change: 0 additions & 1 deletion
1
...sts/code-splitter/snapshots/react/1-default/imported-errorComponent@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-errorComponent.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...in/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import ImportedDefaultComponent from '../../shared/imported'; | ||
| import { Route } from "imported-notFoundComponent.tsx"; | ||
| const SplitComponent = ImportedDefaultComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...sts/code-splitter/snapshots/react/1-default/imported-notFoundComponent@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-notFoundComponent.tsx"; | ||
1 change: 0 additions & 1 deletion
1
.../code-splitter/snapshots/react/1-default/imported-notFoundComponent@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { importedNotFoundComponent } from '../../shared/imported'; | ||
| import { Route } from "imported-notFoundComponent.tsx"; | ||
| const SplitNotFoundComponent = importedNotFoundComponent; | ||
| export { SplitNotFoundComponent as notFoundComponent }; |
1 change: 0 additions & 1 deletion
1
...gin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import ImportedDefaultComponent from '../../shared/imported'; | ||
| import { Route } from "imported-pendingComponent.tsx"; | ||
| const SplitComponent = ImportedDefaultComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...ests/code-splitter/snapshots/react/1-default/imported-pendingComponent@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-pendingComponent.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...s/code-splitter/snapshots/react/1-default/imported-pendingComponent@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported-pendingComponent.tsx"; | ||
1 change: 0 additions & 1 deletion
1
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { importedComponent } from '../../shared'; | ||
| import { Route } from "imported.tsx"; | ||
| const SplitComponent = importedComponent; | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
...s/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...outer-plugin/tests/code-splitter/snapshots/react/1-default/imported@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "imported.tsx"; | ||
3 changes: 1 addition & 2 deletions
3
...ges/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "inline.tsx"; | ||
| Route.addChildren([]); | ||
| import { test } from "inline.tsx"; | ||
| Route.addChildren([]); |
3 changes: 1 addition & 2 deletions
3
.../router-plugin/tests/code-splitter/snapshots/react/1-default/inline@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import * as React from 'react'; | ||
| import { Route } from "inline.tsx"; | ||
| Route.addChildren([]); | ||
| import { test } from "inline.tsx"; | ||
| Route.addChildren([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...r-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...gin/tests/code-splitter/snapshots/react/1-default/react-memo-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "react-memo-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
.../tests/code-splitter/snapshots/react/1-default/react-memo-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "react-memo-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...tests/code-splitter/snapshots/react/1-default/react-memo-imported-component@component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import React from 'react'; | ||
| import { importedComponent } from '../../shared/imported'; | ||
| import { Route } from "react-memo-imported-component.tsx"; | ||
| const SplitComponent = React.memo(importedComponent); | ||
| export { SplitComponent as component }; |
1 change: 0 additions & 1 deletion
1
.../code-splitter/snapshots/react/1-default/react-memo-imported-component@errorComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "react-memo-imported-component.tsx"; | ||
1 change: 0 additions & 1 deletion
1
...de-splitter/snapshots/react/1-default/react-memo-imported-component@notFoundComponent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| import { Route } from "react-memo-imported-component.tsx"; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion | 🟠 Major
Good refactor for dead code elimination, but add type safety for destructured patterns.
The refactor correctly separates import declaration construction and adds traversal to track imported identifiers for dead code elimination. However, lines 733-734 use
(decl.id as any).namewithout verifying thatdecl.idis actually anIdentifier.Variable declarations can have destructured patterns (e.g.,
export const { x, y } = obj), which would cause a runtime error sinceObjectPatterndoesn't have a.nameproperty.Apply this diff to add type safety:
🤖 Prompt for AI Agents