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

fix(multer): export Multer class contract for consumption #46330

Merged
merged 1 commit into from
Aug 14, 2020

Conversation

peterblazejewicz
Copy link
Member

This tries to fix issue with non-exported interface of the multer class
to the creation code itself, which prevents from using instance methods
in proper way.
See #41970 for discussion of the problem.

/cc @restjohn

Thanks!

Fixes #41970

  • 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.)

@peterblazejewicz
Copy link
Member Author

I looks change is backward ccompatible. Could be useful if someone with more multer usage logged can look, thanks!

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Jul 24, 2020
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Jul 24, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 24, 2020

@peterblazejewicz Thank you for submitting this PR!

This is a live comment which I will keep updated.

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 46330,
  "author": "peterblazejewicz",
  "owners": [
    "jt000",
    "vilic",
    "DavidBR-SW",
    "mxl",
    "hyunseob",
    "PierreTchuente",
    "thrymgjol"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "38ca3e8",
  "headCommitOid": "38ca3e80a78cb126fc4d1e2f339e93c4017485c2",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-07-25T15:05:07.000Z",
  "lastCommentDate": "2020-08-14T07:52:46.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46330/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Popular",
  "anyPackageIsNew": false,
  "packages": [
    "multer"
  ],
  "files": [
    {
      "path": "types/multer/index.d.ts",
      "kind": "definition",
      "package": "multer"
    },
    {
      "path": "types/multer/multer-tests.ts",
      "kind": "test",
      "package": "multer"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-08-13T23:02:40.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 4,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @jt000 @vilic @DavidBR-SW @mxl @HyunSeob @PierreTchuente @thrymgjol — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46330 diff
Batch compilation
Memory usage (MiB) 69.3 65.7 -5.2%
Type count 10708 10708 0%
Assignability cache size 1987 1987 0%
Language service
Samples taken 109 111 +2%
Identifiers in tests 109 111 +2%
getCompletionsAtPosition
    Mean duration (ms) 352.3 356.2 +1.1%
    Mean CV 10.7% 11.3%
    Worst duration (ms) 573.6 585.3 +2.0%
    Worst identifier upload upload
getQuickInfoAtPosition
    Mean duration (ms) 353.0 355.0 +0.6%
    Mean CV 10.5% 10.5% -0.6%
    Worst duration (ms) 593.1 592.9 0.0%
    Worst identifier post post

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jul 24, 2020
@restjohn
Copy link

Nice @peterblazejewicz, thanks! I'm just curious, why an abstract class vs. an interface?

@peterblazejewicz
Copy link
Member Author

I'm just curious, why an abstract class vs. an interface?

No specific reason, IMO could be interface to be more slick.
Alas, could be more sense to have that as interface though (the module does not export the class truly,
let me redo that detail as second thought).

This tries to fix issue with non-exported interface of the multer class
to the creation code itself, which prevents from using instance methods
in proper way.

See DefinitelyTyped#41970 for discussion of the problem.

/cc @restjohn

Thanks!

Fixes DefinitelyTyped#41970
@peterblazejewicz
Copy link
Member Author

@restjohn I've redone this detail, thanks for commenting!

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Aug 3, 2020
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board Aug 3, 2020
@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner and removed Unmerged The author did not merge the PR when it was ready. labels Aug 13, 2020
@typescript-bot typescript-bot moved this from Needs Maintainer Action to Waiting for Author to Merge in New Pull Request Status Board Aug 13, 2020
@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Aug 14, 2020
@typescript-bot typescript-bot merged commit 51d3528 into DefinitelyTyped:master Aug 14, 2020
@peterblazejewicz peterblazejewicz deleted the fix/41970 branch August 14, 2020 07:56
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Aug 15, 2020
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Sep 2, 2020
…tract for consumption by @peterblazejewicz

This tries to fix issue with non-exported interface of the multer class
to the creation code itself, which prevents from using instance methods
in proper way.

See DefinitelyTyped#41970 for discussion of the problem.

/cc @restjohn

Thanks!

Fixes DefinitelyTyped#41970
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
…tract for consumption by @peterblazejewicz

This tries to fix issue with non-exported interface of the multer class
to the creation code itself, which prevents from using instance methods
in proper way.

See DefinitelyTyped#41970 for discussion of the problem.

/cc @restjohn

Thanks!

Fixes DefinitelyTyped#41970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainer Approved Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[multer@1.4] why was multer.Instance removed?
4 participants