Split the code in multiple files
I think that the inject3.js file is a bit too big, and it would certainly help a lot if you were to split the file into a couple of smaller ones. To further organize the code, we should add these new files in a separate folder.
I support this.
I think it should be split up like this:
- helpHTML becomes a separate html file
- initInner stays in the original file
- eventMouseMove, eventMouseDown, and other event related functions move to an event file.
- Functions that edit the scratch gui move to a gui file.
- Functions that are used as utilities by other functions e.g replaceVariable, injectScript, getWorkspace are added to a utils file.
Each file should be under 750 lines.
I have not really looked at the code very carefully, so I will read it more concentrated and will try to improve what you just said if I see anything else.
@BonfireScratch Also, perhaps each main feature should get it's own file. E.g Do cleanup should be in it's own file.
Will you be submitting a pull request for this?
@BonfireScratch Also, perhaps each main feature should get it's own file. E.g Do cleanup should be in it's own file.
Will you be submitting a pull request for this?
Quite possibly, yes. However, I am a bit busy with my own projects, so it may take some extra time.
A tiny note for the installing documentation: In Chrome/Chromium, you need to be on Developer Mode. Will be mentioned in my PR
Btw, I got an email notification but I can't see your comment here, did you delete it?
Btw, I got an email notification but I can't see your comment here, did you delete it?
Yea, my problem was solved when I removed and readded the extension. So far I have decoupled the HTML from the file, moved the event handling functions, and now working on accessing them from the main file.
i too agree
Btw, I got an email notification but I can't see your comment here, did you delete it?
Sometime you have to reload the page for it to show up
I have stopped development on this because the file structure is too complicated for me... Perhaps @griffpatch should fix it himself
You are right there... It is a real mash of code... I'm afraid it was very much thrown together in whatever time I had spare! - I really do need to re-architect it.
On Mon, 28 Sep 2020 at 13:48, -Bonfire- [email protected] wrote:
I have stopped development on this because the file structure is too complicated for me... Perhaps @griffpatch https://github.com/griffpatch should fix it himself
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/griffpatch/Scratch3-Dev-Tools/issues/23#issuecomment-699984509, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTM3PVPAKZQZ6PUJVLCQQLSICAYBANCNFSM4QJKB7JQ .
Since Scratch 3 Developer Tools v1.9.0 (based on the Scratch Addons addon), the code is split into multiple files. See https://github.com/ScratchAddons/ScratchAddons/tree/master/addons/editor-devtools. Note that this repo is now outdated. The source code for extension Scratch 3 Developer Tools v1.9.0 and above is automatically built with https://github.com/ScratchAddons/devtools-script based on the Scratch Addons addon, into the DevtoolsExtension repo: https://github.com/ScratchAddons/DevtoolsExtension