Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Split the code in multiple files #23

Open
d-siganos opened this issue Aug 24, 2020 · 12 comments
Open

Split the code in multiple files #23

d-siganos opened this issue Aug 24, 2020 · 12 comments

Comments

@d-siganos
Copy link

d-siganos commented Aug 24, 2020

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.

@Joeclinton1
Copy link

Joeclinton1 commented Aug 24, 2020

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.

@d-siganos
Copy link
Author

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.

@Joeclinton1
Copy link

Joeclinton1 commented Aug 24, 2020

@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?

@d-siganos
Copy link
Author

@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.

@d-siganos
Copy link
Author

d-siganos commented Aug 24, 2020

A tiny note for the installing documentation: In Chrome/Chromium, you need to be on Developer Mode. Will be mentioned in my PR

@Joeclinton1
Copy link

Btw, I got an email notification but I can't see your comment here, did you delete it?

@d-siganos
Copy link
Author

d-siganos commented Aug 25, 2020

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.

@Akash-Karthik
Copy link

i too agree

@scratchusernamemrtbts
Copy link

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

@d-siganos
Copy link
Author

I have stopped development on this because the file structure is too complicated for me... Perhaps @griffpatch should fix it himself

@griffpatch
Copy link
Owner

griffpatch commented Sep 28, 2020 via email

@WorldLanguages
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants