Skip to content

Refactor index.tsx (and config.ts) to pass strict-null checks#249

Merged
petebacondarwin merged 1 commit intocloudflare:mainfrom
petebacondarwin:strict-null-checks-index
Jan 20, 2022
Merged

Refactor index.tsx (and config.ts) to pass strict-null checks#249
petebacondarwin merged 1 commit intocloudflare:mainfrom
petebacondarwin:strict-null-checks-index

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

This actually slightly changes the processing of the environment configuration.
Previously there were corner cases where the configuration might just crash.
These are now handled more cleanly with more appropriate warnings.

The yargs commands have been refactored slightly to be more consistent.
Now each command that can be either in local or remote mode is structured the same way.
The config is extracted from the args, then there is an if-then-else statement that handles the local and remote cases.
This ensures that the account_id has the correct typings in remote mode as needed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 15, 2022

🦋 Changeset detected

Latest commit: d218f2e

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
Copy Markdown
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.

This is looking good, dropped a couple of notes. If you could bring back the snip comments I'd be happy to approve and land this and work on it further. thank you!

Comment thread packages/wrangler/src/config.ts Outdated
Comment thread packages/wrangler/src/index.tsx Outdated
@petebacondarwin petebacondarwin force-pushed the strict-null-checks-index branch 2 times, most recently from 07f95fd to e4855b8 Compare January 18, 2022 17:08
@petebacondarwin petebacondarwin force-pushed the strict-null-checks-index branch from e4855b8 to 6512193 Compare January 18, 2022 17:33
Comment thread packages/wrangler/src/index.tsx Outdated
Copy link
Copy Markdown
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.

approving with one last note. thanks!

Comment thread packages/wrangler/src/index.tsx Outdated
@petebacondarwin petebacondarwin force-pushed the strict-null-checks-index branch from e277a4b to 3a58042 Compare January 20, 2022 11:54
This actually slightly changes the processing of the environment configuration.
Previously there were corner cases where the configuration might just crash.
These are now handled more cleanly with more appropriate warnings.

The yargs commands have been refactored slightly to be more consistent.
Now each command that can be either in local or remote mode is structured the same way.
The `config` is extracted from the args, then there is an `if-then-else` statement that handles the local and remote cases.
This ensures that the `account_id` has the correct typings in remote mode as needed.
@petebacondarwin petebacondarwin force-pushed the strict-null-checks-index branch from 3a58042 to d218f2e Compare January 20, 2022 11:54
@petebacondarwin petebacondarwin merged commit 9769bc3 into cloudflare:main Jan 20, 2022
@github-actions github-actions bot mentioned this pull request Jan 20, 2022
@petebacondarwin petebacondarwin deleted the strict-null-checks-index branch January 20, 2022 13:05
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants