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

No more vars in JavaScript docs #16614

Closed
65 tasks done
wbamberg opened this issue May 23, 2022 · 14 comments
Closed
65 tasks done

No more vars in JavaScript docs #16614

wbamberg opened this issue May 23, 2022 · 14 comments
Labels
Content:JS JavaScript docs

Comments

@wbamberg
Copy link
Collaborator

wbamberg commented May 23, 2022

After the Write the Docs sprint, these are all the pages in the JavaScript documentation that use var, according to my very basic script:

There are likely to be some false positives in there. Note that we should not change any code inside polyfills.

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 23, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 25, 2022
@Abhiram-Gullapalli
Copy link
Contributor

I want to take up this issue.
Just for confirmation, the issue is about changing the var variable to the alternative one for the necessary context.

@wbamberg
Copy link
Collaborator Author

I want to take up this issue. Just for confirmation, the issue is about changing the var variable to the alternative one for the necessary context.

Thank you @gullapalli9482 ! Yes (sorry I should have provided more context) exactly, this is about replacing usages of var with let or const as appropriate.

Note that our policy here is "use const where we can, let where we have to", and that we are not updating usages inside polyfills.

I don't personally mind much how many files you include in each PR, but I do recommend if possible that you include at least a few in each PR, rather than one PR per page.

@Abhiram-Gullapalli
Copy link
Contributor

Definitely 👍🏼 .

@ghost
Copy link

ghost commented Jun 22, 2022

I'm going to try clearing up any var from all of the WebAssembly documentation soon, but immediately, I'm starting with the examples repository, as most examples are copy-and-pasted from it, and link to it.

Note that there was a lot more than the basic search had caught.

@wbamberg
Copy link
Collaborator Author

Thanks @phosra . I'm sure there are more, yes, but any progress here is good!

@Josh-Cena
Copy link
Member

I've done a basic run-through and removed the false-positives from polyfills (which will be removed anyway) and intended usages. Only about 35 pages left.

@Abhiram-Gullapalli Abhiram-Gullapalli mentioned this issue Jul 4, 2022
3 tasks
@Josh-Cena Josh-Cena mentioned this issue Jul 5, 2022
3 tasks
@ghost ghost mentioned this issue Jul 7, 2022
3 tasks
@Josh-Cena Josh-Cena mentioned this issue Jul 7, 2022
3 tasks
@PrajwalBorkar PrajwalBorkar mentioned this issue Jul 7, 2022
3 tasks
This was referenced Jul 11, 2022
@Josh-Cena
Copy link
Member

As far as I can tell this seems to be done—can we do a run-down to confirm all the remaining usages are intended?

@teoli2003
Copy link
Contributor

These are the only ones with a var entry:

  • reference/functions/index.md
  • reference/errors/deprecated_expression_closures/index.md
  • reference/errors/delete_in_strict_mode/index.md
  • reference/functions/default_parameters/index.md
  • reference/strict_mode/index.md
  • reference/global_objects/error/index.md
  • reference/global_objects/eval/index.md
  • reference/statements/block/index.md
  • reference/global_objects/function/call/index.md
  • reference/statements/for/index.md
  • reference/statements/let/index.md
  • reference/statements/for...in/index.md
  • reference/statements/const/index.md
  • reference/global_objects/array/@@unscopables/index.md
  • reference/statements/function/index.md
  • reference/statements/var/index.md
  • closures/index.md
  • a_re-introduction_to_javascript/index.md
  • reference/classes/class_static_initialization_blocks/index.md
  • reference/operators/delete/index.md
  • reference/operators/this/index.md
  • reference/operators/function/index.md
  • guide/control_flow_and_error_handling/index.md
  • guide/grammar_and_types/index.md
  • guide/modules/index.md
  • guide/details_of_the_object_model/index.md

I'll check them and ask questions if I have any doubt. (We'll do this when I'm back later today)

@Josh-Cena
Copy link
Member

The details_of_the_object_model needs a total revamp so I've kept it out for now (tracked in #10301). Otherwise it's quite weird to have const/let but all other syntax totally outdated.

@ghost

This comment was marked as off-topic.

@teoli2003
Copy link
Contributor

There are other examples still, for example, I caught another in #18196

Yes, this issue is about the Web/JavaScript/ directory; we still have plenty vars to fix in Web/API, Games/, …
This is a first milestone (Yes, maintaining 10000+ pages is sometimes cumbersome).

@ghost

This comment was marked as off-topic.

@Abhiram-Gullapalli Abhiram-Gullapalli mentioned this issue Jul 22, 2022
3 tasks
@carriemacfarlane carriemacfarlane mentioned this issue Jul 23, 2022
3 tasks
@Josh-Cena
Copy link
Member

@teoli2003 did you get to do the last run-down? Judging from the recent unsuccessful attempts to change more vars to consts, I'm pretty confident it's all done.

@teoli2003
Copy link
Contributor

LGTM, let's close this one. \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

No branches or pull requests

5 participants