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

Update L.DomUtil method creation to ES6 syntax #629

Closed
6 tasks
sashadev-sky opened this issue Apr 25, 2020 · 13 comments · Fixed by #703
Closed
6 tasks

Update L.DomUtil method creation to ES6 syntax #629

sashadev-sky opened this issue Apr 25, 2020 · 13 comments · Fixed by #703

Comments

@sashadev-sky
Copy link
Member

First Time?

This is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

The problem

We just added support for ES6 in our library, and would like to start transitioning our code to use this syntax.

Let's update the method creation syntax in the src/util/DomUtil.js file from ES5 to ES6.

Solution

Where to find the relevant lines of code:

For the 5 functions in src/util/DomUtil.js, remove the function keyword and attach the method arguments to the method name instead.

Here is an example of how this will look for a different method. These ones should follow suit:

ES5

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

ES6

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

Thanks!!

Step by Step

  • Claim this issue with a comment here, below, and ask any clarifying questions you need
  • Fork the repository and set it up locally following the main repo README instructions https://github.com/publiclab/Leaflet.DistortableImage
  • Create a new feature branch with a unique name descriptive to the issue
  • Try to fix the issue following the steps above, but even before you're done, you can:
    commit your changes to your branch and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • Reference this issue in your pull request body
  • Once you submit your pull request, if there's an additional checklist provided for getting it merged, get those boxes checked off. Either way, mention me @sashadev-sky for a review.

Please keep us updated

💬⏰ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!

If this happens to you, don't sweat it! Grab another open issue.

💬 Get help

If you need any help - here are some options:

@sashadev-sky sashadev-sky changed the title Update L.DomUtili method creation to ES6 syntax Update L.DomUtil method creation to ES6 syntax Apr 25, 2020
@sashadev-sky
Copy link
Member Author

assigning @olunusib!

@olunusib
Copy link

@sashadev-sky review pull request

@roshan0708
Copy link

Can I still contribute to the issue? @sashadev-sky

@sashadev-sky
Copy link
Member Author

@roshan0708 it's available now, if you're still interested I will assign you!

@McZenith
Copy link
Contributor

I am interested @sashadev-sky...

@sashadev-sky
Copy link
Member Author

@McZenith ok since we're not sure @roshan0708 still wants to contribute (been a few months) im assigning you :)

@McZenith
Copy link
Contributor

Thank you... I'm exited

@McZenith
Copy link
Contributor

McZenith commented Jul 18, 2020

Hi! I initially started working on the issue with a wrong start command... I did npm install instead of npm run set up so I had to delete the first PR and now that I seem to have get the set up right I am still getting another error without even touching the code at all...

This is what I got from npm run setup, I need help ...
` ✔ Should return the center when the outline of the image is a rectangle
18 07 2020 13:25:50.470:WARN [PhantomJS 2.1.1 (Linux x86_64)]: Disconnected (1 times), because no message in 40000 ms.
PhantomJS 2.1.1 (Linux x86_64) ERROR
Disconnected, because no message in 40000 ms.

Finished in 46.392 secs / 2.519 secs @ 13:25:50 GMT+0100 (West Africa Standard Time)

Warning: Task "karma:development:start" failed. Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! leaflet-distortableimage@0.17.7 build: cross-env NODE_ENV=production grunt build
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the leaflet-distortableimage@0.17.7 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mczenith/.npm/_logs/2020-07-18T12_25_50_719Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! leaflet-distortableimage@0.17.7 setup: npm i && npm i leaflet --no-save && npm run build
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the leaflet-distortableimage@0.17.7 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mczenith/.npm/_logs/2020-07-18T12_25_50_921Z-debug.log
`

@sashadev-sky

@sashadev-sky
Copy link
Member Author

@McZenith Feel free to open up a new PR. Also, disregard what I said earlier about the dist file. You will not need one committed, just the src/util/DomUtil.js file with the updates.

For future knowledge, if you commit something by mistake there are many different ways to undo the changes and it is almost never the right answer to close the PR and start a new one from scratch. So instead just ask on the PR for help.

@sashadev-sky
Copy link
Member Author

@McZenith also are you running the commands locally on your computer or through an online platform?

@McZenith
Copy link
Contributor

McZenith commented Jul 25, 2020

Hi @sashadev-sky I'm running it locally.

Thanks for the comment I really appreciate I'm actually new to open source contribution.

@sashadev-sky
Copy link
Member Author

@McZenith I just merged an update into the main branch that might resolve this for you. Can you pull it down and try again?

@McZenith
Copy link
Contributor

Thank you @sashadev-sky! I'm excited, more than ever.

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