Skip to content

Conversation

0xTaneja
Copy link
Contributor

@0xTaneja 0xTaneja commented Jul 7, 2025

Description

closes #2803

Select what type of change this PR introduces:

  1. Just code/docs improvement (no functional change).
  2. Bug fix (non-breaking change which fixes an issue).
  3. New feature (non-breaking change which adds functionality).
  4. Breaking change (fix or feature that would cause existing functionality to not work as expected).

Update Waspc ChangeLog and version if needed

If you did a bug fix, new feature, or breaking change, that affects waspc, make sure you satisfy the following:

  1. I updated ChangeLog.md with description of the change this PR introduces.
  2. I bumped waspc version in waspc.cabal to reflect changes I introduced, with regards to the version of the latest wasp release, if the bump was needed.

Description

Added Chrome DevTools “Automatic Workspace” support to Wasp apps in dev-mode. here is how i implemented it ,

  • I Introduced vite/devToolsJson.ts plugin that serves
    /.well-known/appspecific/com.chrome.devtools.json:
    {
      "workspace": {
        "root": "<project-root>",
        "uuid": "<cached-per-project-uuid>"
      }
    }
  • wasp-cli launcher now injects WASP_PROJECT_ROOT; if its not present plugin falls back to walking up to the
    first directory containing .wasp/ for projects started directly with Vite.
  • Cross-platform path normalisation (Windows, WSL \\wsl.localhost\<distro>\…, Docker Desktop).
  • Per-project UUID generated with crypto.randomUUID(), persisted in
    node_modules/.vite/<hash>/uuid.json.

Copy link
Member

@cprecioso cprecioso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the investigation and the implementation 🙏🙏🙏, I hope it wasn't too hard, and that it was fun too!

I have some minor style nitpicks, but I can bring those up later. First, I have two major questions, can you take a look?

@cprecioso
Copy link
Member

@0xTaneja
Okay, I reviewed your answers, and I think there's a better course of action, if you're along for the ride! (If it gets too much, just say so and we can take it over)


I think the improvements you made to the plugin are super nice! Other users of the plugin will also probably want to have them. And we'd prefer to just use the plugin as a dependency if it's so similar. So this is what I would do:

  1. Open a PR against https://github.com/ChromeDevTools/vite-plugin-devtools-json, with your improvements. Both the path normalization, and being able to set your custom root.

    They will probably not want to have any Wasp-specific environment variables in their code, that's normal! The root can be passed as an option to the plugin from the vite.config.ts.

  2. Once they merge and release that, we can directly use the plugin as a dependency in our Vite config.


Moreover, I'd like to scrap the environment variable approach, it feels like a way too wide solution for the problem we have. I'd prefer to write that variable into the vite.config.ts template and passing it as an option to the plugin. wasp start will write the internal vite.config.ts every time it starts, so we don't need to worry about this data being outdated across machines. You can edit the vite config template here and the data passed to it here.


What do you think? Is this plan nice for you? You'll also get twice the open source contributions from this 🤘

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Jul 9, 2025

@cprecioso the plan sounds perfect !! let's tag team and win this !!

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Jul 9, 2025

okay i will start editing vite config template and data associated with it

@cprecioso
Copy link
Member

oh @0xTaneja I meant to communicate that this is what you should do! this way the contirbutions are on your name!

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Jul 9, 2025

@cprecioso understood captain !! will be doing this !!

@cprecioso cprecioso added the blocked Blocked by another issue label Jul 10, 2025
@cprecioso
Copy link
Member

Linked to ChromeDevTools/vite-plugin-devtools-json#15

@0xTaneja
Copy link
Contributor Author

@cprecioso, first part is done, pr got merged for chrome devtools, now i can focus on second part of directly using the plugin as a dependency in our Vite config,
maybe you can remove blocked label from this pr now.
and also i made a pr to #2956 so maybe you can review it if not yet done.

@cprecioso cprecioso removed the blocked Blocked by another issue label Jul 15, 2025
@0xTaneja 0xTaneja force-pushed the feat/chrome-workspace-support branch from 56b9a8d to 2f20528 Compare July 17, 2025 22:09
@0xTaneja 0xTaneja force-pushed the feat/chrome-workspace-support branch from 2f20528 to ec1f3be Compare July 17, 2025 22:30
@cprecioso
Copy link
Member

@0xTaneja I see you're working on this, ping me when you're done so I can review!

@0xTaneja
Copy link
Contributor Author

@cprecioso it was already done , just forgot to add a demo video to the pr
you may review and give feedback , happy to take feedback and work on further captain if changes comes!!

2025-07-23.00-22-28.mp4

@0xTaneja
Copy link
Contributor Author

@cprecioso have you reviewed it ?? well earlier there were no conflicts but i guess after wasp new version release getting those !! will resolve it

@cprecioso
Copy link
Member

cprecioso commented Jul 28, 2025

Hey @0xTaneja, it's on my to-do list for this week, I'll ping you when I'm done 🙏
You can wait until I review to resolve the conflicts 😊

@cprecioso
Copy link
Member

Hi @0xTaneja,

First, thank you so much for this contribution and the effort you put into getting the upstream changes merged! We truly appreciate it.

After an internal discussion, we've been weighing the benefit of adding this feature by default for all users against our goal of keeping the default Wasp setup as lean as possible. However, we think this is a fantastic feature that would be perfect as a guide in our documentation! It would allow users who want this functionality to easily opt-in.

Would you be open to closing this PR and instead adding a short guide to the docs explaining how a user can add this feature themselves (e.g. in the Custom Vite Config section)? Your work is useful for the larger Vite community, and it would still be a huge and valuable contribution to the Wasp community.

Let us know what you think! Thanks again for your excellent work.

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Aug 1, 2025

@cprecioso yep captain !! i am ready to do anything for wasp community !! once this issue was started !! we worked together , though i did codes, but your guidance has always made me rethink !! and yeah i felt adding a docs about having this feature before closing it ! and i was going to add it but was just waiting for you to complete your review !! if you have any other review's as well , feel free to comment otherwise I'd be prepping up to close this issue

@cprecioso
Copy link
Member

Hey @0xTaneja, we love your enthusiasm! 🤩🐝

I realize my previous comment wasn't clear: my suggestion is to not merge the code changes from this PR. Instead, create a new documentation-only PR to share your knowledge in a documentation-only PR.

So, the next steps would be:

Your discovery and work is valuable, and adding it to the docs is a good way to share it with the community while keeping the default Wasp setup lean.

Let me know if that makes more sense, and tell me if you feel like doing that! Again, we're really grateful for your flexibility and willingness to contribute. 🤘

@cprecioso
Copy link
Member

To be clear: this was my mistake to ask you to do some work on a plugin, without thinking if we wanted to have it installed by default. I'm sorry 😔! That's why it's perfectly fine if you don't want to follow up.

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Aug 4, 2025

@cprecioso am up for it !! will close this pr soon and open a documentation only PR !!

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Aug 4, 2025

To be clear: this was my mistake to ask you to do some work on a plugin, without thinking if we wanted to have it installed by default. I'm sorry 😔! That's why it's perfectly fine if you don't want to follow up.

well no issues !! I loved to code and by you guiding me, i got my name on vite devtools repo !! it should be me thanking you to helping me up in open source !!

@0xTaneja 0xTaneja closed this Aug 4, 2025
@0xTaneja 0xTaneja deleted the feat/chrome-workspace-support branch August 4, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chrome DevTools Automatic workspaces support

2 participants