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(ts): adds function type definition for ComponentOptions.middleware #4531

Merged
merged 6 commits into from
Dec 14, 2018

Conversation

hartmut-co-uk
Copy link

Better TS support: Adds function typings to ComponentOptions.middleware.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

After discussion with @kevinmarrec added type defs for functions.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@codecov-io
Copy link

codecov-io commented Dec 12, 2018

Codecov Report

Merging #4531 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #4531   +/-   ##
=======================================
  Coverage   91.07%   91.07%           
=======================================
  Files          61       61           
  Lines        2184     2184           
  Branches      528      528           
=======================================
  Hits         1989     1989           
  Misses        177      177           
  Partials       18       18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b413bc1...0127b67. Read the comment docs.

packages/vue-app/types/vue.d.ts Outdated Show resolved Hide resolved
@hartmut-co-uk hartmut-co-uk changed the title Adds function type definition for ComponentOptions.middleware fix(ts): adds function type definition for ComponentOptions.middleware Dec 12, 2018
Copy link
Contributor

@kevinmarrec kevinmarrec left a comment

Choose a reason for hiding this comment

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

@hartmut-co-uk I think that the 2 last tests can be omitted 🤔

test/types/index.ts Outdated Show resolved Hide resolved
test/types/index.ts Outdated Show resolved Hide resolved
@hartmut-co-uk
Copy link
Author

Thx @kevinmarrec
Note: after further discussion on nuxt Discord updated the PR with @kevinmarrec's final suggestion to introduce Middleware type + more elegant tests

@hartmut-co-uk hartmut-co-uk force-pushed the ts-component-options-middleware branch from 74ebef3 to 466290a Compare December 12, 2018 21:05
Copy link
Contributor

@kevinmarrec kevinmarrec left a comment

Choose a reason for hiding this comment

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

Everything is perfect to me.

PR is merge-ready !

Copy link

@galvez galvez left a comment

Choose a reason for hiding this comment

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

LGTM!

@pi0 pi0 merged commit da0a379 into nuxt:dev Dec 14, 2018
@lock
Copy link

lock bot commented Jan 13, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 13, 2019
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants