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 Javascript Types w/JSDoc #3577

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

joshistoast
Copy link

PR Summary:

Add JSDoc documentation to javascript functions and classes where applicable.

Why are these changes introduced?

JSDoc is the nest best thing to native JS types. Typing our functions means better understanding of the parameters required and what gets returned without needing to crawl the codebase.

What approach did you take?

Classes, and functions with parameters and returns get JSDoc comments.

Other considerations

Decision log

# Decision Alternatives Rationale Downsides
1

Visual impact on existing themes

No visual impact.

Testing steps/scenarios

  • Step 1

Demo links

  • Store
  • Editor

Checklist

@joshistoast joshistoast changed the title docs(jsdoc): 📝 add documentation to global.js Add Javascript Types w/JSDoc Aug 2, 2024
@joshistoast
Copy link
Author

will be adding more over next week if I have time

@thagxt
Copy link

thagxt commented Aug 3, 2024

It would be very handy to have these in all JS files, not just Global.

@joshistoast
Copy link
Author

It would be very handy to have these in all JS files, not just Global.

That's the plan

@joshistoast
Copy link
Author

Learning so much about JSDoc, and how much I dislike certain approaches to JS things in this codebase

@joshistoast
Copy link
Author

Unfortunate with how many conditional class definitions there are, references to the types are unresolved when definitions are nested in a conditional.

Might be a good way to prevent defining classes multiple times on a page without wrapping the whole thing in a conditional 🤔

@joshistoast joshistoast marked this pull request as ready for review August 13, 2024 19:31
@joshistoast
Copy link
Author

Ready for review, but not ready for merge.

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.

2 participants