mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) dust off electron build a little bit
Summary: The changes in this diff are sufficient to make this sequence work again: ``` ./build electron-dev bin/electron app/electron/runPrebuild.js ``` This brings up the local server within an electron window. This is an unambitious diff, aimed at checking how rusty electron support had become. It does not revive Grist as a packaged electron app. The first substantial work needed would be to make the app aware of the local file system again, and think through how local files should be visualized and accessed now. In the past, there was a simple list of grist docs in a directory. Test Plan: manual Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3534
This commit is contained in:
@@ -190,6 +190,29 @@ export class FlexServer implements GristServer {
|
||||
this._pluginUrl = options.pluginUrl || process.env.APP_UNTRUSTED_URL;
|
||||
this.info.push(['pluginUrl', this._pluginUrl]);
|
||||
|
||||
// The electron build is not supported at this time, but this stub
|
||||
// implementation of electronServerMethods is present to allow kicking
|
||||
// its tires.
|
||||
let userConfig: any = {
|
||||
recentItems: [],
|
||||
};
|
||||
this.electronServerMethods = {
|
||||
async importDoc() { throw new Error('not implemented'); },
|
||||
onDocOpen(cb) {
|
||||
// currently only a stub.
|
||||
cb('');
|
||||
},
|
||||
async getUserConfig() {
|
||||
return userConfig;
|
||||
},
|
||||
async updateUserConfig(obj: any) {
|
||||
userConfig = obj;
|
||||
},
|
||||
onBackupMade() {
|
||||
log.info('backup skipped');
|
||||
}
|
||||
};
|
||||
|
||||
this.app.use((req, res, next) => {
|
||||
(req as RequestWithGrist).gristServer = this;
|
||||
next();
|
||||
@@ -1790,7 +1813,7 @@ function noCaching(req: express.Request, res: express.Response, next: express.Ne
|
||||
// Methods that Electron app relies on.
|
||||
export interface ElectronServerMethods {
|
||||
importDoc(filepath: string): Promise<DocCreationInfo>;
|
||||
onDocOpen(cb: () => void): void;
|
||||
onDocOpen(cb: (filePath: string) => void): void;
|
||||
getUserConfig(): Promise<any>;
|
||||
updateUserConfig(obj: any): Promise<void>;
|
||||
onBackupMade(cb: () => void): void;
|
||||
|
||||
Reference in New Issue
Block a user