RFC/Spec: wrangler init
with flag --from-dash
#1623
Replies: 9 comments 21 replies
-
Thanks for the spec @JacobMGEvans. I'm in favor of your proposal. If we are going to split the implementation into two steps, then let's ensure that we don't advertise the feature until it's ready, or clearly mark it as experimental. Thank you |
Beta Was this translation helpful? Give feedback.
-
👍🏻 I think this looks good! +1 |
Beta Was this translation helpful? Give feedback.
-
@JacobMGEvans could you please add one more deliverable to this project: let's make this Wrangler feature easily discoverable by modifying the Dash UI to promote this feature when visiting projects that have been deployed only via the Dash. (We'll likely need to identify these projects first, or maybe we can show the info/prompt only in the dash editor? We can work with our design folks to determine the best way to surface this.) Thank you |
Beta Was this translation helpful? Give feedback.
-
@IgorMinar @JacobMGEvans i chatted with design about surfacing this feature as well as the UX/workflow implications for using |
Beta Was this translation helpful? Give feedback.
-
As part of the Dash UI work related to this, I'm wondering if there's any way for the Dash to know via the API that a specific worker has been migrated to wrangler (for e.g. making the code on Dash read-only)? |
Beta Was this translation helpful? Give feedback.
-
@IgorMinar / @JacobMGEvans / @lrapoport-cf - Have we spoken to customers to see why they use the Cloudflare dash for developing their workers? It's all well and good for us to want them to use the software we're developing, but I wonder if there aren't external factors keeping folks on the dash (like overzealous IT teams blocking npm, for example). |
Beta Was this translation helpful? Give feedback.
-
A couple questions that came up in the meeting today:
Thinking about it, making this a toggle would solve the problem, I think—the UI could enable the lockdown toggle, which would reduce the possibility of edits to the code in the dashboard between running |
Beta Was this translation helpful? Give feedback.
-
This assumes that a single user is working on something. Imagine a team, where one engineer set things up, and maybe didn't inform their team or even left. Any action should be reversible, but if there are consequences we should create friction in reversing it and make sure the consequences are clear. I 100% agree people shouldn't be going back and forth, and it's not the recommended path, and has the potential to create issues. But if we warned someone and they still want to do it, we need to let them. |
Beta Was this translation helpful? Give feedback.
-
@lrapoport-cf and I talked about this earlier, and to summarise some of the conclusions:
|
Beta Was this translation helpful? Give feedback.
-
Why should we do
wrangler init --from-dash
?Furthering the discussion from #1346, we want to provide a bridge from the dashboard where previously it was easy to get up and going with a new Worker. Now we want to encourage the user to an improved developer experience with the CLI and their local developer ecosystem. Since the goal is for the user to develop locally we want to be sure this is a one-time initialization process and not a way to develop Workers simultaneously in the dashboard and local machine.
Solution
The idea of working off the
wrangler pull
discussion is to leverage work already done withwrangler init
creating a flag that can be used--from-dash
(that can be bikeshedded). The flag would have an input that would allow targeting a Worker that would utilize the source code for the initialization of the project, eventually including the Configurations of the Worker to be generated as well; I think this should be done in phases, getting the Worker source code project initialization first. The idea is to focus on the "migration" from the dashboard to the local development ecosystem leveraging the DX of Wrangler, meaning there will be safeguards necessary to prevent "synchronizing" behaviors from dash to and from local. Part of the benefit ofwrangler init
being utilized for this bridging is two-foldNotes:
Additional discussion: #1346 (comment)
More details: #1623 (reply in thread)
init
the project multiple times if into a new project each time, but cannotinit
into the same project more than once.init
from dash, you will be prompted to login; no new design elements needed for this.worker-1
migrated to local dev environment and then published will rewriteworker-1
)Concerns:
As previously mentioned avoid any quasi-source control or quasi-source storage patterns or behaviors. This is another primary reason for moving away from
wrangler pull
and making sure safeguards are in place to make it a one-off usage. Tangentially related corrupting existing projects could be a problem which is an additional reason to make this a one-off command for initialization of a project locally from the dashboard.Alternatives:
wrangler pull
was suggested RFC:wrangler pull <name>
(and alternatives) #1346 now my main concern with this was source control & storage confusion,wrangler pull -> git pull and the dashboard would seem like where the source is "stored" much like GitHub. We would also not have all the benefits of leveraging
wrangler init
features directly.Phases of work:
wrangler.toml
)Beta Was this translation helpful? Give feedback.
All reactions