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

feat: Add `es‑to‑primitive` #38947

Merged
merged 8 commits into from Oct 17, 2019

Conversation

@ExE-Boss
Copy link
Contributor

commented Oct 7, 2019

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

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration: ljharb/es-to-primitive#44 (comment)
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should be present and it shouldn't have any additional or disabling of rules. Just content as { "extends": "dtslint/dt.json" }. If for reason the some 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.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

review?(@ljharb, @andrewbranch, @armanio123, @uniqueiniquity)

types/es-to-primitive/es2015.d.ts Show resolved Hide resolved
types/es-to-primitive/es5.d.ts Outdated Show resolved Hide resolved
types/es-to-primitive/es2015.d.ts Outdated Show resolved Hide resolved
@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics.

Let’s review the numbers, shall we?

These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to es-to-primitive with its source on master.

Comparison details 📊
Batch compilation
Type count 2022
Assignability cache size 98
Subtype cache size 0
Identity cache size 0
Language service measurements
Samples taken 20
Identifiers in tests 20
getCompletionsAtPosition
    Mean duration (ms) 85.9
    Median duration (ms) 82.2
    Mean CV 22.8%
    Worst duration (ms) 116.5
    Worst identifier ToPrimitiveES2015
getQuickInfoAtPosition
    Mean duration (ms) 82.3
    Median duration (ms) 82.2
    Mean CV 20.6%
    Worst duration (ms) 94.4
    Worst identifier ES6
System information
Node version v10.16.3
CPU count 2
CPU speed 2.294 GHz
CPU model Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
CPU Architecture x64
Memory 6.8 GiB
Platform linux
Release 4.15.0-1059-azure

If you have any questions or comments about me, you can ping @andrewbranch. Have a nice day!

@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

@ExE-Boss 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

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

@ExE-Boss 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!

types/es-to-primitive/ts3.2/es2015.d.ts Outdated Show resolved Hide resolved
types/es-to-primitive/ts3.2/es5.d.ts Outdated Show resolved Hide resolved
types/es-to-primitive/ts3.2/es-to-primitive-tests.ts Outdated Show resolved Hide resolved
Co-Authored-By: Jordan Harband <ljharb@gmail.com>
@ExE-Boss ExE-Boss force-pushed the EB-Forks:types/es-to-primitive branch from 12b629b to 8b2cd51 Oct 7, 2019
@ExE-Boss ExE-Boss force-pushed the EB-Forks:types/es-to-primitive branch 2 times, most recently from 54d12c0 to 15fcd40 Oct 10, 2019
@armanio123

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2019

@ljharb are all comments addressed and is this ready to be merged?

@@ -0,0 +1,3 @@
# This package uses tabs

This comment has been minimized.

Copy link
@armanio123

armanio123 Oct 10, 2019

Contributor

Could you please remove this file?

This comment has been minimized.

Copy link
@ExE-Boss

ExE-Boss Oct 11, 2019

Author Contributor

If I do this, then it’s very likely that someone would change tabs to spaces under me.

Also, all my DT contributions have this file, and .editorconfig is permitted by types‑publisher.

@armanio123

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2019

@ljharb I noticed that you're the package maintainer for this library. You could also place the d.ts file in your repo and ship it with the package as well if you're willing to maintain the file.

This is optional but recommended way of shipping d.ts files.

@typescript-bot typescript-bot moved this from Review to Needs Author Attention in Pull Request Status Board Oct 11, 2019
@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

@ExE-Boss One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you!

@ljharb

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

@armanio123 in no way would i ever want to do that unless there was a programatic way to ensure that it stayed in sync with the unannotated JS; without that, I think it's highly inadvisable for non-TS code to ship with first-class types.

@ljharb
ljharb approved these changes Oct 11, 2019
@ExE-Boss ExE-Boss requested a review from armanio123 Oct 11, 2019
@ExE-Boss

This comment has been minimized.

Copy link
Contributor Author

commented Oct 16, 2019

@armanio123

#39055 and #39058 have been approved by @andrewbranch because packages are still free to choose the superior tabs over the inferior spaces for indentation.

@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2019

@ExE-Boss 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.

@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2019

🔔 @armanio123 - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

Copy link
Contributor

left a comment

@ExE-Boss I have a discussion with the team about this, and we agreed the PR is ok for now. Nonetheless, we still strongly suggest to go for the defaults defined by the repo. I'm approving the PR.

@armanio123 armanio123 merged commit 439a7d5 into DefinitelyTyped:master Oct 17, 2019
2 of 3 checks passed
2 of 3 checks passed
DefinitelyTyped.BenchmarkPR Build #18955 failed
Details
DefinitelyTyped.DefinitelyTyped Build #20191017.2 succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Pull Request Status Board automation moved this from Needs Author Attention to Done Oct 17, 2019
@ExE-Boss ExE-Boss deleted the EB-Forks:types/es-to-primitive branch Oct 17, 2019
@typescript-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2019

I just published @types/es-to-primitive@1.2.0 to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.