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

Do some simple batch find/replace es6 conversions? #1010

Closed
zepumph opened this issue Sep 12, 2019 · 5 comments
Closed

Do some simple batch find/replace es6 conversions? #1010

zepumph opened this issue Sep 12, 2019 · 5 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Sep 12, 2019

I have spend a noticeable amount of time converting files to es6. In general this is about 5 steps. Some of these could be done across the project in a batch find replace, here are the ones I've thought of. Does this seem like something worth doing on the whole? Marking for a last minute dev meeting.

define( function( require ) {
-> define( require => {

var (\w+) = require
-> const $1 = require
@pixelzoom
Copy link
Contributor

Sure, but... why?

@jonathanolson
Copy link
Contributor

Sounds like it would save time to do it in one batch?

@zepumph
Copy link
Member Author

zepumph commented Sep 19, 2019

If all require statements were consts, it would improve the auto-import grunt task.

It also seems like energy that is never worth thinking about/spending, ever again. doing it on a file by file basis is likely X times less efficient, where X is the number of files, as it will take 30 seconds to change all usages.

30 seconds X 2744 (number of usages of @constructor) = too much time!

@Denz1994
Copy link

Discussed at dev meeting: 09/19/19

This is a time saver. @zepumph go ahead with this addition.

Taking this a bit further means enabling the no-var lint rule and auto fix the failed cases. We suspect auto-fix will change var to const/let and if it can’t fix it will leave var. @zepumph will take a go at this.

zepumph added a commit to phetsims/reactants-products-and-leftovers that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/equality-explorer-two-variables that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/balloons-and-static-electricity that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/balancing-chemical-equations that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/gene-expression-essentials that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/inverse-square-law-common that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/area-model-multiplication that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/forces-and-motion-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/least-squares-regression that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/isotopes-and-atomic-mass that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/graphing-slope-intercept that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/equality-explorer-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/energy-skate-park-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/states-of-matter-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/function-builder-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/area-model-introduction that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/molecule-shapes-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/rutherford-scattering that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/proportion-playground that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/query-string-machine that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/capacitor-lab-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/resistance-in-a-wire that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/shred that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/blast that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/brand that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/vegas that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/tambo that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/expression-exchange that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/expression-exchange that referenced this issue Sep 19, 2019
@zepumph
Copy link
Member Author

zepumph commented Sep 19, 2019

I committed the top two above. I will attempt to use the no-var to autofix over in #1012. Closing

@zepumph zepumph closed this as completed Sep 19, 2019
zepumph added a commit to phetsims/gravity-force-lab that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/utterance-queue that referenced this issue Oct 22, 2019
zepumph added a commit to phetsims/utterance-queue that referenced this issue Oct 22, 2019
jessegreenberg pushed a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
jessegreenberg pushed a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
chrisklus pushed a commit to phetsims/counting-common that referenced this issue Jun 4, 2021
zepumph added a commit to phetsims/scenery that referenced this issue Dec 15, 2021
samreid pushed a commit to phetsims/scenery-phet that referenced this issue Apr 9, 2022
samreid pushed a commit to phetsims/phet-info that referenced this issue Apr 23, 2022
marlitas pushed a commit to phetsims/scenery-phet that referenced this issue Jun 22, 2022
samreid pushed a commit to phetsims/tambo that referenced this issue Oct 28, 2022
marlitas pushed a commit to phetsims/scenery-phet that referenced this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants