Skip to content

feat(node): v13#40927

Merged
andrewbranch merged 2 commits intoDefinitelyTyped:masterfrom
SimonSchick:feat/node-v13
Dec 23, 2019
Merged

feat(node): v13#40927
andrewbranch merged 2 commits intoDefinitelyTyped:masterfrom
SimonSchick:feat/node-v13

Conversation

@SimonSchick
Copy link
Contributor

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V13.md#13.1.0
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

This ended up being quite a large PR and I want some feedback on if we can proceed with this or if this needs to be broken down further.

General list of changes:

  • Changed constants to be re-exported in constants module to avoid duplication.
  • BREAKING: Removed various es2015, 16, 17 shims (requires es2018 lib now).
  • Various type restrictions in API that could be considered breaking changes.
  • Aliased various global interface into NodeJS namespace.
  • Scheduling in cluster
  • Use of unique symbol
  • Removal of redundant interfaces
  • BREAKING: Replaced global EventEmitter class with interface as it's purely virtual and only there for global declarations.
    • This required various updates in other package since they sometimes used extends EventEmitter or extends NodeJS.EventEmitter.

Retry of #40438

@SimonSchick SimonSchick requested a review from horiuchi as a code owner December 9, 2019 21:08
@typescript-bot typescript-bot added New Definition This PR creates a new definition package. Popular package This PR affects a popular package (as counted by NPM download counts). The Travis CI build failed labels Dec 9, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 9, 2019

@SimonSchick Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 9, 2019

@SimonSchick The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@SimonSchick
Copy link
Contributor Author

@orta or anyone else, can you mark this as actually passing, the parallel npm install keeps breaking and it's incredibly frustrating.

@SimonSchick
Copy link
Contributor Author

@Flarna for another round, nothing has really changed.

@Flarna
Copy link
Contributor

Flarna commented Dec 10, 2019

Some dgram and customRequire test are missing in node12 folder. Also the #40912 merged a few minutes is missing.

@SimonSchick
Copy link
Contributor Author

Hnnng.

@SimonSchick
Copy link
Contributor Author

@Flarna can you elaborate on what is missing exactly?

@SimonSchick
Copy link
Contributor Author

The dgram changes are not applicable since these are v13 specific.

@SimonSchick
Copy link
Contributor Author

@Flarna can you perhaps make a PR against my branch, my head is spinning a little 😛

@SimonSchick
Copy link
Contributor Author

Nvm I think I got it together now.

@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 10, 2019

@SimonSchick The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

declare module "module" {
export = NodeJS.Module;
import { URL } from "url";
interface Module extends NodeJS.Module {}
Copy link
Contributor

@Flarna Flarna Dec 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the move of Module causes problems in one of my applications.
I augment Module with internals but I'm not able to adapt it in a way compatible to your changes:

declare namespace NodeJS {
  interface ModuleCache {
    [resolvedModulePath: string]: NodeModule;
  }
  namespace Module {
    function _load(request: string, parent: NodeModule | undefined, isMain?: boolean): any;
    function _resolveFilename(request: string, parent: NodeModule | undefined): string;
    var _cache: ModuleCache;
  }
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm able to adapt my code by moving the augmentation into module "module" and change from import Module = require("module"); to import { Module } from "module";

declare module "module" {
  namespace Module {
    function _load(request: string, parent: NodeModule | undefined, isMain?: boolean): any;
    function _resolveFilename(request: string, parent: NodeModule | undefined): string;
    var _cache: NodeJS.ModuleCache;
  }
} 

@typescript-bot
Copy link
Contributor

@SimonSchick I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues.

@SimonSchick
Copy link
Contributor Author

@rbuckton plss

@typescript-bot
Copy link
Contributor

@SimonSchick The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 17, 2019

@SimonSchick The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@SimonSchick
Copy link
Contributor Author

No idea what the deal with the build failure with parse is, it worked a week ago and I have made no further changes there.

@typescript-bot typescript-bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Dec 17, 2019
@typescript-bot
Copy link
Contributor

I just published @types/mongoose@3.8.38 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/node@12.12.22 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/node-red@0.20.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/node-resque@5.5.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/nw.js@0.13.9 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/parse@2.10.4 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/pigpio@1.2.2 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/pino@5.15.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/yargs@13.0.4 to npm.

@SimonSchick
Copy link
Contributor Author

SimonSchick commented Dec 23, 2019

Some other PRs had been merged since my last push, namely #41170 (cc @yahehe) and #41029 (cc @TooTallNate).
These changes might be lost for the v12 typings and have to be re-applied in the v12 folder accordingly.

I tried to avoid this by constantly rebasing but didn't have the time in the last couple days.

@andrewbranch
Copy link
Member

@SimonSchick I’ll be around until ~3 PM PST today—if you need to do a time-sensitive update, ping me and I’ll prioritize it.

@SimonSchick
Copy link
Contributor Author

@andrewbranch not until after christmas, if you have the time I suggest you simply apply the 2 commits manually/directly to the v12 folder, should be ~5-10min of work.

@andrewbranch
Copy link
Member

There’s quite a long backlog of PRs to get through today, so I probably won’t get around to that. Trying to knock it down as low as I can before taking the next two days off.

@SimonSchick
Copy link
Contributor Author

@andrewbranch nope, only PRs that affected node are:

1d9e9b1590 [@types/node] Add missing `method` property to `http.ClientRequest` (#41029)
46370cf94a Fix node/crypto.verify return type to boolean from Buffer (#41170)

@andrewbranch
Copy link
Member

Sorry, I meant that I have a long backlog of PRs to review across all of DT 😄

@SimonSchick
Copy link
Contributor Author

Ah ok :)

@orgads
Copy link
Contributor

orgads commented Oct 27, 2020

@SimonSchick Is the removal of SymbolConstructor.observable in globals.d.ts intentional? It was added in #26034 and moved to v12 in this change, removing support on node 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Definition This PR creates a new definition package. Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants