Skip to content

Comments

Mark "for each...in" as deprecated#10460

Merged
wbamberg merged 3 commits intomdn:mainfrom
PeteH32:patch-1
Nov 26, 2021
Merged

Mark "for each...in" as deprecated#10460
wbamberg merged 3 commits intomdn:mainfrom
PeteH32:patch-1

Conversation

@PeteH32
Copy link
Contributor

@PeteH32 PeteH32 commented Nov 11, 2021

Summary

The JavaScript Reference page still lists a now deprecated statement ("for each...in"). Rather than removing it from the list, it may be better to just add a note that it's deprecated.

This page shows that the method is deprecated:

Motivation

Supporting details

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@PeteH32 PeteH32 requested a review from a team as a code owner November 11, 2021 21:53
@PeteH32 PeteH32 requested review from sideshowbarker and removed request for a team November 11, 2021 21:53
@github-actions github-actions bot added the Content:JS JavaScript docs label Nov 11, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2021

Preview URLs

Flaws

Note! 1 document with no flaws that don't need to be listed. 🎉

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

  • macros:
    • /en-US/docs/Web/JavaScript/Reference/AsyncGeneratorFunction does not exist
    • /en-US/docs/Web/JavaScript/Reference/AsyncGenerator does not exist

URL: /en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated
Title: Warning: JavaScript 1.6's for-each-in loops are deprecated
on GitHub
Flaw count: 8

  • macros:
    • /en-US/docs/Web/JavaScript/Reference/Statements/for_each...in does not exist
    • /en-US/docs/Web/JavaScript/Reference/Statements/for_each...in does not exist
    • /en-US/docs/Web/JavaScript/Reference/Statements/for_each...in does not exist
    • /en-US/docs/Web/JavaScript/Reference/Statements/for_each...in does not exist
    • /en-US/docs/Web/JavaScript/Reference/Statements/for_each...in does not exist
    • and 3 more flaws omitted

External URLs

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

No external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated
Title: Warning: JavaScript 1.6's for-each-in loops are deprecated
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Statements/for...in
Title: for...in
on GitHub

(this comment was updated 2021-11-15 10:53:28.226013)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks for your PR!

But I think it would be better to remove this entry. We should also de-link all the broken links to this feature in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated .

It looks like this feature is removed now (in recent Firefox and Chrome, anyway). I wonder when that happened, and whether we should also remove this error page, since it won't appear any more in browsers that have removed it. @Elchi3 , do you know anything more about this?

@Elchi3
Copy link
Member

Elchi3 commented Nov 12, 2021

Yes, we should remove for each in now. The error page can go and any references to it as well. It looks like the reference page has already been deleted.

@wbamberg
Copy link
Collaborator

Thanks Florian! Sounds good to me.

@PeteH32 , please let us know if you want to make this update :).

@PeteH32
Copy link
Contributor Author

PeteH32 commented Nov 14, 2021

@wbamberg , yes, I will go ahead and update this PR with those changes.

@PeteH32 PeteH32 requested a review from wbamberg November 15, 2021 16:12
@PeteH32
Copy link
Contributor Author

PeteH32 commented Nov 15, 2021

@wbamberg , @Elchi3 ,
I made the changes you both mentioned.

  • Removed for each in from the JS Reference page
  • Removed link to page from for in page
  • Updated the page about error "for-each-in loops are deprecated" so that instead of saying "will be removed" it now says "has been removed"
    • I did not remove this error page entirely, since it is the only thing left documenting that this once did exist. I'm not sure if that is the better option, so just let me know if you want the entire page removed

@wbamberg
Copy link
Collaborator

Thank you @PeteH32 !

I think we should also delete https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated . We don't generally keep historical information on MDN.

You can delete pages using yarn content delete (https://github.com/mdn/content#deleting-a-document). You should also delete the link to it in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors.

I can't think of a good page to use as a redirect, so no need to create one.

Thanks again for your help with this!

@sideshowbarker sideshowbarker removed their request for review November 19, 2021 06:48
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thank you @PeteH32 for this fix. I'll remove the error page in a follow-up.

@wbamberg wbamberg merged commit 56cfad0 into mdn:main Nov 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 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.

4 participants