-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
change EventGroup.declare to string literal #14085
Conversation
because typescript supports class declarations such as `class X { public declare x: number }` , using declare has the potential to cause problems for ts parsers supporting classes declaring types. Specifically, this causes an issue with the latest version sucrase. Although the responsibility falls on the parser, it seems pertinent to just avoid this. Changing to ["declare"] is an immediate fix, while renaming it to EventGroup.declareEvent is probably a better long term change.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 54513ce:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! In addition to the comment below, you'll need to generate a change file by cloning the repo and running yarn
then yarn change
.
packages/utilities/src/EventGroup.ts
Outdated
//see https://github.com/alangpierce/sucrase/issues/545 | ||
/** Declare an event as being supported by this instance of EventGroup. */ | ||
public declare(event: string | string[]): void { | ||
public ['declare'](event: string | string[]): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend adding a short inline explanation for the use of quotes, in addition to the link. Otherwise it's not clear what the link is referring to.
Hello @ecraig12345! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@jeremy-coleman Looks like you'll need to sign the CLA before this can merge--you should have gotten a comment about that from the CLA bot when you first opened the PR, but I think it was broken for awhile. |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Potential regressions comparing to master
Perf comparison
Perf tests with no regressions
|
This pull request has been automatically marked as stale because it was marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 5 days of this comment. Thank you for your contributions to Fluent UI! |
because typescript supports class declarations such as
class X { public declare x: number }
, using declare has the potential to cause problems for ts parsers supporting classes declaring types. Specifically, this causes an issue with the latest version sucrase. Although the responsibility falls on the parser, it seems pertinent to just avoid this. Changing to ["declare"] is an immediate fix, while renaming it to EventGroup.declareEvent is probably a better long term change. See alangpierce/sucrase#545 for reference.Pull request checklist
$ yarn change
Description of changes
(give an overview)
Focus areas to test
(optional)