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

BREAKING: feat(http): Request API & Middleware #1555

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
0b4940a
:construction:
LionC Aug 28, 2021
55c520e
:construction:
LionC Sep 5, 2021
c862fef
:construction:
LionC Sep 5, 2021
3a696ca
Merge remote-tracking branch 'upstream/main' into middleware-experiment
LionC Sep 7, 2021
096c99d
:rotating_light: Format and fix lint problems
LionC Sep 9, 2021
994126c
:construction:
LionC Sep 12, 2021
e1fc75a
:construction:
LionC Sep 12, 2021
fb6b4bc
Merge branch 'denoland:main' into middleware-experiment
LionC Sep 12, 2021
97d4925
:construction:
LionC Sep 19, 2021
f92a67d
Merge branch 'middleware-experiment' of github.com:LionC/deno_std int…
LionC Sep 19, 2021
f066383
:construction:
LionC Sep 19, 2021
1cbe659
Merge branch 'denoland:main' into middleware-experiment
LionC Sep 20, 2021
b5eee72
:construction:
LionC Sep 20, 2021
9291218
:construction:
LionC Sep 20, 2021
9ef07b8
:construction:
LionC Sep 20, 2021
4635971
:memo:
LionC Sep 20, 2021
af1fab2
:memo:
LionC Sep 20, 2021
0ae8fbe
:memo:
LionC Sep 20, 2021
06ea2e4
:memo:
LionC Sep 20, 2021
f038441
:memo:
LionC Sep 20, 2021
98333f7
:construction:
LionC Sep 20, 2021
ec8eeed
:recycle: Wrap Request and refactor accordingly
LionC Sep 22, 2021
03d8685
:label: :recycle: Add more typing smarts for a better DX
LionC Sep 23, 2021
8d5577c
:fire: Remove stakadd overload and adapt typees for DX
LionC Sep 25, 2021
1922743
:sparkles: Remove the need to call .handler for middleware chains and…
LionC Sep 25, 2021
d890772
:sparkles: :fire: Add parsedUrl to HttpRequest and remove redundant J…
LionC Sep 26, 2021
af545d9
:memo: Add JSDoc to HttpRequest
LionC Sep 26, 2021
bf36fe0
:sparkles: Make HttpRequest.clone re-wrap the cloned request
LionC Sep 26, 2021
8666c62
:fire: :label: Remove redundant type annotations on Request delegates…
LionC Sep 26, 2021
26f128c
:memo: Improve HttpRequest context and addContetxt JSDoc
LionC Sep 26, 2021
cd33d75
:memo: Make examples consistent and use mod imports
LionC Sep 26, 2021
6598d22
:art: Format _util/types.ts
LionC Sep 26, 2021
43b846d
:memo: Add JSDoc to the middleware module
LionC Sep 26, 2021
f1245d4
:art: Format
LionC Sep 26, 2021
e654f5e
Merge remote-tracking branch 'denoland/main' into middleware
LionC Oct 6, 2021
6200b53
Merge remote-tracking branch 'denoland/main' into middleware
LionC Oct 14, 2021
ddc3ac8
:construction:
LionC Oct 14, 2021
c043756
:construction: :memo: Draft documentation
LionC Oct 14, 2021
fac5729
:label: Improve middleware type ignores
LionC Oct 14, 2021
7129c33
:construction: :memo: Move legacy http docs to own file
LionC Oct 14, 2021
0d0c97b
Merge remote-tracking branch 'upstream/main' into middleware
LionC Oct 29, 2021
65dad7b
:construction: :memo: Work on middleware docs
LionC Nov 2, 2021
b16f9e0
:recycle: Add EmptyContext for middlewares
LionC Nov 2, 2021
37b43be
:twisted_rightwards_arrows: Merge branch 'middleware' of github.com:L…
LionC Nov 2, 2021
a162adc
:memo: Add EmptyContext to middleware docs
LionC Nov 2, 2021
f099b5f
:sparkles: Add Method enum
LionC Nov 3, 2021
2a9b044
:twisted_rightwards_arrows: Merge remote-tracking branch 'denoland/ma…
LionC Nov 3, 2021
65c4cf6
:memo: First draft of middleware docs
LionC Nov 3, 2021
abf63f2
:memo: Add chain nesting example
LionC Nov 3, 2021
ce70eeb
:sparkles: Add correct context merging to middleware types
LionC Nov 3, 2021
71de170
:memo: Add type enhancement example to docs
LionC Nov 5, 2021
5fa983f
:memo: Format middleware examples
LionC Nov 6, 2021
ff22ab9
:memo: Improve middleware doc formatting
LionC Nov 6, 2021
e328ded
:label: Make next not optional for DX middleware
LionC Nov 6, 2021
10e08fd
:memo: More work on middleware docs
LionC Nov 6, 2021
48d8aaa
:memo: Adapt docs to recent DX changes
LionC Nov 6, 2021
497013b
:fire: Remove WIP files
LionC Nov 6, 2021
0873130
:memo: Finish middleware docs
LionC Nov 7, 2021
d8658e1
:memo: Clarify handlers vs middleware
LionC Nov 7, 2021
20f1071
:memo: FIx spelling
LionC Nov 7, 2021
1654a81
:fire: Remove WIP comments
LionC Nov 7, 2021
76b4f0f
:fire: Remove compose export
LionC Nov 7, 2021
977a942
:white_check_mark: Add middleware tests
LionC Nov 7, 2021
877e3ae
:twisted_rightwards_arrows: Merge remote-tracking branch 'upstream/ma…
LionC Nov 7, 2021
76cab1f
:memo: Format
LionC Nov 7, 2021
b89c675
:art: Change test data
LionC Nov 7, 2021
399f32e
:art: Add test labels
LionC Nov 7, 2021
cb27ad3
:construction: Add PR draft
LionC Nov 7, 2021
1d758c5
:memo: Add TOC
LionC Nov 9, 2021
1f463dd
:construction: Some reordering of middleware docs
LionC Nov 9, 2021
fe0c9b3
:memo: Move Request Context section
LionC Nov 10, 2021
0ad2f51
:memo: Refactor Middleware context docs
LionC Nov 10, 2021
504601c
:memo: Work on finishing new middleware section
LionC Nov 10, 2021
39d185a
:memo: Work on middleware section
LionC Nov 10, 2021
2ce414f
Merge remote-tracking branch 'denoland/main' into middleware
LionC Nov 10, 2021
5dc9f03
:art: Format
LionC Nov 10, 2021
bdf4ffc
:label: Make handlers terminate chains
LionC Nov 10, 2021
673fcad
:memo: Adapt documentation to explain terminated chains
LionC Nov 11, 2021
2c9c1d9
:memo: Finish seocnd veriosn of docs
LionC Nov 11, 2021
eb9667e
:memo: Update middleware example
LionC Nov 11, 2021
b82773e
:memo: Fix TOC in http readme
LionC Nov 11, 2021
d2d8668
:speech_balloon: Draft PR
LionC Nov 11, 2021
15781f9
:twisted_rightwards_arrows: Merge remote-tracking branch 'denoland/ma…
LionC Nov 11, 2021
1ed536f
:memo: Another pass on doc language, add Error Handling section
LionC Nov 11, 2021
5ae1df7
:memo: Formatting and link to example file
LionC Nov 11, 2021
5d0f0d7
:memo: Update middleware JSDoc to reflect recent changes
LionC Nov 11, 2021
0495ffb
:white_check_mark: Add tests for middleware chain type safety
LionC Nov 11, 2021
c83df63
:memo: Finish PR text
LionC Nov 11, 2021
99d101f
:fire: Remove text draft files
LionC Nov 11, 2021
9a9a18d
:rotating_light: Fix docs misisng imports
LionC Nov 11, 2021
306a790
:rotating_light: Add missing assert import in JSDoc
LionC Nov 11, 2021
b2353c6
:fire: Remove empty legacy server docs
LionC Nov 11, 2021
8ccd7a3
:page_facing_up: Add copyright headers
LionC Nov 11, 2021
2149cf1
:twisted_rightwards_arrows: Merge remote-tracking branch 'upstream/ma…
LionC Nov 11, 2021
f3b816b
:white_check_mark: Update server tests for new Handler
LionC Nov 11, 2021
e15cb55
:twisted_rightwards_arrows: Merge remote-tracking branch 'upstream/ma…
LionC Nov 12, 2021
509c7f4
:fire: Remove old todo
LionC Nov 12, 2021
1bd0153
:twisted_rightwards_arrows: Merge remote-tracking branch 'denoland/ma…
LionC Dec 9, 2021
39fbe38
:twisted_rightwards_arrows: Merge branch 'middleware' of github.com:L…
LionC Dec 9, 2021
1b0641c
:art: Format
LionC Dec 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions _util/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.

export type Expand<T> = T extends Record<PropertyKey, unknown>
? T extends infer O ? { [K in keyof O]: O[K] }
: never
: T;

export type SafeOmit<From, Omits> = Omit<
From,
CommonKeysWithSameType<Omits, From>
>;

export type CommonKeys<A, B> = keyof A & keyof B;

export type CommonKeysWithSameType<T, U> = {
[K in CommonKeys<T, U>]: T[K] extends U[K] ? K : never;
}[CommonKeys<T, U>];
Loading