Tim Perry

Creator of HTTP Toolkit: powerful tools to debug, test & build with HTTP(S).

Passionate tech speaker, open-source contributor, and maintainer of Loglevel, Git‑Confirm and notes.

Hey Jim YT Chen, have you tried http://httptoolkit.tech/view/ruby/ as an alternative to HttpLog? It covers a very similar use case (capturing & viewing sent Ruby HTTP), but it’s got a proper UI & tools and doesn’t require any of those code changes at all. Let me know what you think :-)

Debug all HTTP(S) sent by git, npm, apt-get, or anything else

The command line is powerful, but can be hard to understand, and extremely hard to debug. Ever run a command, see it fail with a cryptic error, and have no idea why?

Better tools can help you understand what’s really going on. They can let you see inside the command you’re running to understand how it’s communicating, see what data it’s working with, and debug it in depth.

Excitingly I’ve just shipped one-click terminal interception to do exactly this with HTTP Toolkit, for HTTP and HTTPS, to show you everything your CLI is sending and ...

HTTP View is a beautiful, free & open-source HTTP inspector. This is the first release of HTTP Toolkit, and lets you intercept HTTP or HTTPS traffic with one click, explore & examine that traffic up close, and discover exactly what your code (or anybody else’s) is sending.

Want to dive right in? Download it now.

HTTP Toolkit is a project that I’ve been working on for a while, to build an open-source suite of tools for HTTP development. The goal is to intercept & examine HTTP, edit it live, analyse flows of HTTP requests to audit performance and security, and rapidly prototype HTTP cl...

Modern easy IoT with JS, Docker & Resin.io at DEVit
Fascinating breakdown of the reality of single-handed real-time DDOS defence: https://coffee-and-dreams.uk/security/2019/10/20/mitigating-a-ddos.html
Jetbrains Space: https://www.jetbrains.com/space/ Looks like Github (including things like Actions & packages) + Slack + Ji… https://twitter.com/i/web/status/1202644315299811328
As of yesterday, CSS Subgrid is now fully supported in a stable browser for the very first time:… https://twitter.com/i/web/status/1202197590307151873
I've been data mining GitHub issues & SO questions for certain projects, trying to automatically detect common topi… https://twitter.com/i/web/status/1201888691054141440
What are good general debugging principles, for narrowing down a problem, getting visibility into your system & exp… https://twitter.com/i/web/status/1201517994729447425
Add HTTP Toolkit
Avoid throwing errors if the registry is not readable

One interesting note: although this isn't available in on the web, if you're using JS in Electron then you can do this.

Using the standard HTML5 file input, you'll receive an extra path property on selected files, containing the real file path.

Full docs here: https://github.com/electron/electron/blob/master/docs/api/file-object.md

HTTP Toolkit turned up last week in the @FT! 📈 Used for an investigation into how sites like WebMD share your medi… https://twitter.com/i/web/status/1196431703574745088
Improve detection of Chrome channel variants
Detect the new chromium-based MS Edge
Hey Tech Twitter: what are your top debugging tips? I'm trying to collect some of the best general advice, for new… https://twitter.com/i/web/status/1194644922793693184
Some nice coverage of the Malpensa Airport privacy issue, from @EmmaBubola & @open_gol: https://www.open.online/2019/11/07/falla-di-sicurezza-nel-wi-fi-di-malpensa-i-dubbi-sul-tracciamento-dei-passeggeri/.
Sentry are relicensing their server infrastructure (e.g. for self-hosting) as 'eventually open-source' (BSL):… https://twitter.com/i/web/status/1192425251528937474
I have a Mac that I use for testing (2015 Macbook). I haven't updated to Catalina yet. At some point I should upda… https://twitter.com/i/web/status/1192398797357236224
Connect to the wifi at Milan MXP airport, and it sends your data to http://smartadserver.com, who then track you all… https://twitter.com/i/web/status/1192028773526441985
`npm fund`! Seems like an excellent step towards open source sustainability, nice move @npmjs 👍 https://twitter.com/koste4/status/1191810859900768256
Today's office is not so bad https://t.co/HNYFTWl7ws
Top developer productivity top! Find a watch screwdriver, and remove the mountain of collected fluff in the USB por… https://twitter.com/i/web/status/1189906301742178304
Have you read @TractionBook? If you're trying to do marketing for a product, and you're not already a marketer, I'… https://twitter.com/i/web/status/1189856118421499905
The inverse of fork(): https://github.com/whitequark/unfork I'm honestly not sure whether this is a good idea or an extremely t… https://twitter.com/i/web/status/1189495671142993921

In general, you want to use a mapped type here. These allow you to take one object type and change which keys are included, and transform their values. In your case, you want the same type as EventComposedData, but with every property made optional.

That looks something like this:

 eventData?: { [K in keyof EventComposedData]?: EventComposedData[K] }; 

In fact though, there's a predefined mapped type that does this called Partial, and you can just use that directly, instead of defining it yourself:

 eventData?: Partial<EventComposedData>; 

These are equivalent: Partial should work fine f...

When using that syntax, no, but this is possible using dynamic imports.

https://mariusschulz.com/blog/dynamic-import-expressions-in-typescript has some good TypeScript examples & explanations for dynamic imports.

In your case, this would look something like:

const config = import('config').catch((error) => { // Do something if you get an error }); 

Note that this makes loading asynchronous, so config will be a promise for the module value, not just the value itself, and the rest of your code won't automatically wait until that loading has been completed. You'll need to explicitly await ...