Skip to content

Commit 8ec96fc

Browse files
Test light version
1 parent 6eef09e commit 8ec96fc

12 files changed

+76
-39
lines changed

arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { ArduinoMenus } from './menu/arduino-menus';
4242
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
4343
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
4444
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
45+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
4546

4647
@injectable()
4748
export class ArduinoFrontendContribution
@@ -103,6 +104,12 @@ export class ArduinoFrontendContribution
103104
}
104105

105106
registerToolbarItems(registry: TabBarToolbarRegistry): void {
107+
const config = FrontendApplicationConfigProvider.get();
108+
109+
debugger;
110+
if (config.isLightVersion) {
111+
return;
112+
}
106113
registry.registerItem({
107114
id: BoardsToolBarItem.TOOLBAR_ID,
108115
render: () => (

arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+7-11
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ import { TabBarDecoratorService as TheiaTabBarDecoratorService } from '@theia/co
8585
import { TabBarDecoratorService } from './theia/core/tab-bar-decorator';
8686
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser';
8787
import { ProblemManager } from './theia/markers/problem-manager';
88-
import { BoardsAutoInstaller } from './boards/boards-auto-installer';
8988
import { ShellLayoutRestorer } from './theia/core/shell-layout-restorer';
9089
import {
9190
ArduinoComponentContextMenuRenderer,
@@ -222,9 +221,6 @@ import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/mess
222221
import { NotificationsRenderer } from './theia/messages/notifications-renderer';
223222
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
224223
import { LocalCacheFsProvider } from './local-cache/local-cache-fs-provider';
225-
import { CloudSketchbookWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-widget';
226-
import { CloudSketchbookTreeWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-tree-widget';
227-
import { createCloudSketchbookTreeWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-tree-container';
228224
import { CreateApi } from './create/create-api';
229225
import { ShareSketchDialog } from './dialogs/cloud-share-sketch-dialog';
230226
import { AuthenticationClientService } from './auth/authentication-client-service';
@@ -497,8 +493,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
497493
.whenTargetNamed('store');
498494

499495
// Boards auto-installer
500-
bind(BoardsAutoInstaller).toSelf().inSingletonScope();
501-
bind(FrontendApplicationContribution).toService(BoardsAutoInstaller);
496+
// bind(BoardsAutoInstaller).toSelf().inSingletonScope();
497+
// bind(FrontendApplicationContribution).toService(BoardsAutoInstaller);
502498

503499
// Boards list widget
504500
bind(BoardsListWidget).toSelf();
@@ -970,11 +966,11 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
970966
createWidget: () => ctx.container.get(SketchbookCompositeWidget),
971967
}));
972968

973-
bind(CloudSketchbookWidget).toSelf();
974-
rebind(SketchbookWidget).toService(CloudSketchbookWidget);
975-
bind(CloudSketchbookTreeWidget).toDynamicValue(({ container }) =>
976-
createCloudSketchbookTreeWidget(container)
977-
);
969+
// bind(CloudSketchbookWidget).toSelf();
970+
// rebind(SketchbookWidget).toService(CloudSketchbookWidget);
971+
// bind(CloudSketchbookTreeWidget).toDynamicValue(({ container }) =>
972+
// createCloudSketchbookTreeWidget(container)
973+
// );
978974
bind(CreateApi).toSelf().inSingletonScope();
979975
bind(SketchCache).toSelf().inSingletonScope();
980976
bind(CreateFeatures).toSelf().inSingletonScope();

arduino-ide-extension/src/browser/boards/boards-auto-installer.ts

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export class BoardsAutoInstaller implements FrontendApplicationContribution {
5252
private readonly toDispose = new DisposableCollection();
5353

5454
onStart(): void {
55+
if (process.env.IS_LIGHT_VERSION) {
56+
return;
57+
}
58+
5559
this.toDispose.pushAll([
5660
this.boardsServiceProvider.onBoardsConfigDidChange((event) => {
5761
if (isBoardIdentifierChangeEvent(event)) {

arduino-ide-extension/src/browser/contributions/boards-data-menu-updater.ts

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export class BoardsDataMenuUpdater extends Contribution {
3535
private readonly toDisposeOnBoardChange = new DisposableCollection();
3636

3737
override onStart(): void {
38+
if (process.env.IS_LIGHT_VERSION) {
39+
return;
40+
}
41+
3842
this.boardsDataStore.onDidChange(() =>
3943
this.updateMenuActions(
4044
this.boardsServiceProvider.boardsConfig.selectedBoard

arduino-ide-extension/src/browser/contributions/check-for-ide-updates.ts

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export class CheckForIDEUpdates extends Contribution {
4747
}
4848

4949
override async onReady(): Promise<void> {
50+
if (process.env.IS_LIGHT_VERSION) {
51+
return;
52+
}
53+
5054
this.updater
5155
.init(
5256
this.preferences.get('arduino.ide.updateChannel'),

arduino-ide-extension/src/browser/contributions/indexes-update-progress.ts

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export class IndexesUpdateProgress extends Contribution {
1616
| undefined;
1717

1818
override onStart(): void {
19+
if (process.env.IS_LIGHT_VERSION) {
20+
return;
21+
}
22+
1923
this.notificationCenter.onIndexUpdateWillStart(({ progressId }) =>
2024
this.getOrCreateProgress(progressId)
2125
);

arduino-ide-extension/src/browser/contributions/ino-language.ts

+8
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ export class InoLanguage extends SketchContribution {
113113
private languageServerFqbn?: string;
114114

115115
override onReady(): void {
116+
if (process.env.IS_LIGHT_VERSION) {
117+
return;
118+
}
119+
116120
const start = (
117121
selectedBoard: BoardIdentifier | undefined,
118122
forceStart = false
@@ -191,6 +195,10 @@ export class InoLanguage extends SketchContribution {
191195
name: string | undefined,
192196
forceStart = false
193197
): Promise<void> {
198+
if (process.env.IS_LIGHT_VERSION) {
199+
return;
200+
}
201+
194202
const port = await this.daemon.tryGetPort();
195203
if (typeof port !== 'number') {
196204
return;

arduino-ide-extension/src/browser/contributions/update-indexes.ts

+12
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export class UpdateIndexes extends Contribution {
4545
}
4646

4747
private async checkForUpdates(): Promise<void> {
48+
if (process.env.IS_LIGHT_VERSION) {
49+
return;
50+
}
51+
4852
const checkForUpdates = this.preferences['arduino.checkForUpdates'];
4953
if (!checkForUpdates) {
5054
console.debug(
@@ -83,6 +87,10 @@ export class UpdateIndexes extends Contribution {
8387
types: IndexType[],
8488
force = false
8589
): Promise<void> {
90+
if (process.env.IS_LIGHT_VERSION) {
91+
return;
92+
}
93+
8694
const updatedAt = new Date().toISOString();
8795
return Promise.all(
8896
types.map((type) => this.needsIndexUpdate(type, updatedAt, force))
@@ -104,6 +112,10 @@ export class UpdateIndexes extends Contribution {
104112
now: string,
105113
force = false
106114
): Promise<IndexType | false> {
115+
if (process.env.IS_LIGHT_VERSION) {
116+
return false;
117+
}
118+
107119
if (force) {
108120
console.debug(
109121
`[update-indexes]: Update for index type: '${type}' was forcefully requested.`

arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+2
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
521521
}
522522

523523
protected override async startBackend(): Promise<number> {
524+
// FIXME: temporary test to check improvements on low powered machines.
525+
process.env.IS_LIGHT_VERSION = 'true';
524526
// Check if we should run everything as one process.
525527
const noBackendFork = process.argv.indexOf('--no-cluster') !== -1;
526528
// We cannot use the `process.cwd()` as the application project path (the location of the `package.json` in other words)

arduino-ide-extension/src/node/arduino-ide-backend-module.ts

+20-25
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ import {
7575
} from '../common/protocol';
7676
import { BackendApplication } from './theia/core/backend-application';
7777
import { BoardDiscovery } from './board-discovery';
78-
import { AuthenticationServiceImpl } from './auth/authentication-service-impl';
79-
import {
80-
AuthenticationService,
81-
AuthenticationServiceClient,
82-
AuthenticationServicePath,
83-
} from '../common/protocol/authentication-service';
78+
8479
import { ArduinoFirmwareUploaderImpl } from './arduino-firmware-uploader-impl';
8580
import { PlotterBackendContribution } from './plotter/plotter-backend-contribution';
8681
import { ArduinoLocalizationContribution } from './i18n/arduino-localization-contribution';
@@ -354,25 +349,25 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
354349
].forEach((name) => bindChildLogger(bind, name));
355350

356351
// Cloud sketchbook bindings
357-
bind(AuthenticationServiceImpl).toSelf().inSingletonScope();
358-
bind(AuthenticationService).toService(AuthenticationServiceImpl);
359-
bind(BackendApplicationContribution).toService(AuthenticationServiceImpl);
360-
bind(ConnectionHandler)
361-
.toDynamicValue(
362-
(context) =>
363-
new JsonRpcConnectionHandler<AuthenticationServiceClient>(
364-
AuthenticationServicePath,
365-
(client) => {
366-
const server = context.container.get<AuthenticationServiceImpl>(
367-
AuthenticationServiceImpl
368-
);
369-
server.setClient(client);
370-
client.onDidCloseConnection(() => server.disposeClient(client));
371-
return server;
372-
}
373-
)
374-
)
375-
.inSingletonScope();
352+
// bind(AuthenticationServiceImpl).toSelf().inSingletonScope();
353+
// bind(AuthenticationService).toService(AuthenticationServiceImpl);
354+
// bind(BackendApplicationContribution).toService(AuthenticationServiceImpl);
355+
// bind(ConnectionHandler)
356+
// .toDynamicValue(
357+
// (context) =>
358+
// new JsonRpcConnectionHandler<AuthenticationServiceClient>(
359+
// AuthenticationServicePath,
360+
// (client) => {
361+
// const server = context.container.get<AuthenticationServiceImpl>(
362+
// AuthenticationServiceImpl
363+
// );
364+
// server.setClient(client);
365+
// client.onDidCloseConnection(() => server.disposeClient(client));
366+
// return server;
367+
// }
368+
// )
369+
// )
370+
// .inSingletonScope();
376371

377372
bind(PlotterBackendContribution).toSelf().inSingletonScope();
378373
bind(BackendApplicationContribution).toService(PlotterBackendContribution);

arduino-ide-extension/src/node/board-discovery.ts

+4
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ export class BoardDiscovery
170170
}
171171

172172
async start(): Promise<void> {
173+
if (process.env.IS_LIGHT_VERSION) {
174+
return;
175+
}
176+
173177
this.logger.info('start');
174178
if (this.stopping) {
175179
this.logger.info('start is stopping wait');

scripts/package.sh

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ set -e
44

55
yarn install --immutable \
66
&& yarn --cwd arduino-ide-extension build \
7-
&& yarn test \
8-
&& yarn --cwd arduino-ide-extension test:slow \
9-
&& yarn --cwd arduino-ide-extension lint \
107
&& yarn --cwd electron-app rebuild \
118
&& yarn --cwd electron-app build \
129
&& yarn --cwd electron-app package

0 commit comments

Comments
 (0)