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

feat: cloudflare workers repl

Open cameron-robey opened this issue 3 years ago • 4 comments
trafficstars

Introduces a repl style interface for cloudflare workers, running locally through miniflare. I think it is important that we let people know that this is running through miniflare; in this I have printed out Interactive REPL session started though Miniflare at the start of the session. Other suggestions on how to best inform people would be appreciated.

Closes https://github.com/cloudflare/wrangler2/issues/1263

cameron-robey avatar Aug 05 '22 10:08 cameron-robey

🦋 Changeset detected

Latest commit: 8ff9775ae5b7776a6cb3e7c32f38b0de0c6a2839

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

changeset-bot[bot] avatar Aug 05 '22 10:08 changeset-bot[bot]

@mrbbot - your eyes would be appreciated :)

cameron-robey avatar Aug 05 '22 10:08 cameron-robey

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2803436801/npm-package-wrangler-1620

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1620/npm-package-wrangler-1620

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2803436801/npm-package-wrangler-1620 dev path/to/script.js

github-actions[bot] avatar Aug 05 '22 10:08 github-actions[bot]

Codecov Report

Merging #1620 (8ff9775) into main (7ae059b) will decrease coverage by 0.12%. The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1620      +/-   ##
==========================================
- Coverage   82.02%   81.90%   -0.13%     
==========================================
  Files          87       90       +3     
  Lines        5815     5896      +81     
  Branches     1491     1509      +18     
==========================================
+ Hits         4770     4829      +59     
- Misses       1045     1067      +22     
Impacted Files Coverage Δ
packages/wrangler/src/repl.ts 16.66% <16.66%> (ø)
packages/wrangler/src/index.tsx 88.57% <33.33%> (-0.54%) :arrow_down:
packages/wrangler/src/pages/build.tsx 53.84% <0.00%> (-10.44%) :arrow_down:
packages/wrangler/src/pages/projects.tsx 81.15% <0.00%> (-2.43%) :arrow_down:
packages/wrangler/src/dev.tsx 82.19% <0.00%> (-0.45%) :arrow_down:
packages/wrangler/src/bundle.ts 69.36% <0.00%> (ø)
packages/wrangler/src/api/dev.ts 15.38% <0.00%> (ø)
packages/wrangler/src/pages/upload.tsx 84.76% <0.00%> (ø)
packages/wrangler/src/pages/constants.ts 100.00% <0.00%> (ø)
...angler/src/pages/functions/routes-consolidation.ts 100.00% <0.00%> (ø)
... and 4 more

codecov[bot] avatar Aug 05 '22 11:08 codecov[bot]

I think it would be nice to land this with config support (reading bindings etc)

threepointone avatar Aug 22 '22 12:08 threepointone

@cameron-robey Let me know if you are going to land this, with the config support, otherwise I will pick it up.

JacobMGEvans avatar Sep 06 '22 21:09 JacobMGEvans

Decided this is blocked until we know the exact specifics of implementation with the open source runtime.

Until then, users can use this feature directly from miniflare - documentation here: https://miniflare.dev/get-started/cli#repl

cameron-robey avatar Sep 09 '22 10:09 cameron-robey

Closing this as the repl story with the open source runtime is very unclear.

cameron-robey avatar Sep 15 '22 11:09 cameron-robey