-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
chore(build): Bump typescript to version 3.6.4 #27
Conversation
Note: You should avoid upgrading to TS compiler 3.7.x due to: microsoft/TypeScript#33939 |
cc: @jasongrout, who is usually interested in the compiler version |
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.
LGTM, thanks!
Will this change cause builds by consumers to fail if they use an older version of TS? |
@vidartf I don't believe so - unfortunately the same is not true of 3.7.x |
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.
Would you mind merging master into this (or rebasing) and ensuring that the polling
package also gets the update?
packages/messaging/src/index.ts
Outdated
@@ -494,6 +494,7 @@ namespace MessageLoop { | |||
*/ | |||
const schedule = (() => { | |||
let ok = typeof requestAnimationFrame === 'function'; | |||
// @ts-ignore setImmediate is valid for NodeJS |
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.
Could this be resolved by adding a dev dependency on @types/node
?
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 don't think so as its not a NodeJS API "thing" (its a global "window"/"this" thing).
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.
I believe that is a different one to the "window.setImmediate" that lumino is using (the v8 JS runtime one)
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.
(IOW timers.setImmediate vs GLOBAL.setImmediate)
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.
As the typing of schedule
/unschedule
is not exported, it should suffice to ensure that it compiles, so v12 seems reasonable.
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.
no luck (after testing) and visually inspecting the NodeJS typings its declared in the "timers" module and not globally.
There is a @types/setimmediate which should work - but do you want to go down that road?
At some point you might want a "platform" test:
declare const process: any;
// @ts-ignore
export const root: any = new Function("return this;")(); // Prevent bundlers from messing with "this"
export const isBrowser: boolean = typeof window !== "undefined" && root === window;
export const isNode: boolean = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
export const isTravis: boolean = isNode && process.env != null && process.env.TRAVIS != null;
See: https://github.com/hpcc-systems/Visualization/blob/master/packages/util/src/platform.ts
And will be able to add TypeScript guards for things like setImmediate.
Its still pretty tricky getting a single TypeScript package to "just work" for Node and Browser especially when you get into fetch polyfills and the like...
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.
@GordonSmith Did you see my link to the global.d.ts
file? Also, did you add the types dependency to tsconfig.json
's types
field?
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 see that now - pushed new version with suggested change.
I just did a diff of the generated files - the only potential issue I see is the use of the "correct" types in FWIW I have not used these types in my other projects (which have had no issues with older TSC versions). |
I believe |
I don't see the package.json in the diff? And a |
(I can push these changes if you are not at a computer) |
I just rebased and see that now (I suspect I just visually missed it before as polling wasn't in my original branch). I see that "notebooks" is on 3.7.2 should this also be 3.6.4? |
What is notebooks and should it be in lumino? |
Take it up with @ellisonbg #8 (it is just some maintainer code to discuss code in the datastore package, but I would argue it should be a gist instead). |
If it (notebooks) doesn't make it into the npm tar file, then its really up to you folks (I can't say I even noticed it was there). |
it doesn't. (or rather, if it did, it would only make it into its own tar file, as each package is separated) |
8b1d732
to
634fece
Compare
Pushed changes for polling which will need a new review. |
Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
Pushed with @types/node included, the following will need re-review:
|
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.
LGTM, thanks!
Signed-off-by: Gordon Smith gordonjsmith@gmail.com