newspeaklanguage / newspeak

Newspeak is a live object-capability language in the Smalltalk tradition
https://newspeaklanguage.org/
Other
136 stars 11 forks source link

Fix multiple creations of HomePresenter, WorkspaceManager #47

Closed Outcue closed 3 years ago

Outcue commented 3 years ago

Multiple instances of HomePresenter and WorkspaceManager are being created.

There were two versions of the HomePresenter class and both were being created. There was also a global variable tracking the created instance that wasn't working. I instead cache the HomePresenter inside of HopscotchShell and re-use it there.

New instances of NamespacePresenter and WorkspaceManager are also created each time the links were pressed from the Home page. The was creating a lot of orphaned objects. The HomePresenter now creates and holds a NamespacePresenter and WorkspaceManager instance.

Some leaks are gone and the logic is slightly better. There are still more DOM leaks I am tracking down.

gbracha commented 3 years ago

I think this PR has real problems. I'm worried there's a bit of a misunderstanding of how the whole reactive UI is intended to work. I think the DOM leakage is a big problem, but:

a. I would like to firmly establish that this is the cause of the slowdowns.

b. We can't solve the problem just by caching. Any new UI application will be doing similar stuff, and the point of the reactive system is that users do not have to manage this explicitly.

Outcue commented 3 years ago

OK. Maybe I can figure out why the nodes are being orphaned then the new presenters are being created.