Skip to content

Update creating addon libraries contributor docs #7800

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

Merged
merged 11 commits into from
May 14, 2025

Conversation

limzykenneth
Copy link
Member

Addresses #7798

Changes:

Update the creating addon libraries contributor docs to use the new addon API. It still does not include all the new features and nuanced details yet but that can be added later, this PR is mainly to get information up to date. I'll be updating the other contributor docs accordingly as well but in separate PRs.

};
function loadCSVAddon(p5, fn, lifecycles){

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth adding, after this, the code to register the addon?

if (typeof p5 !== undefined) {
  p5.registerAddon(loadCSVAddon);
}

We don't always do this immediately in internal addons, but if the goal is to package an addon externally, we'd probably expect this in there too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I probably should include that. I was planning to do an edit to include ESM usage as well, I think I'll do that in this round too so that there's more complete context on the design.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth adding, after this, the code to register the addon?

if (typeof p5 !== undefined) {
  p5.registerAddon(loadCSVAddon);
}

We don't always do this immediately in internal addons, but if the goal is to package an addon externally, we'd probably expect this in there too.

Yes, that should be great to include.

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @limzykenneth , the docs for the 2.0 on creating addon library looks great to me.

I was planning to do an edit to include ESM usage as well

I would love to see these as well :). thanks for your work

@limzykenneth
Copy link
Member Author

Just added an additional section for if statement, it is a bit hard to explain this part without going into too much details around ESM, bundling, etc though, hopefully this is working for now. I think it might be worth to create a separate official template starter project that new addon can fork from.

@davepagurek @perminder-17 Do have a look if you have the time.

@ksen0 ksen0 merged commit a24ef5c into processing:dev-2.0 May 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants