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 Three #18

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Update Three #18

wants to merge 10 commits into from

Conversation

ma2yama
Copy link

@ma2yama ma2yama commented Sep 27, 2024

When I tried to develop with the latest Three.js, the build failed, so I tried to fix it.

npm audit fix

npm was showing a vulnerability, so I ran npm audit fix.

up to date, audited 156 packages in 779ms

20 packages are looking for funding
  run `npm fund` for details

4 vulnerabilities (2 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

Update Three.js

Updated three.js version to 0.168.0.

npm run build-ts

Upgrading the three.js version caused an error in npm run build-ts.

  ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts
  ./src/ArMarkerControls.ts 348:16-31
  [tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts(348,17)
        TS2322: Type 'any[]' is not assignable to type 'Matrix4Tuple'.
    Target requires 16 element(s) but source may have fewer.
   @ ./src/index.ts 7:0-75 28:30-47

matrix.elements was now of type Matrix4Tuple. > 61d6906

  ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/CommonInterfaces/THREEx-interfaces.ts
  26:86-91
  [tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/CommonInterfaces/THREEx-interfaces.ts(26,87)
        TS2503: Cannot find namespace 'THREE'.

The THREE namespace was missing. > c6d6cac

  ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArToolkitContext.ts
  ./src/ArToolkitContext.ts 102:4-20
  [tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArToolkitContext.ts(102,5)
        TS2416: Property 'addEventListener' in type 'ArToolkitContext' is not assignable to the same property in base type 'IArToolkitContext'.
    Type '<T extends string>(type: T, listener: EventListener<any, T, EventDispatcher<any>>) => void' is not assignable to type '<T extends unknown>(type: T, listener: THREE.EventListener<any, T, THREE.EventDispatcher<any>>) => void'.
      Types of parameters 'type' and 'type' are incompatible.
        Type 'T' is not assignable to type 'string'.
   @ ./src/index.ts 3:0-75 24:30-47

The addEventListener, hasEventListener, and removeEventListener type arguments had to be assigned to string. > c6d6cac

  ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts
  ./src/ArMarkerControls.ts 219:27-50
  [tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts(219,28)
        TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type 'never'.
   @ ./src/index.ts 7:0-75 28:30-47

EventDispatcher required a type argument. > a6cb109

@kalwalt kalwalt self-assigned this Oct 20, 2024
@kalwalt kalwalt added the enhancement New feature or request label Oct 20, 2024
@kalwalt
Copy link
Member

kalwalt commented Oct 20, 2024

Hi @ma2yama what is the state of this PR? You should avoid make changes to the dev branch instead you should create a new branch from the dev, let say feature-upgrade-threejs, and from it send a PR. This to avoid breaking changes and conflicts.

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

Successfully merging this pull request may close these issues.

2 participants