-
Notifications
You must be signed in to change notification settings - Fork 2k
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
upgrade nodejs to 18.17.0 #15899
upgrade nodejs to 18.17.0 #15899
Conversation
53468f4
to
584c32d
Compare
don't merge |
Will it break compatibility? |
no, but we need to merged with editor upgrade, that maight break compatibility |
package.json
Outdated
@@ -10,6 +10,7 @@ | |||
"module": "index.js", | |||
"scripts": { | |||
"server": "http-server . -p 8002 -o playground/index.html", | |||
"preinstall": "node ./scripts/detect-npm-version.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
if (window.DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === 'function') { | ||
DeviceMotionEvent.requestPermission().then((response) => { | ||
// NOTE: since TS 4.4, requestPermission is not defined in class DeviceMotionEvent, this should be a breaking change in TS. | ||
if (window.DeviceMotionEvent && typeof (DeviceMotionEvent as any).requestPermission === 'function') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the comment mean? As it just convert it to any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means there is a breaking change between TS 4.3 and TS 4.4
DeviceMotionEvent
is defined differently in both version, so we can only convert DeviceMotionEvent
as any to access the requestPermission
property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is not defined in DeviceMotionEvent
, just make it as any
can fix the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, requestPermission
is a safari-specific method of DeviceMotionEvent, not a web standard method, so it's not defined in TS standard dom lib since 4.4 in lib.dom.d.ts
but as a cross-platform engine, we still need to keep this broswer compability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What i confused is the comment. Why need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the comment, maybe this would help understanding
99cb40d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. It is more clear. But how do you know it is a bug of lib.dom.d.ts
or it is already removed in the specification, and some web platforms may remove the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is the release note of TS 4.4, the breaking change list here https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#libdts-changes-for-typescript-44
it should be a breaking change, not a bug
some web platforms may remove the function
the declaration of requestPermission
is only removed in TS 4.4 lib.dom.d.ts
.
and some web platforms actually didn't remove it, they just never support this interface, so our implementation here need to check whether requestPermission
is defined before we use it
fix compile-native-ts fix type fix eslint fix node version on native-binding test native ci fix eslint fix jest version upgrade ts-jest fix reduce EXPECTED_CAPACITY update ccbuidl Revert "test native ci" This reverts commit 795c8c6. # Conflicts: # scripts/native-pack-tool/package-lock.json
# Conflicts: # package.json
@PPpro ❗ There was an error during the execution of the tasks. Please check the logs for more details. |
Re: #15895
Changelog
deps PR
Continuous Integration
This pull request:
Compatibility Check
This pull request: