Closed nrn closed 3 months ago
There probably needs to be some memory that a plugin has not been found. Each load attempt looks in two places, /plugins/chess/chess.js
and /plugins/chess.js
, and this is done twice. Looks as if the second place goes back to a change in plugin location 12 years ago - see SFW commit.
plugin.get()
is used in two? places to load the plugin - line 84, in renderFrom()
, and line 267, in plugin.emit()
. Once in the render, and then in the bind?
I think much of this is old problems. It has been determined that "Could not find plugin chess", but the code still goes down the path of throwing an error, and repeating the attempt to load the plugin.
Toggling the wiki
button, on or off, results in content following the item with the failed plugin to get duplicated. The number of times seems to be dependent on the number of pages in the lineup to the left of the page with the failed plugin! Very strange.
This behaviour previously existed.
Yeah, I think those will both be easier fixes after this change, but I was trying not to do too much in the one pr. Trying to load the code multiple times may even just be fixed by import()
, but I saw a potential quick fix for it while I was working on the rest of this I'll add as a suggestion.
As mentioned in the call earlier this week - I have created a branch withgit mv plugin.coffee plugin.js
as the first step. This helps retain the history of the decaffeinate step. A pre-release is available as wiki-client@0.30.0-rc.1
See https://github.com/fedwiki/wiki-client/commits/bind-error-with-mv/ for the commits in the modified branch with the initial git mv
.
The force push was to add git mv
as the first commit, and to convince this PR has been merged.
The main reason for this conversion is to contain errors on a per plugin basis so one broken/missing plugin doesn't break the rest of the page.