Conversation
The Usage ES6 import still showed ExpressJwtRequest after it was deprecated in favor of Request. Match the TypeScript section. Closes auth0#341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the Usage ES6 import of
ExpressJwtRequestwithRequest as JWTRequest, matching the TypeScript section of the same README. Add a README assertion so a deprecatedexpress-jwtimport ofExpressJwtRequestfails the test suite.Closes #341
Provenance
ExpressJwtRequestwas deprecated for breakingtscwithstrict: true, in favor ofRequestwith optionalauth(#284). José F. Romaniello: use that type always. The TypeScript section was updated in that work and later clarified in 8.3.0 (3c1d5cf); the Usage ES6 line was missed.Decision
The Usage ES6 line imports
Request as JWTRequest, the smallest change that matches the TypeScript section already in this README. Alternative: drop the type from the JavaScript Usage import (import { expressjwt } from "express-jwt"). Can drop the type from Usage instead if that sample should stay untyped.test/readme.test.tsis a mocha assertion over the README import. Alternative: README-only, as in3c1d5cf. The regression is a one-line docs drift that already survived one deprecation pass. Can droptest/readme.test.tsif you would rather not snapshot the README.Internal tests still import the deprecated alias; they were left alone because the type remains exported.
Test plan
ExpressJwtRequestRequest as JWTRequestnpx mocha --reporter spec --require ts-node/register test/readme.test.tsfails with the old Usage line and passes with the new onenpm test: 42 passing