Develop Pretzel as a JupyterLab extension?
Hi, JupyterLab maintainer here :wave:
Thanks for putting this repo out there, it looks great!
After briefly looking at the repo, it looks like this is hard fork of the existing JupyterLab code base. I saw the README mentions the following question / answer:
Q. Why a fork of Jupyter? Why not contribute into Jupyter directly?
A. This deserves a longer answer but here's the short answer: We've set out to make the new de-facto, modern, open-source data tool. Initially, we wanted to start from scratch. However, after talking to several data professionals, we realized it will be very hard to get people to switch to a new tool, no matter how good. The best way to get people to switch is to not have them switch at all. That's why we decided to fork Jupyter - for the near zero switching costs. Also, Jupyter is a mature product, and we're shipping feature really fast - frankly, at the pace we're shipping features, the code we write won't be accepted into the Jupyter codebase 😅. There are also many downsides to this decision - we've had to spend considerable time understanding the whole Jupyter ecosystem and multiple codebases, the complex release processes, the various APIs etc. However, we think this is the right decision for us.
It's true that JupyterLab releases might take some time to be available, although the pace of releases has increased the past few months.
I just wanted to share another way for developing Pretzel which you might be interested in. JupyterLab was designed to be very extensible and easily customized to fit the needs of various use cases, all via the use of extensions. As you probably already know, JupyterLab is just a set of extensions shipped together to form a base environment, but many more extensions can be installed to provide additional functionalities. For example the ones hosted in the jupyterlab-contrib organization on GitHub: https://github.com/jupyterlab-contrib
After glancing at the code base, it looks like you could follow this approach of authoring extensions for JupyterLab directly. This would remove the need of maintaining the whole JupyterLab code base, which can be quite time consuming! And you could then just focus on the AI features for your product. And you could release your extension(s) as fast as needed, independently from JupyterLab.
Sharing some resources here in case you would be interested in following this approach:
- Extension documentation: https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html
- Extension examples: https://github.com/jupyterlab/extension-examples
Also if would like to disable or replace some JupyterLab core features and plugin, you could look into using the disabledExtensions mechanism documented here: https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html#disabling-other-extensions. JupyterLab was designed to allow users and extension authors to do just that, being able to swap functionalities easily.
Finally, if there are some missing features and API in core JupyterLab on which to build on, let us know! We are always seeking feedback from the Jupyter community to improve the existing extension points. As an example this was the case recently with the addition of the Inline Completer API which enabled AI code completions via Jupyter AI. And PRs welcome :)
frankly, at the pace we're shipping features, the code we write won't be accepted into the Jupyter codebase
Speaking as another JupyterLab maintainer: JupyterLab ships features regularly and if you ever need to extend API to cover your use case it should not be a problem to get it out there. Do you have an example of a PR made by anyone from pretzel that you had difficulty getting in?
I think the only difficulty you might get is your intend to use Monaco as an editor over CodeMirror. There are reasons to prefer one over another, but in principle CodeMirror can support all the features that Monaco does and both can be integrated with LSP (as in case of Jupyter, https://github.com/jupyter-lsp/jupyterlab-lsp). I think feature parity is not far of if there is an interest to contribute (and it is extensible so if you want to provide LSP features that are unique to pretzel that should be easy too).
Personally I hope we can see more companies contributing upstream to make the world a better place for everyone :)