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

Refactor/index load #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johnwildauer
Copy link

Refactor index.js to utilize the class/extends js syntax over the older inherit syntax. Also updated the load.js to use a new THREE.TextureLoader over the depreciated Three.ImageUtils.

What kind of change does this PR introduce? (check at least one)

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Code style update
  • Refactor (refactoring or adding test which isn't a fix or add a feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Did you test your solution?

  • I lightly tested it in one browser
  • I deeply tested it in several browsers
  • I wrote tests around it (unit tests, integration tests, E2E tests)

Problem Description

Index.js was using ES5 inherits syntax.

Load.js was using THREE.ImageUtils, which has been depreciated.

Solution Description

Refactored TextGeometry in index.js to use the class/extends syntax (ES6 vs ES5). Refactoring allows for one less dependency.

Updating Load.js avoids using depreciated THREE.js ImageUtils.

Side Effects, Risks, Impact

I found no side effects or changes in testing, other than no longer getting a warning about using the now depreciated THREE.ImageUtils when running the npm test scripts.

  • N/A

Aditional comments:

Ran into this when I was playing around with updating THREE.js to a newer version in the dependencies. However, I decided against that for now (it looks like there is other discussion about whether or not to depend on three from within this package). Doing this change allows using the latest version of THREE (r128), otherwise, updating THREE results in the following error.

"Uncaught TypeError: Class constructor BufferGeometry cannot be invoked without 'new'"

Not sure if updating the dependencies is a priority (I left it out of this PR), but this would hopefully help speed line that process while doing nothing detrimental in the meantime.

Thanks for all your work on this! Only learned about MSDF a short while ago, and it's been fun playing around with it.

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.

2 participants