@devisfuture/electron-modular 1.2.22 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
# Package Documentation
|
|
2
|
-
|
|
3
1
|
<p align="center">
|
|
4
2
|
<img src="./illustration.png" alt="electron-modular illustration" width="640" />
|
|
5
3
|
</p>
|
|
6
4
|
|
|
7
|
-
[](https://www.npmjs.com/package/@devisfuture/electron-modular) [](https://www.npmjs.com/package/@devisfuture/electron-modular) [](https://www.npmjs.com/package/@devisfuture/electron-modular) [](https://github.com/trae-op/electron-modular/actions/workflows/ci.yml) [](https://codecov.io/gh/trae-op/electron-modular) [](https://www.typescriptlang.org/) [](https://github.com/trae-op/electron-modular)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Contributing guide: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
12
|
-
- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
13
|
-
- Security policy: [SECURITY.md](SECURITY.md)
|
|
7
|
+
A ⭐ means a lot if this saved you some time.
|
|
14
8
|
|
|
15
9
|
## Navigation
|
|
16
10
|
|
|
@@ -672,30 +666,6 @@ Bootstraps all modules and initializes the DI container.
|
|
|
672
666
|
await bootstrapModules([AppModule, AuthModule, ResourcesModule]);
|
|
673
667
|
```
|
|
674
668
|
|
|
675
|
-
Lazy modules are registered but not initialized during bootstrap. Initialization happens on first `ipcRenderer.invoke(trigger)` from renderer process.
|
|
676
|
-
|
|
677
|
-
```typescript
|
|
678
|
-
@RgModule({
|
|
679
|
-
providers: [AnalyticsService],
|
|
680
|
-
ipc: [AnalyticsIpc],
|
|
681
|
-
lazy: {
|
|
682
|
-
enabled: true,
|
|
683
|
-
trigger: "analytics",
|
|
684
|
-
},
|
|
685
|
-
})
|
|
686
|
-
export class AnalyticsModule {}
|
|
687
|
-
|
|
688
|
-
await bootstrapModules([UserModule, AnalyticsModule]);
|
|
689
|
-
// UserModule: initialized immediately
|
|
690
|
-
// AnalyticsModule: initialized on first ipcRenderer.invoke("analytics")
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
Notes:
|
|
694
|
-
|
|
695
|
-
- Lazy loading defers runtime initialization work (provider resolution, module instantiation, IPC `onInit`).
|
|
696
|
-
- It does not perform JavaScript code-splitting by itself; module code is still loaded by your app bundle strategy.
|
|
697
|
-
- Each lazy trigger must be unique across modules in the same bootstrap call.
|
|
698
|
-
|
|
699
669
|
### Lazy Loading modules
|
|
700
670
|
|
|
701
671
|
Lazy Loading lets you defer module initialization until the renderer explicitly requests it via `ipcRenderer.invoke(trigger)`.
|
|
@@ -1018,3 +988,9 @@ const window = await mainWindow.create();
|
|
|
1018
988
|
```typescript
|
|
1019
989
|
app.on("before-quit", () => destroyWindows());
|
|
1020
990
|
```
|
|
991
|
+
|
|
992
|
+
## Collaboration
|
|
993
|
+
|
|
994
|
+
- Contributing guide: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
995
|
+
- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
996
|
+
- Security policy: [SECURITY.md](SECURITY.md)
|
package/package.json
CHANGED