Open krassowski opened 3 years ago
There is also another issue with these files. I tried to use some italian dictionary but Typo.js is not able to load this file within seconds. The problem is that the hunspell rules are so clever that you can create a big word list with some lines ... I want to check how we can circumvent this problem. Some ideas are:
Anyway we need a better solution. BTW, I was in contact with the main author of Typo.js and he is not actively working on the package. I send him a pull request two month ago which he wants to work on but there is no change so far! (you can check this BUG "hEllo" is marked as correct ... ;-) So we should keep this in mind ...
I just uploaded first federated version to PyPI, it weights >10MB: https://test.pypi.org/project/jupyterlab-spellchecker/0.4.0/
So this is also an argument for splitting the dictionaries into separate packages... I guess we could use entry-points so that the user could do:
pip install jupyterlab-spellchecker[german]
pip install jupyterlab-spellchecker[english]
pip install jupyterlab-spellchecker[all]
etc.
I will be thinking how to make it easy and how fetching from backend fits into all of this.
Currently we pre-load all dictionaries as they are a part of the pre-build bundle. This is wasteful as an average user does not use more than 1-3 languages at once. This is also highlighted by the asset size warning:
A few months back I discussed how we could integrate the dictionaries with language packs with @goanpeca (who consistently nudged me on this - thanks ;)). We can now start moving towards that goal as the extension is in the new organization and #48 ports it to use federated extensions toolset. Opening this issue to track progress and exchange ideas.
One option would be adding a server extension endpoint like in: https://github.com/jupyterlab/extension-cookiecutter-ts/blob/3.0/%7B%7Bcookiecutter.python_name%7D%7D/src/index.ts