Skip to content
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 VERSION const as p5.VERSION #5165

Merged
merged 3 commits into from
Aug 18, 2021

Conversation

micuat
Copy link
Member

@micuat micuat commented Apr 9, 2021

continues from #5107 and resolves #2525

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

I kept both p5.VERSION and p5.prototype.VERSION but not sure if we keep both or we just use the former so that it will never be exposed to global scope (no sketch=>sketch.VERSION in case of instance). Whichever it is, the new implementation (p5.VERSION) should have the priority as it has an advantage that it can be referenced without instantiation.

@outofambit
Copy link
Contributor

hey @micuat, just checking in on this, I'd love to get this merged soon. are you still interested in working on this?

it looks like the only thing left is a decision on the prototype vs instance question above? I think it's probably good to have both. If we only use p5.VERSION, I think that would mean it wouldn't be available in the web editor (unless you this), which i think is worth preserving. open to other opinions, too!

Oh we need docs too! I can help with that if you'd like.

@micuat
Copy link
Member Author

micuat commented Aug 17, 2021

sure! I agree that it should be accessible both ways. Do you think it still needs an edit or is ready for review? I don't think I have access to a build environment / have time to test it right now, so I appreciate if anyone can test it (and edit it if needed).

@outofambit outofambit marked this pull request as ready for review August 18, 2021 17:49
@outofambit
Copy link
Contributor

thanks @micuat! i tested locally and wrote some unit tests to be extra safe. merging now!

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.

Feature request: check p5.js "version" from code.
2 participants