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

Class static initialization blocks #9281

Merged
merged 13 commits into from Sep 28, 2021
Merged

Class static initialization blocks #9281

merged 13 commits into from Sep 28, 2021

Conversation

hamishwillee
Copy link
Collaborator

https://bugzilla.mozilla.org/show_bug.cgi?id=1725689 adds support for static initialisation blocks in classes (ES13 feature). This PR adds docs - part of the work in #8606

@Rumyra I am not particularly confident of this. I don't think anything is "wrong" - I just don't think it adds anything over what the explainers from v8.dev or the 2ality.blog do. That's the problem with not being particularly confident with JavaScript - it is easy enough to paraphrase, but not do anything innovative.

Anyway, I have left in draft, so it doesn't merge until you have a chance to look at it.

I will add an interactive exmaple if you think this is otherwise OK.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2021

Preview URLs

Flaws

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/JavaScript/Reference/Classes
Title: Classes
on GitHub
Flaw count: 2

  • bad_bcd_links:
    • no explanation!
    • no explanation!

URL: /en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks
Title: Class static initialization blocks
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: javascript.classes.class_static_initialization_blocks

External URLs

URL: /en-US/docs/Web/JavaScript/Reference/Classes
Title: Classes
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Classes/static
Title: static
on GitHub


URL: /en-US/docs/Web/JavaScript/Reference/Classes/constructor
Title: constructor
on GitHub


URL: /en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks
Title: Class static initialization blocks
on GitHub

(this comment was updated 2021-09-28 03:46:32.974627)

@hamishwillee
Copy link
Collaborator Author

PS Before we are done will also cross link to the new doc from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#static_methods_and_properties

@Rumyra
Copy link
Collaborator

Rumyra commented Sep 27, 2021

Thanks so much @hamishwillee - I'm taking a look now 👍

Copy link
Collaborator

@Rumyra Rumyra left a comment

Choose a reason for hiding this comment

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

Honestly I think this is good @hamishwillee - I get it's paraphrasing, but I think that's fine.

@hamishwillee
Copy link
Collaborator Author

@himanshugarg Your note appears to have gone. But in summary you're most welcome to provide feedback on anything and everything. I will be integrating the suggestions already made and tidying this up again before submitting.

hamishwillee and others added 2 commits September 28, 2021 09:34
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
@github-actions github-actions bot added the Content:JS JavaScript docs label Sep 27, 2021
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
@himanshugarg
Copy link
Contributor

himanshugarg commented Sep 27, 2021

I don't remember commenting here, but if there was a note from me, it must have been unrelated and in error. Either way thanks for your note!


EDIT: I think you meant the other Himanshu! i.e. digi-booster

hamishwillee and others added 3 commits September 28, 2021 09:35
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
@hamishwillee hamishwillee marked this pull request as ready for review September 27, 2021 23:37
@hamishwillee hamishwillee requested a review from a team as a code owner September 27, 2021 23:37
@hamishwillee hamishwillee requested review from Rumyra and removed request for a team September 27, 2021 23:37
@hamishwillee
Copy link
Collaborator Author

@Rumyra Great - I've accepted your change. Will do the release note and interactive example separately. Ready for re-review.

I think this is "OK" as reference. I'm just disappointed that the source materials show a deeper understanding of the practical use of the feature. I've linked them though, so nothing is lost.

@digi-booster
Copy link
Contributor

I like to suggest typo fixes to you as a reader, not as a reviewer, I hope this change will not waste your time and energy in reviewing and verifying it.

hamishwillee and others added 4 commits September 28, 2021 13:44
…ialization_blocks/index.md

Co-authored-by: Himanshu <74658643+digi-booster@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Himanshu <74658643+digi-booster@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Himanshu <74658643+digi-booster@users.noreply.github.com>
…ialization_blocks/index.md

Co-authored-by: Himanshu <74658643+digi-booster@users.noreply.github.com>
@hamishwillee
Copy link
Collaborator Author

Sure, love a good typo fix :-)

@Rumyra Rumyra merged commit 2354c90 into mdn:main Sep 28, 2021
@hamishwillee hamishwillee deleted the static_init branch September 28, 2021 22:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants