-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split contents of dom.js among four(4) files #7316
Conversation
Hey @SilasVM, what errors did you get when running |
What you've got now looks good to me!
Currently the dom module is imported here, which we'll need to modify: Lines 42 to 43 in 39aab83
Other modules that we've refactored now export a function that gets called to set it up, e.g.: Lines 39 to 40 in 39aab83
So we'll probably want to do that here too, following a similar pattern to other modules, which register an addon in their exported setup function, and then structure the implementation files like addons where we add properties to the |
Thank you for taking a look and giving me the suggestion to modify app.js @davepagurek! Currently I'm getting a lot of errors surrounding the DOM module. Some are saying "should be function" and it seems some of the methods aren't returning output as they should. I modified app.js which reduced the amount of errors I was getting.] from 7 files and 93 failed tests to 5 files and 48 tests failed. When running This is my output when running it on my pr fork after updating app.js, and the first screenshot in this comment is a more detailed look into what's failing: I'm going to continue testing things out by modifying app.js, but I wanted to at least share what I've got so far. |
…o adapt to refactored dom.js file. Also renamed non-class files to use lower case snake case file names.
@SilasVM For the linter error, please run |
Thank you @limzykenneth, the error was cleared.
These are the remaining error spots from More detailed looks at the first 3 files: |
CI tests are passing so that's fine for now, those failing are visual tests so probably related to some threshold we can tweak later. |
Fixed indentation on affected lines. Co-authored-by: Kenneth Lim <hello@limzykenneth.com>
Removed redundant code in app.js. Co-authored-by: Kenneth Lim <hello@limzykenneth.com>
Amended capitalization of DOM to dom. Co-authored-by: Kenneth Lim <hello@limzykenneth.com>
@limzykenneth, when I was implementing your requests, I noticed the following files have this unnecessary line of code: I removed the line in each of the 4 files, ran |
Yes these are not typically necessary with the new module syntax. |
@SilasVM Looks good. Thanks! |
Thank you @limzykenneth and @Qianqianye for this opportunity and your assistance throughout! |
Resolves #7308
Changes:
Distributed the code within dom.js, across dom.js, p5.Element.js, p5.MediaElements.js, and p5.File.js.
Specific details of the split are detailed in Proposal #7308.
I've had trouble running the
npm test
command. I was unable to run it on a clean branch, so I don't think this is a direct indication of any issues with my changes. Please let me know if there's an alternate form of testing for this branchI was also unsure of how to modify lines 13-19 of each file.
Screenshots of the change:
PR Checklist
npm run lint
passesPlease let me know your thoughts @limzykenneth.