v3.0 Big Stuff!
This release involved a heavy refactor under the hood! p5-svelte should play nicely in whatever framework you use it in now - Svelte, SvelteKit, etc.
πͺ Breaking Changes
There were no breaking changes for typical use-cases but some popular bug workarounds are now obsolete and may no longer work as expected.
- Importing
p5-svelte
withinonMount
is no longer necessary for Sapper/SvelteKit. - Internal p5 classes that were not previously exposed in p5 instance mode now work as expected (i.e.
p5.Vector
)
Other new things
Debug mode
You can access the internals of your p5 instance and the available native classes that p5-svelte
automatically makes available to your project via passing the debug
prop:
<P5 {sketch} debug/>
Events on the <P5/>
component
p5-svelte
now fires off a few events you can listen to on a <P5/>
component.
ref
dispatches a reference to the DOM element target which the p5 instance mounts to.init
fires on init of the p5 project instance, dispatching a reference to that p5 project instance object.
π΅ Docs
There's now a documentation site that'll be continually built out with installation tutorials and usage examples:
https://p5-svelte.netlify.app/