Skip to content

[2.0] Document workarounds for inter-addon dependencies #7798

Open
@davepagurek

Description

@davepagurek

Topic

There are some scenarios right now where you might want to have multiple addons in the same sketch. Sometimes, if those addons depend on each other, then the ordering of your addon script tags can affect whether or not the sketch runs correctly.

I proposed a potential API change in #7797 to help resolve these issues, but in the mean time, there are some workarounds that we can document.

  • For end users: You can rearrange your script tags to put them in the correct order. There are slightly more involved instructions for doing this in OpenProcessing since you'd have to switch your sketch to HTML mode.
  • For addon developers: @quinton-ashley had a good idea, and that is, bundling all of an addon's dependencies into one file. e.g. if your addon depends on the preload addon existing and running after your addon, then it could make sense to just include the preload code after your code in your bundled js file.

This documentation could live in https://github.com/processing/p5.js/blob/dev-2.0/contributor_docs/creating_libraries.md but also that document needs to be updated for 2.0 as well.

Metadata

Metadata

Assignees

Type

Projects

Status

Ready for Work

Status

Ready for Work

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions