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

Math: move to es6 classes #18863

Closed
wants to merge 3 commits into from
Closed

Math: move to es6 classes #18863

wants to merge 3 commits into from

Conversation

DefinitelyMaybe
Copy link
Contributor

@DefinitelyMaybe DefinitelyMaybe commented Mar 11, 2020

Hi all.
This pull relates to #11552 #17425

I've been working on sorting the maths scripts into ES6 classes. It's close but needs some help.
My local dev website runs all of the code just fine however:

  • "geometry / terrain /raycast" example has had a noticeable performance hit
  • "camera / array" example fails silently...
  • various WebGLProgram warnings (i.e. fakepath() ... pow(f, e) ... negative f values)

I also tried to work my way through some of the unit tests but le brain died at that point.

Going to have a look at the other folders as there may be some easier candidates for ES6 transformation.

update:
mrdoob's comment on let/const
Blocking dependencies

@looeee looeee mentioned this pull request Mar 11, 2020
@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 11, 2020

Going to have a look at the other folders as there may be some easier candidates for ES6 transformation.

FYI: The class migration has been paused for now. So it might be better to wait until it's clear when this task moves on. Otherwise there will be a lot of open PRs which getting merge conflicts over time.

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 13, 2020

BTW: 23 units test fail with your change (which is definitely an issue).

@DefinitelyMaybe
Copy link
Contributor Author

most definitely. I had a quick look at the tests and there were things like 'x not found on undefined'. not sure how I got there by changing the syntax. I made the PR in case someone wanted to look into before I get back to it. My thinking atm is that one of the other folders might be easier... if at first you don't succeed, right?

@DefinitelyMaybe
Copy link
Contributor Author

FYI: The class migration has been paused for now.

Hey, quick question, which discussion(s) are you referencing?

@donmccurdy
Copy link
Collaborator

See #6419 (comment). We cannot migrate any classes that are extended by files in examples/js, yet, at least. I'm not sure if that means all conversions are paused, or if there are other considerations here.

@looeee
Copy link
Collaborator

looeee commented Mar 17, 2020

@Mugen87 there's no reason to pause all class conversions. Why don't we move ahead with classes that are not extended in the examples? The box geometries have been converted to classes for a few months now without issue.

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 17, 2020

I'm not sure it's just about the examples directory. Any class could be derived by user level code and I don't know how @mrdoob feels about this topic in context of backwards compatibility.

Side note: Introducing classes does not mean introducing other ES6 features like let/const. According to #17276 (comment), the migration should only be focused on classes. #18912 does honor this right now. To make changes more stable, I think it's more safe to do things step by step. Besides, related PRs should not have failing unit tests.

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 8, 2020

Closing due to failing unit tests, merge conflicts and wrong example code (the PR modularized files in the examples/js directory).

@Mugen87 Mugen87 closed this Apr 8, 2020
@DefinitelyMaybe
Copy link
Contributor Author

good. your turn @Mugen87

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

Successfully merging this pull request may close these issues.

4 participants