YarnClassic icon indicating copy to clipboard operation
YarnClassic copied to clipboard

Editor freezes on start/takes too long to load

Open cvertee opened this issue 4 years ago • 8 comments

When starting an editor you can sometimes see nodes but can't drag or edit them, only after some time they become available. Or on start you see nothing and the only option you have is to wait, but much longer time than in previous versions (0.4.124 for example).

cvertee avatar Jul 24 '21 02:07 cvertee

are you by any chance using any other language than english in the settings? We recently dicovered that the dictionary loader is having issues with some languages - this locks up yarn until the dictionary is loaded.

see https://github.com/YarnSpinnerTool/YarnEditor/issues/263

Can you change it to english and check if the problem goes away?

If so, we might have to remove russian or whatever language causes the lock from the available languages or somehow prevent it from locking up yarn (PR is welcome)

This is where it loads dicts btw https://github.com/YarnSpinnerTool/YarnEditor/blob/master/src/js/libs/spellcheck_ace.js#L6

blurymind avatar Jul 25 '21 11:07 blurymind

Yeah, changin story language from Russian to English helped

cvertee avatar Jul 25 '21 13:07 cvertee

This is the same issue then. Its all because of using that dictionary library locks it up while loading some languages.

On Sun, 25 Jul 2021, 14:46 cvertee, @.***> wrote:

Yeah, changin story language from Russian to English helped

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YarnSpinnerTool/YarnEditor/issues/275#issuecomment-886204472, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRWVPYYIISO33AK6AAMGTTZQISTANCNFSM5A4766AQ .

blurymind avatar Jul 25 '21 13:07 blurymind

Hm as i see updating spell check setting loads dictionary again, maybe not load dictionaries on start while spell check is disabled?

cvertee avatar Jul 25 '21 14:07 cvertee

maybe something like this will work?

this.setLanguage = function(language, e) {
    const languageId = e ? e.target.value : language;
    if (self.settings.spellcheckEnabled())
      load_dictionary(self.settings.language().split('-')[0]);
    const event = new CustomEvent('yarnSetLanguage');
    event.language = languageId;
    window.dispatchEvent(event);
  };

cvertee avatar Jul 25 '21 14:07 cvertee

Can you make a pr :) potentially could help us close both this and the other issue

On Sun, 25 Jul 2021, 15:20 cvertee, @.***> wrote:

maybe something like this will work?

const languageId = e ? e.target.value : language;
if (self.settings.spellcheckEnabled())
  load_dictionary(self.settings.language().split('-')[0]);
const event = new CustomEvent('yarnSetLanguage');
event.language = languageId;
window.dispatchEvent(event);

};

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YarnSpinnerTool/YarnEditor/issues/275#issuecomment-886209192, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRWVJDAHI5WULQJEKS4ILTZQMTXANCNFSM5A4766AQ .

blurymind avatar Jul 25 '21 14:07 blurymind

Would it be possible to load the dictionary asynchronously to avoid freezing altogether?

FaultyFunctions avatar Aug 04 '21 23:08 FaultyFunctions

Its not the loading speed, but rather the library parsing the dictionary locking up yarn. I would welcome a pr if someone comes up with a way around it

On Thu, 5 Aug 2021, 00:04 Faulty, @.***> wrote:

Would it be possible to load the dictionary asynchronously to avoid freezing altogether?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YarnSpinnerTool/YarnEditor/issues/275#issuecomment-893030615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRWVNQ4WBA3HVJOOPR6ZTT3HBRRANCNFSM5A4766AQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

blurymind avatar Aug 04 '21 23:08 blurymind

closing, this was fixed a while ago. Please reopen if it persists

blurymind avatar Apr 17 '23 11:04 blurymind