workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

React-free hotkeys implementation

Open RamIdeas opened this issue 1 year ago • 2 comments

What this PR solves / how to test

Implements a React-free hotkeys implementation.

You can see both the implementations below – the React-free version with the --x-dev-env flag and the React/ink version with the flag:

image

I started with a simpler implementation in the first commit but felt a higher-level API would allow for most consistency for other commands wanting to use hotkeys. The instructions printing logic has been moved inside the API and provides each handler with a printInstructions function if the handler wishes to reprint them.

UPDATE: The instructions box now floats at the bottom (by making Wrangler's Logger and Miniflare's Log classes aware of a possible bottom float string). See image below for what it looks like now (note the worker logs are now above the instructions box):

image

Author has addressed the following

  • Tests
    • [ ] TODO (before merge)
    • [x] Included
    • [ ] Not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • [ ] I don't know
    • [ ] Required / Maybe required
    • [x] Not required because: hotkeys not currently tested with e2e
  • Changeset (Changeset guidelines)
    • [ ] TODO (before merge)
    • [x] Included
    • [ ] Not necessary because:
  • Public documentation
    • [ ] TODO (before merge)
    • [ ] Cloudflare docs PR(s):
    • [x] Not necessary because: experimental

RamIdeas avatar Jun 25 '24 23:06 RamIdeas

🦋 Changeset detected

Latest commit: 1887c45b97e3306fa488c778d206759674687bc7

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

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers 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

changeset-bot[bot] avatar Jun 25 '24 23:06 changeset-bot[bot]

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-wrangler-6149

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6149/npm-package-wrangler-6149

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-wrangler-6149 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-create-cloudflare-6149 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-cloudflare-kv-asset-handler-6149
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-miniflare-6149
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-cloudflare-pages-shared-6149
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9763657552/npm-package-cloudflare-vitest-pool-workers-6149

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240620.0
workerd 1.20240701.0 1.20240701.0
workerd --version 1.20240701.0 2024-07-01

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

github-actions[bot] avatar Jun 25 '24 23:06 github-actions[bot]