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

Convert to ES6 #372

Open
2 of 4 tasks
sashadev-sky opened this issue Aug 1, 2019 · 12 comments · Fixed by #512
Open
2 of 4 tasks

Convert to ES6 #372

sashadev-sky opened this issue Aug 1, 2019 · 12 comments · Fixed by #512

Comments

@sashadev-sky
Copy link
Member

sashadev-sky commented Aug 1, 2019

we want to start moving towards ES6 implementation.

  • RequireJS/Browserify (past suggestions)
  • ES version upgrade
  • Rollup like Leaflet?

would significantly improve everyone's development experience enough to outweigh the cost of implementing it. The leaflet library itself is already completely transformed for ES6 use.

Checklist:

  • method creation syntax

ES5

radiansToDegrees: function(angle) {
  return angle * 180 / Math.PI;
},

ES6

radiansToDegrees(angle) {
  return angle * 180 / Math.PI;
}
  • arrow functions

  • variables - get rid of var use let and const instead

  • string interpolation

ES5

confirmDeletes: function(n) {
    const humanized = n === 1 ? 'image' : 'images';

    return window.confirm(
      'Are you sure? ' + n + ' ' + humanized + ' will be permanently deleted from the map.'
    );
},

ES6

confirmDeletes: function(n) {
    const humanized = n === 1 ? 'image' : 'images';

    return window.confirm(
      `Are you sure? ${n} ${humanized} will be permanently deleted from the map.`
    );
},
@sashadev-sky
Copy link
Member Author

@rexagod , how shall we do this?

@rexagod
Copy link
Member

rexagod commented Aug 13, 2019

I was thinking something like this would make sense after we're at little or no pending PRs, since we could get all that merged code refactored all in one big scoop, rather than rebasing every PR to fit this standard.

What do you think?

@sashadev-sky
Copy link
Member Author

+1

I actually created milestones for version 1 release: https://github.com/publiclab/Leaflet.DistortableImage/milestone/3

I think we are getting there now that the distortion bugs are gone! I guess this is something we would want to add to that list. also adding your matcher project and the dynamic keymapper. let me know your thoughts!

@sashadev-sky sashadev-sky added this to the Version 1.0.0 Release milestone Aug 14, 2019
@rexagod
Copy link
Member

rexagod commented Aug 14, 2019

Sounds good! Let's get these milestones done! 🙌

@rexagod
Copy link
Member

rexagod commented Aug 14, 2019

Will return back here once those are done.

@rexagod rexagod self-assigned this Aug 15, 2019
@sashadev-sky
Copy link
Member Author

I am going to start formulating a checklist in the PR description of thinks we can rewrite in ES6 (not exhaustive just as they come to mind) @rexagod

@jywarren
Copy link
Member

Just adding a 👍 ❤️ to this and especially to the browserify or other means of require() part of this, which I feel could be done first, as that could also include some filter steps like... uglify or whatever, easing the transition. Getting away from concatenation seems very worthwhile!

This would set us up for some EXTREMELY powerful new tools like https://github.com/publiclab/matcher-core/issues/1 - and seems like a reasonable chunk to bite off from the broader ES6 upgrade?

sashadev-sky added a commit that referenced this issue Feb 6, 2020
* ADD: Webpack module bundler

Up to this point, we have been writing old ES5.
This change introduces Webpack, Webpack development server, Babel...
From now on, we will be able to write modern JavaScript.

Resolves #372

* UPDATE: README "Contributing" section

"Contributing" section updated to show project setup with Webpack.

* ADD: Webpack config file documentation

The documentation for the Webpack configuration file can be found in
WEBPACK.md

* ADD: "npm run build" to travis.yml

* ADD: leaflet.distortableimage.js to git tracker

Added to resolve merge conflict.

* UPDATE: Webpack.md

Fixed redundant spaces and a grammar issue.

* UPDATE: Project configuration files

Changes:
 - Add npm build script to pre-commit task
 - Remove redundant Grunt's "default" task
 - Empty line to .gitignore
 - Move vendor.css to load before our css
 - Change WDS port from 3000 to 8080
 - Update README.md

* ADD: "watch" Grunt task to run tests on change

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update WEBPACK.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* v0.12.6 🚀🚀🚀

* FIX: Karma tests coverage

Karma configuration modified to generate the coverage folder inside of
the working directory and without PhantomJS subfolder.

Minor change: browserlist update to include browsers with the usage >
0.2%

Resolves #537

* Rebase the branch

Co-authored-by: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>
@sashadev-sky sashadev-sky reopened this Apr 5, 2020
sashadev-sky added a commit that referenced this issue Apr 13, 2020
* ADD: Webpack module bundler

Up to this point, we have been writing old ES5.
This change introduces Webpack, Webpack development server, Babel...
From now on, we will be able to write modern JavaScript.

Resolves #372

* UPDATE: README "Contributing" section

"Contributing" section updated to show project setup with Webpack.

* ADD: Webpack config file documentation

The documentation for the Webpack configuration file can be found in
WEBPACK.md

* ADD: "npm run build" to travis.yml

* ADD: leaflet.distortableimage.js to git tracker

Added to resolve merge conflict.

* UPDATE: Webpack.md

Fixed redundant spaces and a grammar issue.

* UPDATE: Project configuration files

Changes:
 - Add npm build script to pre-commit task
 - Remove redundant Grunt's "default" task
 - Empty line to .gitignore
 - Move vendor.css to load before our css
 - Change WDS port from 3000 to 8080
 - Update README.md

* ADD: "watch" Grunt task to run tests on change

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update WEBPACK.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* v0.12.6 🚀🚀🚀

* FIX: Karma tests coverage

Karma configuration modified to generate the coverage folder inside of
the working directory and without PhantomJS subfolder.

Minor change: browserlist update to include browsers with the usage >
0.2%

Resolves #537

* Rebase the branch

Co-authored-by: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>
sashadev-sky added a commit to carlo-ev/Leaflet.DistortableImage that referenced this issue Apr 14, 2020
…liclab#512)

* ADD: Webpack module bundler

Up to this point, we have been writing old ES5.
This change introduces Webpack, Webpack development server, Babel...
From now on, we will be able to write modern JavaScript.

Resolves publiclab#372

* UPDATE: README "Contributing" section

"Contributing" section updated to show project setup with Webpack.

* ADD: Webpack config file documentation

The documentation for the Webpack configuration file can be found in
WEBPACK.md

* ADD: "npm run build" to travis.yml

* ADD: leaflet.distortableimage.js to git tracker

Added to resolve merge conflict.

* UPDATE: Webpack.md

Fixed redundant spaces and a grammar issue.

* UPDATE: Project configuration files

Changes:
 - Add npm build script to pre-commit task
 - Remove redundant Grunt's "default" task
 - Empty line to .gitignore
 - Move vendor.css to load before our css
 - Change WDS port from 3000 to 8080
 - Update README.md

* ADD: "watch" Grunt task to run tests on change

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update WEBPACK.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* Update README.md

Co-Authored-By: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>

* v0.12.6 🚀🚀🚀

* FIX: Karma tests coverage

Karma configuration modified to generate the coverage folder inside of
the working directory and without PhantomJS subfolder.

Minor change: browserlist update to include browsers with the usage >
0.2%

Resolves publiclab#537

* Rebase the branch

Co-authored-by: Sasha Boginsky <41092741+sashadev-sky@users.noreply.github.com>
@jywarren
Copy link
Member

jywarren commented Oct 1, 2022

@publiclab/maintainers possibly this contains some more FTOs, or could be mostly complete?

@TildaDares
Copy link
Member

@jywarren I created a few issues like this #1037 to update the method creation syntax to ES6.

@Ranecodes
Copy link
Contributor

Hello @TildaDares , I saw that some tasks here are yet to be completed. Please can I be assigned to work on the arrow functions or method creation syntax?

@jywarren
Copy link
Member

Hi @Ranecodes -- take a look at this issue to find some! Thank you! #1086 (comment)

@Ranecodes
Copy link
Contributor

Hi @Ranecodes -- take a look at this issue to find some! Thank you! #1086 (comment)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants