A whole new Quick Edit in Cloudflare Workers
The Cloudflare dashboard now supports in-browser development for its Workers, enabling developers to write, edit and preview changes to their workers without having to switch between multiple environments. This feature has been achieved by embedding Microsoft's Visual Studio Code (VSCode) within the Cloudflare dashboard using an iframe. The dashboard communicates with VSCode through a MessageChannel, allowing for seamless data exchange between them. The development process is as follows: When a developer opens a worker in the Cloudflare dashboard, VSCode is loaded into an iframe within the dashboard. The worker's code is then sent to VSCode via a MessagePort. Any changes made by the developer are automatically synced back to the dashboard, which then uploads them as previews of the worker on Cloudflare's global network. This enhancement significantly improves the development workflow for Workers, offering a more integrated and efficient experience. It reduces the need for context-switching between different environments while testing or making changes to workers. The new in-browser editor also has potential future developments planned, such as adding Typescript support and integrating with external Git providers like GitHub and GitLab.
Company
Cloudflare
Date published
May 17, 2023
Author(s)
Samuel Macleod, Adam Murray
Word count
1336
Language
English
Hacker News points
6