-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
add before/after preload and setup #6433
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on! The control flow of preload and setup is a little complicated because preload kicks off some asynchronous functions, so I think we want our after preload hook to get run after those complete (just to confirm, @msawired is that the behaviour that would be the most useful?)
I've added some suggestions of where to put these functions to make that happen, let me know if I can explain anything more!
src/core/main.js
Outdated
@@ -271,8 +277,11 @@ class p5 { | |||
|
|||
context.preload(); | |||
this._runIfPreloadsAreDone(); | |||
this._afterPreload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to move this one into the _runIfPreloadsAreDone method. The preload() call might start loading things over the network, and that method will get called when all of those have finished.
src/core/main.js
Outdated
} else { | ||
this._beforeSetup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this branch only gets called of the sketch doesn't have a preload function, otherwise _runIfPreloadsAreDone will trigger setup to be called. To make sure we call these regardless of what triggers _setup(), maybe we can add these calls inside of _setup itself?
Hmm, that makes sense. I've refactored the code, and I'd love to do any other changes. |
|
src/core/main.js
Outdated
@@ -295,6 +302,7 @@ class p5 { | |||
} | |||
} | |||
} | |||
this._afterPreload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this happens after _setup()
on line 299. Maybe we can move this to be before this if statement instead of after?
src/core/main.js
Outdated
@@ -231,6 +231,12 @@ class p5 { | |||
this._events.devicemotion = null; | |||
} | |||
|
|||
// before and after hooks for preload and setup | |||
this._beforePreload = function () {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably loop through and call everything in target._registeredMethods[key]
for each of these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the method above, how do we register a method to, say, afterSetup?
Would this work?
p5.on("afterSetup", function(){...})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty close! It should be p5.prototype.registerMethod('afterSetup', function() { ... })
(and unregisterMethod
to remove it later.)
I have added callRegisteredHooksFor to call all the registered before/after hooks for preload/setup. Also calling the |
src/core/main.js
Outdated
const methods = target._registeredMethods[hookName]; | ||
for (const method of methods) { | ||
if (typeof method === 'function') { | ||
method.call(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on this helper function! Just for consistency, now that we have this helper, can we update the pre/post draw hooks to use this too? Currently that happens here:
Line 486 in 63f94b0
context._registeredMethods.pre.forEach(callMethod); |
I also notice that for pre/post draw, rather than passing this
to call
, they pass context
, where it is defined as:
Line 469 in 63f94b0
const context = this._isGlobal ? window : this; |
Maybe we can do that here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the last thing we should try doing is writing a unit test to confirm that these get called when expected. Is that something you've tried before in p5? I can help point you to the right files as examples if you need
// Function to invoke registered hooks before or after events such as preload, setup, and pre/post draw. | ||
function callRegisteredHooksFor(hookName) { | ||
const target = this || p5.prototype; | ||
const context = this._isGlobal ? window : this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looks like tests are failing because this
is undefined. You might need to make this a method on p5.prototype
and then call this.callRegisteredHooksFor(...)
as a method instead of a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help!
of course I'd love to do that. I haven't had the chance to write unit tests in p5 before, so any guidance or examples you can provide would be really helpful. |
It looks like there's one test so far for Lines 5 to 33 in 63f94b0
You'd probably be adding a very similar test right after this one. I think the idea would be to make a boolean to record whether each lifecycle callback has been called yet, and register methods setting each corresponding boolean to true. Then, in your sketch, at each point in the lifecycle, you can assert that the boolean values are what you expect. e.g. for setup, it could look something like this: return new Promise((resolve) => {
let afterSetupCalled = false
p5.prototype.registerMethod('afterSetup', () => {
afterSetupCalled = true
})
myp5 = new p5(function(sketch) {
sketch.setup = () => {
assert.equal(afterSetupCalled, false)
}
sketch.draw = () => {
assert.equal(afterSetupCalled, true)
resolve()
}
})
}) ...but extended to test all the lifecycle methods. You can resolve the test promise when we've waited for the last lifecycle event (which might still be in draw, but may need to be in the second frame draw to make sure that the |
@davepagurek I have added the tests definitely need review on that. And also do i have to backup the original _registeredMethods in a var like we did |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, we also need to reset the callbacks. The reason for it is that we add them to p5.prototype
, which is like the class that all p5 instances inherit from. We make a new p5 instance in each test, but since we're essentially adding the callbacks to the class they all share, they would build up.
A maybe quicker way to do it (rather than pasting it into each test) would be to add a teardown function inside the suite
that all these tests are in, which will get run after each test. Something like:
suite('p5.prototype.registerMethod', function() {
teardown(function() {
p5.prototype._registeredMethods.init = [];
// Clear other methods here too. It's probably fine to just reset them to
// empty arrays rather than saving and restoring an initial value.
});
test('should register and call before and after "preload" hooks', function() {
// ...
});
});
test/unit/core/main.js
Outdated
sketch.setup = () => { | ||
assert.equal(afterPreloadCalled, true); | ||
}; | ||
resolve(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I think this will resolve before setup or preload gets run. Does it work to move the resolve
into sketch.setup
after your assertion?
test/unit/core/main.js
Outdated
myp5 = new p5(function(sketch) { | ||
sketch.draw = () => {}; | ||
}); | ||
assert.equal(postDrawCalled, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting a postDraw
assertion is going to be a bit tough. The reason why we can't do assertions outside of setup
and draw
here is that those actually get run first, before draw
is called: when we define draw
, we're only defining it, not calling it, and it gets called asynchronously later after preload
and setup
finish. So if we resolve
outside of it, then likely we exit before draw
gets called at all.
As an alternative: the first time draw
gets called, sketch.frameCount
will be 1. So we could do something like this, to make sure it gets run after the first draw call:
sketch.draw = () => {
if (sketch.frameCount === 2) {
assert.equal(postDrawCalled, true);
resolve();
}
};
I've implemented the recommended changes and also cleaned the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @capGoblin!
Oh actually one last thing before we merge would be to update the .md file here again with the new methods: https://github.com/processing/p5.js/blob/main/contributor_docs/creating_libraries.md Then we're good to merge! |
Great work @capGoblin! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [p5](https://togithub.com/processing/p5.js) | devDependencies | minor | [`1.7.0` -> `1.8.0`](https://renovatebot.com/diffs/npm/p5/1.7.0/1.8.0) | | [@types/p5](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/p5) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`1.7.0` -> `1.7.3`](https://renovatebot.com/diffs/npm/@types%2fp5/1.7.0/1.7.3) | --- ### Release Notes <details> <summary>processing/p5.js (p5)</summary> ### [`v1.8.0`](https://togithub.com/processing/p5.js/releases/tag/v1.8.0) [Compare Source](https://togithub.com/processing/p5.js/compare/v1.7.0...v1.8.0) <!-- Release notes generated using configuration in .github/release.yml at v1.8.0 --> #### What's Changed 🎊 ##### WebGL In this release, p5.js added some new WebGL mode tools. Filters now run in shaders for extra speed, and you can now run custom filter shaders, even on 2D canvases. You can now cut holes in shapes with `beginContour()` and apply vector masks with `beginClip()`. You can reuse shapes more efficiently with `buildGeometry()` and instanced rendering. Finally, we have also fixed a number of bugs. *- Summary written by [@​davepagurek](https://togithub.com/davepagurek) ✨* - Add support for beginContour() and endContour() in Webgl mode by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6297](https://togithub.com/processing/p5.js/pull/6297) - Fix stroke rendering when drawing to framebuffers by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6304](https://togithub.com/processing/p5.js/pull/6304) - Adds createFilterShader() and custom shader support to the webGL filter() function by [@​wong-justin](https://togithub.com/wong-justin) in [https://github.com/processing/p5.js/pull/6237](https://togithub.com/processing/p5.js/pull/6237) - Fix WebGL text not rendering when rotated 90 degrees by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6316](https://togithub.com/processing/p5.js/pull/6316) - Fix reading between nested active framebuffers by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6314](https://togithub.com/processing/p5.js/pull/6314) - Add methods to construct p5.Geometry from other p5 drawing functions by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6287](https://togithub.com/processing/p5.js/pull/6287) - Handle missing exact edge vertices in buildGeometry by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6320](https://togithub.com/processing/p5.js/pull/6320) - Fix strokes on framebuffers with different aspect ratios by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6339](https://togithub.com/processing/p5.js/pull/6339) - Fix freed geometry leaving attributes in a broken state by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6323](https://togithub.com/processing/p5.js/pull/6323) - Improve performance of line rendering by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6230](https://togithub.com/processing/p5.js/pull/6230) - Add support for webGL instancing by [@​RandomGamingDev](https://togithub.com/RandomGamingDev) in [https://github.com/processing/p5.js/pull/6276](https://togithub.com/processing/p5.js/pull/6276) - Add shaders for filter() constants, and use them by default in P2D by [@​wong-justin](https://togithub.com/wong-justin) in [https://github.com/processing/p5.js/pull/6324](https://togithub.com/processing/p5.js/pull/6324) - Fix clip() on both the main canvas and framebuffers by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6376](https://togithub.com/processing/p5.js/pull/6376) - fixed texture filtering bug in p5.Framebuffer by [@​KeyboardSounds](https://togithub.com/KeyboardSounds) in [https://github.com/processing/p5.js/pull/6420](https://togithub.com/processing/p5.js/pull/6420) - Fix clear() on framebuffers on Intel macs by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6429](https://togithub.com/processing/p5.js/pull/6429) - Fix textureMode(IMAGE) + beginShape(TESS) by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6366](https://togithub.com/processing/p5.js/pull/6366) - fixed issue [#​6440](https://togithub.com/processing/p5.js/issues/6440) by [@​Gaurav-1306](https://togithub.com/Gaurav-1306) in [https://github.com/processing/p5.js/pull/6446](https://togithub.com/processing/p5.js/pull/6446) - Erode, dilate, threshold shader filters match closer to CPU filters by [@​wong-justin](https://togithub.com/wong-justin) in [https://github.com/processing/p5.js/pull/6405](https://togithub.com/processing/p5.js/pull/6405) - Update WebGL blur filter to match CPU blur more by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6460](https://togithub.com/processing/p5.js/pull/6460) - Fix camera flipping on framebuffers between push/pop calls by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6471](https://togithub.com/processing/p5.js/pull/6471) - Setuniform by [@​Gaurav-1306](https://togithub.com/Gaurav-1306) in [https://github.com/processing/p5.js/pull/6474](https://togithub.com/processing/p5.js/pull/6474) - resolved issue [#​6399](https://togithub.com/processing/p5.js/issues/6399) by [@​Gaurav-1306](https://togithub.com/Gaurav-1306) in [https://github.com/processing/p5.js/pull/6480](https://togithub.com/processing/p5.js/pull/6480) - Auto-bind filter shaders to the filter graphic by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6482](https://togithub.com/processing/p5.js/pull/6482) - new PR for issue [#​6383](https://togithub.com/processing/p5.js/issues/6383)(Problem for diagonal) by [@​perminder-17](https://togithub.com/perminder-17) in [https://github.com/processing/p5.js/pull/6488](https://togithub.com/processing/p5.js/pull/6488) ##### Friendly Error System (FES) - Add Hindi translation to FES by [@​Ayush23Dash](https://togithub.com/Ayush23Dash) in [https://github.com/processing/p5.js/pull/6272](https://togithub.com/processing/p5.js/pull/6272) - Re-worded lines 413 and 446 of FES Developer Notes by [@​OnexiMedina](https://togithub.com/OnexiMedina) in [https://github.com/processing/p5.js/pull/6307](https://togithub.com/processing/p5.js/pull/6307) - Reference FES Contributor Docs inside FES Directory along with a diagram to understand usages of FES functions by [@​Ayush23Dash](https://togithub.com/Ayush23Dash) in [https://github.com/processing/p5.js/pull/6335](https://togithub.com/processing/p5.js/pull/6335) - Fixed typing errors in fes_core.js documentation by [@​Garima3110](https://togithub.com/Garima3110) in [https://github.com/processing/p5.js/pull/6478](https://togithub.com/processing/p5.js/pull/6478) - Update friendly_error_system.md by [@​Garima3110](https://togithub.com/Garima3110) in [https://github.com/processing/p5.js/pull/6481](https://togithub.com/processing/p5.js/pull/6481) - Update fes_reference_dev_notes.md by [@​Garima3110](https://togithub.com/Garima3110) in [https://github.com/processing/p5.js/pull/6486](https://togithub.com/processing/p5.js/pull/6486) ##### Reference Documentation Update We updated a group of p5.js Reference pages as part of 2023 Season of Docs (SoD) program, with a goal to make them more accessible and beginner-friendly. Thanks to the SoD technical writer [@​nickmcintyre](https://togithub.com/nickmcintyre) ✨. - Edit docs for math functions by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6281](https://togithub.com/processing/p5.js/pull/6281) - docs(typography): fix typos in example for textFont by [@​meezwhite](https://togithub.com/meezwhite) in [https://github.com/processing/p5.js/pull/6401](https://togithub.com/processing/p5.js/pull/6401) - Edit docs for p5.Vector by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6340](https://togithub.com/processing/p5.js/pull/6340) - Edit docs for pixels functions by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6390](https://togithub.com/processing/p5.js/pull/6390) - Edit docs for loading & displaying images by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6425](https://togithub.com/processing/p5.js/pull/6425) - Update docs for p5.Image by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6434](https://togithub.com/processing/p5.js/pull/6434) - Edit docs for p5.Font by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6453](https://togithub.com/processing/p5.js/pull/6453) - Edit docs for image by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6424](https://togithub.com/processing/p5.js/pull/6424) - Edit docs for typography load and display by [@​nickmcintyre](https://togithub.com/nickmcintyre) in [https://github.com/processing/p5.js/pull/6450](https://togithub.com/processing/p5.js/pull/6450) ##### Google Summer of Code (GSoC) 2023 Wrap up - 🌸 Added GSoC wrap up! by [@​dewanshDT](https://togithub.com/dewanshDT) in [https://github.com/processing/p5.js/pull/6403](https://togithub.com/processing/p5.js/pull/6403) - Gsoc 23 Wrapup post by [@​Ayush23Dash](https://togithub.com/Ayush23Dash) in [https://github.com/processing/p5.js/pull/6415](https://togithub.com/processing/p5.js/pull/6415) - add GSoC'23 wrapup post for Justin Wong by [@​wong-justin](https://togithub.com/wong-justin) in [https://github.com/processing/p5.js/pull/6418](https://togithub.com/processing/p5.js/pull/6418) - Create lichlyter_gsoc\_2023.md by [@​katlich112358](https://togithub.com/katlich112358) in [https://github.com/processing/p5.js/pull/6455](https://togithub.com/processing/p5.js/pull/6455) - Create munusshih_gsoc\_2023.md by [@​munusshih](https://togithub.com/munusshih) in [https://github.com/processing/p5.js/pull/6461](https://togithub.com/processing/p5.js/pull/6461) ##### Other Code Update - Ask to disable printing when print() called with no arguments by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6253](https://togithub.com/processing/p5.js/pull/6253) - fix textWidth() and textToPoints() by [@​munusshih](https://togithub.com/munusshih) in [https://github.com/processing/p5.js/pull/6184](https://togithub.com/processing/p5.js/pull/6184) - Fix issue where nf with 0 'right' parameter returns undefined in string by [@​limzykenneth](https://togithub.com/limzykenneth) in [https://github.com/processing/p5.js/pull/6291](https://togithub.com/processing/p5.js/pull/6291) - Update environment.js with fix for frameRate description by [@​quinton-ashley](https://togithub.com/quinton-ashley) in [https://github.com/processing/p5.js/pull/6269](https://togithub.com/processing/p5.js/pull/6269) - Implement clip() to shapes by [@​davepagurek](https://togithub.com/davepagurek) in [https://github.com/processing/p5.js/pull/6306](https://togithub.com/processing/p5.js/pull/6306) - Clarified workflow for contributing documentation by [@​thatguyseven](https://togithub.com/thatguyseven) in [https://github.com/processing/p5.js/pull/6312](https://togithub.com/processing/p5.js/pull/6312) - Clears MediaElement canvas at the beginning of every frame by [@​donaldzhu](https://togithub.com/donaldzhu) in [https://github.com/processing/p5.js/pull/6309](https://togithub.com/processing/p5.js/pull/6309) - Clean up gruntfile release related steps by [@​Qianqianye](https://togithub.com/Qianqianye) in [https://github.com/processing/p5.js/pull/6321](https://togithub.com/processing/p5.js/pull/6321) - fix-return-type by [@​asukaminato0721](https://togithub.com/asukaminato0721) in [https://github.com/processing/p5.js/pull/6326](https://togithub.com/processing/p5.js/pull/6326) - fix HALF_FLOAT by [@​asukaminato0721](https://togithub.com/asukaminato0721) in [https://github.com/processing/p5.js/pull/6330](https://togithub.com/processing/p5.js/pull/6330) - Added .gitattributes to Increase compatability with Window users and line endings by [@​SilasVM](https://togithub.com/SilasVM) in [https://github.com/processing/p5.js/pull/6317](https://togithub.com/processing/p5.js/pull/6317) - update all contributors setup by [@​gr2m](https://togithub.com/gr2m) in [https://github.com/processing/p5.js/pull/6341](https://togithub.com/processing/p5.js/pull/6341) - refine canvas' type by [@​asukaminato0721](https://togithub.com/asukaminato0721) in [https://github.com/processing/p5.js/pull/6328](https://togithub.com/processing/p5.js/pull/6328) - MouseEvent, WheelEvent and KeyboardEvent type by [@​asukaminato0721](https://togithub.com/asukaminato0721) in [https://github.com/processing/p5.js/pull/6329](https://togithub.com/processing/p5.js/pull/6329) - fixed-wrong-capture-size-and-freeze-issue by [@​Prateek93a](https://togithub.com/Prateek93a) in [https://github.com/processing/p5.js/pull/5159](https://togithub.com/processing/p5.js/pull/5159) - add more event type by [@​asukaminato0721](https://togithub.com/asukaminato0721) in [https://github.com/processing/p5.js/pull/6379](https://togithub.com/processing/p5.js/pull/6379) - Main by [@​j-adel](https://togithub.com/j-adel) in [https://github.com/processing/p5.js/pull/6374](https://togithub.com/processing/p5.js/pull/6374) - Update labeler Github Action by [@​stampyzfanz](https://togithub.com/stampyzfanz) in [https://github.com/processing/p5.js/pull/6395](https://togithub.com/processing/p5.js/pull/6395) - add unregisterMethod function by [@​capGoblin](https://togithub.com/capGoblin) in [https://github.com/processing/p5.js/pull/6426](https://togithub.com/processing/p5.js/pull/6426) - add before/after preload and setup by [@​capGoblin](https://togithub.com/capGoblin) in [https://github.com/processing/p5.js/pull/6433](https://togithub.com/processing/p5.js/pull/6433) - Fix: Misleading error message when NaN passed by [@​capGoblin](https://togithub.com/capGoblin) in [https://github.com/processing/p5.js/pull/6464](https://togithub.com/processing/p5.js/pull/6464) - Support pixel density on p5.Image (fixes issue [#​6114](https://togithub.com/processing/p5.js/issues/6114)) by [@​Gaurav-1306](https://togithub.com/Gaurav-1306) in [https://github.com/processing/p5.js/pull/6447](https://togithub.com/processing/p5.js/pull/6447) - Fix orphan canvas when sketch is removed before canvas creation by [@​limzykenneth](https://togithub.com/limzykenneth) in [https://github.com/processing/p5.js/pull/6355](https://togithub.com/processing/p5.js/pull/6355) ##### Other Documentation Update - Fixed GitHub capitalization typo in contributor_docs by [@​SilasVM](https://togithub.com/SilasVM) in [https://github.com/processing/p5.js/pull/6284](https://togithub.com/processing/p5.js/pull/6284) - Fixing typo in "What are issues?" by [@​snwarner22](https://togithub.com/snwarner22) in [https://github.com/processing/p5.js/pull/6288](https://togithub.com/processing/p5.js/pull/6288) - Fixed GitHub spelling in CONTRIBUTING.md by [@​SilasVM](https://togithub.com/SilasVM) in [https://github.com/processing/p5.js/pull/6295](https://togithub.com/processing/p5.js/pull/6295) - Fixed grammatical errors in contributor_guidelines.md by [@​thatguyseven](https://togithub.com/thatguyseven) in [https://github.com/processing/p5.js/pull/6296](https://togithub.com/processing/p5.js/pull/6296) - Update documentation_style_guide.md with new guideline by [@​zelf0](https://togithub.com/zelf0) in [https://github.com/processing/p5.js/pull/6334](https://togithub.com/processing/p5.js/pull/6334) - add missing code contributors to all contributors in README and `.all-contributors.rc` file by [@​gr2m](https://togithub.com/gr2m) in [https://github.com/processing/p5.js/pull/6349](https://togithub.com/processing/p5.js/pull/6349) - docs(all-contributors): remove [@​stellartux](https://togithub.com/stellartux) as requested by [@​gr2m](https://togithub.com/gr2m) in [https://github.com/processing/p5.js/pull/6368](https://togithub.com/processing/p5.js/pull/6368) - docs(src/utilities): Use `describe()` instead of `@alt` by [@​Zearin](https://togithub.com/Zearin) in [https://github.com/processing/p5.js/pull/5598](https://togithub.com/processing/p5.js/pull/5598) - Fix typo in export path to fix dev mode by [@​mykongee](https://togithub.com/mykongee) in [https://github.com/processing/p5.js/pull/6373](https://togithub.com/processing/p5.js/pull/6373) - Improve Readme for future Contributors to codebase by [@​Ayush23Dash](https://togithub.com/Ayush23Dash) in [https://github.com/processing/p5.js/pull/6260](https://togithub.com/processing/p5.js/pull/6260) - Fixed mousePressed() Example Error by [@​Utkarsh3128](https://togithub.com/Utkarsh3128) in [https://github.com/processing/p5.js/pull/6413](https://togithub.com/processing/p5.js/pull/6413) - Update README.md by [@​katlich112358](https://togithub.com/katlich112358) in [https://github.com/processing/p5.js/pull/6458](https://togithub.com/processing/p5.js/pull/6458) - Fixed typing errors in validate_params.js file's documentation by [@​Garima3110](https://togithub.com/Garima3110) in [https://github.com/processing/p5.js/pull/6473](https://togithub.com/processing/p5.js/pull/6473) - typo and unused variable from core by [@​benschac](https://togithub.com/benschac) in [https://github.com/processing/p5.js/pull/6476](https://togithub.com/processing/p5.js/pull/6476) #### New Contributors 💗 - [@​munusshih](https://togithub.com/munusshih) made their first contribution in [https://github.com/processing/p5.js/pull/6184](https://togithub.com/processing/p5.js/pull/6184) - [@​SilasVM](https://togithub.com/SilasVM) made their first contribution in [https://github.com/processing/p5.js/pull/6284](https://togithub.com/processing/p5.js/pull/6284) - [@​snwarner22](https://togithub.com/snwarner22) made their first contribution in [https://github.com/processing/p5.js/pull/6288](https://togithub.com/processing/p5.js/pull/6288) - [@​thatguyseven](https://togithub.com/thatguyseven) made their first contribution in [https://github.com/processing/p5.js/pull/6296](https://togithub.com/processing/p5.js/pull/6296) - [@​OnexiMedina](https://togithub.com/OnexiMedina) made their first contribution in [https://github.com/processing/p5.js/pull/6307](https://togithub.com/processing/p5.js/pull/6307) - [@​donaldzhu](https://togithub.com/donaldzhu) made their first contribution in [https://github.com/processing/p5.js/pull/6309](https://togithub.com/processing/p5.js/pull/6309) - [@​gr2m](https://togithub.com/gr2m) made their first contribution in [https://github.com/processing/p5.js/pull/6341](https://togithub.com/processing/p5.js/pull/6341) - [@​RandomGamingDev](https://togithub.com/RandomGamingDev) made their first contribution in [https://github.com/processing/p5.js/pull/6276](https://togithub.com/processing/p5.js/pull/6276) - [@​mykongee](https://togithub.com/mykongee) made their first contribution in [https://github.com/processing/p5.js/pull/6373](https://togithub.com/processing/p5.js/pull/6373) - [@​j-adel](https://togithub.com/j-adel) made their first contribution in [https://github.com/processing/p5.js/pull/6374](https://togithub.com/processing/p5.js/pull/6374) - [@​meezwhite](https://togithub.com/meezwhite) made their first contribution in [https://github.com/processing/p5.js/pull/6401](https://togithub.com/processing/p5.js/pull/6401) - [@​dewanshDT](https://togithub.com/dewanshDT) made their first contribution in [https://github.com/processing/p5.js/pull/6403](https://togithub.com/processing/p5.js/pull/6403) - [@​Utkarsh3128](https://togithub.com/Utkarsh3128) made their first contribution in [https://github.com/processing/p5.js/pull/6413](https://togithub.com/processing/p5.js/pull/6413) - [@​KeyboardSounds](https://togithub.com/KeyboardSounds) made their first contribution in [https://github.com/processing/p5.js/pull/6420](https://togithub.com/processing/p5.js/pull/6420) - [@​capGoblin](https://togithub.com/capGoblin) made their first contribution in [https://github.com/processing/p5.js/pull/6426](https://togithub.com/processing/p5.js/pull/6426) - [@​Gaurav-1306](https://togithub.com/Gaurav-1306) made their first contribution in [https://github.com/processing/p5.js/pull/6446](https://togithub.com/processing/p5.js/pull/6446) - [@​katlich112358](https://togithub.com/katlich112358) made their first contribution in [https://github.com/processing/p5.js/pull/6455](https://togithub.com/processing/p5.js/pull/6455) - [@​Garima3110](https://togithub.com/Garima3110) made their first contribution in [https://github.com/processing/p5.js/pull/6473](https://togithub.com/processing/p5.js/pull/6473) - [@​benschac](https://togithub.com/benschac) made their first contribution in [https://github.com/processing/p5.js/pull/6476](https://togithub.com/processing/p5.js/pull/6476) - [@​perminder-17](https://togithub.com/perminder-17) made their first contribution in [https://github.com/processing/p5.js/pull/6488](https://togithub.com/processing/p5.js/pull/6488) - [@​lakshay451](https://togithub.com/lakshay451) made their first contribution in [https://github.com/processing/p5.js/pull/6493](https://togithub.com/processing/p5.js/pull/6493) **Full Changelog**: processing/p5.js@v1.7.0...v1.8.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMS4wIiwidXBkYXRlZEluVmVyIjoiMzcuMzUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: Renovate Bot <[email protected]>
Resolves #6422
Changes:
Here I have added the missing
beforePreload
,afterPreload
,beforeSetup
andafterSetup
. @davepagurek would like to have your review on this implementation or anything wrong with this logic. Waiting for your feedback.PR Checklist
npm run lint
passes