Skip to content

Export Notebook for Web: call JupyterLab#ContentManager directly to simplify JupyterKernelSession #13577

@DonJayamanne

Description

@DonJayamanne
export interface IJupyterKernelSession extends IBaseKernelSession<'remoteJupyter' | 'localJupyter'> {
    invokeWithFileSynced(contents: string, handler: (file: IBackupFile) => Promise<void>): Promise<void>;
    createTempfile(ext: string): Promise<string>;
    deleteTempfile(file: string): Promise<void>;
    getContents(file: string, format: Contents.FileFormat): Promise<Contents.IModel>;
}

All of the above methods in the interface are only used in one place and one context.
Hence we should try to avoid adding these methods to a very generic interface,

Better to just expose the ContentManager and move all of the code into the Export or other layer rathe than keeping creation/deletion/reading of files in the IJupyterKernelSession class/interface.

Suggestions:

  • Expose the ContentManager of IJupyterSessionManager, this way we do not need anything IJupyterKernelSession.

After all, all of the above 4 methods on the session has nothing to do with the kernel session, but its about content management.

Also see #13578

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions