Skip to content

Further modernize class definitions#991

Merged
EzraBrooks merged 2 commits intodevelopfrom
modernize-class-definitions
Nov 5, 2025
Merged

Further modernize class definitions#991
EzraBrooks merged 2 commits intodevelopfrom
modernize-class-definitions

Conversation

@EzraBrooks
Copy link
Copy Markdown
Contributor

@EzraBrooks EzraBrooks commented Nov 4, 2025

Two major cleanups:

  • Destructure options objects in the class constructor signature to make defaults clearer
  • Add missing class member declarations for members that are assigned in the constructor but not declared. This will be required when moving to TypeScript and has made the type inference better when working in the JS code in the meantime.

This is not a breaking change, it just changes some syntactic sugar and explicitly declares some things that were previously implicitly declared!

Copy link
Copy Markdown
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Looks good, but it's a breaking change, right? Did you intend this to go in before or after the 2.0.0 cutoff?

@EzraBrooks
Copy link
Copy Markdown
Contributor Author

I don't think there's any API break here, the signature of the constructors remains the same to customers, it's just destructuring it inline.

@EzraBrooks EzraBrooks force-pushed the align-indentation-in-rest-of-app-with-core branch from 4b93f21 to fd5a261 Compare November 5, 2025 15:19
Base automatically changed from align-indentation-in-rest-of-app-with-core to develop November 5, 2025 15:31
@EzraBrooks EzraBrooks force-pushed the modernize-class-definitions branch from 15619d7 to d0cb2c7 Compare November 5, 2025 15:33
@EzraBrooks

This comment was marked as resolved.

These will be required to move to TypeScript. Also, bonus,
it looks like the TypeScript compiler is already able to
reasonably infer the types of these thanks to other work
we've already done.
@EzraBrooks EzraBrooks force-pushed the modernize-class-definitions branch from d0cb2c7 to db22582 Compare November 5, 2025 15:47
@EzraBrooks EzraBrooks marked this pull request as ready for review November 5, 2025 15:48
@EzraBrooks EzraBrooks requested review from bjsowa and sea-bass November 5, 2025 15:48
@EzraBrooks
Copy link
Copy Markdown
Contributor Author

I plan on incrementally adding JSDoc type annotations to these members in future PRs, thus allowing these files to just be in-place renamed from .js to .ts and ✨ magically be TypeScript ✨.

Copy link
Copy Markdown
Member

@bjsowa bjsowa left a comment

Choose a reason for hiding this comment

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

There are still a few formatting changes but I don't see a problem with including them

@EzraBrooks EzraBrooks merged commit 5e3119d into develop Nov 5, 2025
3 checks passed
@EzraBrooks EzraBrooks deleted the modernize-class-definitions branch November 5, 2025 15:55
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.

3 participants