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

fix: prevent dev from infinitely restarting #183

Merged
merged 2 commits into from
Jan 3, 2022

Commits on Jan 2, 2022

  1. fix: prevent dev from infinitely restarting

    In #164, we added `token` to `useWorker`'s `useEffect` array that detects when to start the server process. However, the effect itself sets `token`, so the build would inifinitely restart on every run.
    
    We could potentially fix this by using `useMemo` or something, but that's overkill for the reason we use `token` - to detect whether it's the first or subsequent time we've started the server, and what message to log to the terminal. So we introduce a ref `startedRef` to play that role, and mark it as true when we log the message the first time. This fixes the infinite loop.
    
    This bug shows how urgent it is to write tests for everything else. We'll get there.
    threepointone committed Jan 2, 2022
    Configuration menu
    Copy the full SHA
    5a5c6ee View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2022

  1. Update packages/wrangler/src/dev.tsx

    Co-authored-by: Pete Bacon Darwin <[email protected]>
    threepointone and petebacondarwin authored Jan 3, 2022
    Configuration menu
    Copy the full SHA
    b702124 View commit details
    Browse the repository at this point in the history