forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ perf: reduce server service bundle size by refactoring with consta…
…nt fold (lobehub#4641) * refactor * clean code
- Loading branch information
Showing
10 changed files
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const fileService = isServerMode ? new ServerService() : new ClientService(); | ||
export const fileService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const importService = isServerMode ? new ServerService() : new ClientService(); | ||
export const importService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const messageService = isServerMode ? new ServerService() : new ClientService(); | ||
export const messageService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const pluginService = isServerMode ? new ServerService() : new ClientService(); | ||
export const pluginService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const sessionService = isServerMode ? new ServerService() : new ClientService(); | ||
export const sessionService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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,6 @@ | ||
import { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const topicService = isServerMode ? new ServerService() : new ClientService(); | ||
export const topicService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 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 { isServerMode } from '@/const/version'; | ||
|
||
import { ClientService } from './client'; | ||
import { ServerService } from './server'; | ||
|
||
export const userService = isServerMode ? new ServerService() : new ClientService(); | ||
export const userService = | ||
process.env.NEXT_PUBLIC_SERVICE_MODE === 'server' ? new ServerService() : new ClientService(); |
This file contains 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 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