-
Notifications
You must be signed in to change notification settings - Fork 105
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(laboratory/preflight-script): set request headers #6378
Merged
jasonkuhrt
merged 49 commits into
main
from
feat/laboratory/preflight-script-append-headers
Jan 23, 2025
Merged
Changes from 40 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
cb800d3
feat(laboratory/preflight-sandbox): allow appending headers
jasonkuhrt fac4434
typo fix
jasonkuhrt 4084026
remove if
jasonkuhrt 0c6d465
expose headers
jasonkuhrt a21ea80
finish refactor: connected event type defs
jasonkuhrt cd12274
no substitute headers preflight script
jasonkuhrt fc2f8c9
embrace headers limitation for now
jasonkuhrt b5f21b0
no type-encoding of passthrough
jasonkuhrt e24df4d
fix
jasonkuhrt fbe7eee
mention todo
jasonkuhrt 998c566
make noop cases debuggable
jasonkuhrt 28b8bbb
kit json decode safe
jasonkuhrt 557bc4e
wip
jasonkuhrt 6db0e1c
Merge branch 'main' into feat/laboratory/preflight-script-append-headers
jasonkuhrt 52222f0
wip
jasonkuhrt 1212fc8
Revert "wip"
jasonkuhrt c890264
Revert "wip"
jasonkuhrt 04a96fd
work
jasonkuhrt 0b79e9f
simplify
jasonkuhrt 09f15c6
refactor
jasonkuhrt e3c253b
use const
jasonkuhrt 15b7666
use const
jasonkuhrt 2622f99
reduce diff
jasonkuhrt 525cb4e
refactor
jasonkuhrt 3541df7
untodo
jasonkuhrt dfce1c4
explicit string
jasonkuhrt c8a62a4
remove unused code
jasonkuhrt 231f7ad
Merge branch 'main' into feat/laboratory/preflight-script-append-headers
jasonkuhrt 8f36d86
use existing json module
jasonkuhrt f806027
fix: json primitive value
jasonkuhrt a9dbd2a
move jsdoc
jasonkuhrt 51290a6
no issue
jasonkuhrt 9c13ef6
explain merge strategy
jasonkuhrt 14329fc
tweak jsdoc
jasonkuhrt 4e0d1df
tweak jsdoc
jasonkuhrt c963e46
Merge branch 'main' into feat/laboratory/preflight-script-append-headers
jasonkuhrt 960714e
lint
jasonkuhrt f2e2ba8
test todos
jasonkuhrt e3692b8
first test
jasonkuhrt 285bf4d
found bug
jasonkuhrt d6bf9ad
lint
jasonkuhrt 51308fb
refactor
jasonkuhrt 8c3606a
finish tests
jasonkuhrt 8e949f6
refactor
jasonkuhrt 07b24e8
changelog
jasonkuhrt 9ccb39f
docs
jasonkuhrt 5061b30
no only
jasonkuhrt 6f42223
todo done
jasonkuhrt 8c75db9
Merge branch 'main' into feat/laboratory/preflight-script-append-headers
jasonkuhrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const tryOr = <$PrimaryResult, $FallbackResult>( | ||
fn: () => $PrimaryResult, | ||
fallback: () => $FallbackResult, | ||
): $PrimaryResult | $FallbackResult => { | ||
try { | ||
return fn(); | ||
} catch { | ||
return fallback(); | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line import/no-self-import | ||
export * as Kit from './index'; | ||
|
||
export * from './never'; | ||
export * from './types/headers'; | ||
export * from './helpers'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* This case is impossible. | ||
* If it happens, then that means there is a bug in our code. | ||
*/ | ||
export const neverCase = (value: never): never => { | ||
never({ type: 'case', value }); | ||
}; | ||
|
||
/** | ||
* This code cannot be reached. | ||
* If it is reached, then that means there is a bug in our code. | ||
*/ | ||
export const never: (context?: object) => never = context => { | ||
throw new Error(`Something that should be impossible happened`, { cause: context }); | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
export namespace Headers { | ||
export type Encoded = [name: string, value: string][]; | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you like this pattern I can apply it consistently elsewhere now or later.