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

helmet: Add featurePolicy #39673

Merged

Conversation

@tomi
Copy link
Contributor

tomi commented Oct 26, 2019

feture-policy provides TS typings with it, but it doesn't export the
interface for the options parameter. We could have used conditional
typings and infered the type of the parameter, but that would have
restricted the minimum TS version to 2.8, so instead I created the
interface definition here.

Resolves #37627

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://helmetjs.github.io/docs/feature-policy/
  • 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.
feture-policy provides TS typings with it, but it doesn't export the
interface for the options parameter. We could have used conditional
typings and infered the type of the parameter, but that would have
restricted the minimum TS version to 2.8, so instead I created the
interface definition here.

Resolves #37627
@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Oct 26, 2019
@typescript-bot

This comment has been minimized.

Copy link
Contributor

typescript-bot commented Oct 26, 2019

@tomi Thank you for submitting this PR!

🔔 @cyrilschumacher @EvanHahn @BlueHatbRit @chdanielmueller - 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.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot

This comment has been minimized.

Copy link
Contributor

typescript-bot commented Oct 26, 2019

👋 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 #39673 diff
Batch compilation
Memory usage (MiB) 69.3 65.6 -5.4%
Type count 9218 9228 0%
Assignability cache size 1057 1062 0%
Language service
Samples taken 323 342 +6%
Identifiers in tests 323 342 +6%
getCompletionsAtPosition
    Mean duration (ms) 380.1 382.9 +0.7%
    Mean CV 12.0% 11.9%
    Worst duration (ms) 462.6 497.8 +7.6%
    Worst identifier setTo helmet
getQuickInfoAtPosition
    Mean duration (ms) 396.1 397.2 +0.3%
    Mean CV 12.9% 12.6% -2.1%
    Worst duration (ms) 487.8 521.5 +6.9%
    Worst identifier hpkpTest maxAge

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

Copy link
Contributor

EvanHahn left a comment

I don't exactly understand why we can't use the built-in types from the feature-policy module, but I trust that it's the case. Looks good to me.

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Check and Merge in Pull Request Status Board Oct 27, 2019
@typescript-bot

This comment has been minimized.

Copy link
Contributor

typescript-bot commented Oct 27, 2019

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@jessetrinity jessetrinity merged commit 91c3deb into DefinitelyTyped:master Oct 29, 2019
3 checks passed
3 checks passed
DefinitelyTyped.BenchmarkPR Build #20570 succeeded
Details
DefinitelyTyped.DefinitelyTyped Build #20191026.16 succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Pull Request Status Board automation moved this from Check and Merge to Done Oct 29, 2019
@typescript-bot

This comment has been minimized.

Copy link
Contributor

typescript-bot commented Oct 29, 2019

I just published @types/helmet@0.0.45 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.