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

Refactor inspector code to pass strict-null checks #250

Merged

Conversation

petebacondarwin
Copy link
Contributor

Some simple strict-null fixes but also a refactor to use react memo hooks in inspector code.

Previously the proxy server and websocket server were created in ref hooks.
But this prevented TypeScript from understanding that they were always defined when needed.
By using memo hooks we get this typing for free; and also can lean on react to handle recreating them as needed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2022

🦋 Changeset detected

Latest commit: 124ee86

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

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

Please remove the useMemo usage.

packages/wrangler/src/inspect.ts Outdated Show resolved Hide resolved
packages/wrangler/src/inspect.ts Outdated Show resolved Hide resolved
packages/wrangler/src/inspect.ts Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin merged commit 3c74a4a into cloudflare:main Jan 18, 2022
@petebacondarwin petebacondarwin deleted the strict-null-checks-inspector branch January 18, 2022 14:42
@github-actions github-actions bot mentioned this pull request Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants