Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: pub workspaces #747

Open
1 task done
lishaduck opened this issue Aug 7, 2024 · 11 comments
Open
1 task done

request: pub workspaces #747

lishaduck opened this issue Aug 7, 2024 · 11 comments

Comments

@lishaduck
Copy link

lishaduck commented Aug 7, 2024

Is there an existing feature request for this?

  • I have searched the existing issues.

Command

No response

Description

Once Pub Workspaces land in stable, it would be great if Melos replaced dependency_overrides generation in favor of Pub Workspaces.
I believe this is planned, but I didn't see an issue.

Reasoning

Pub Workspaces enable a single analyzer scope, which both improves performance and reduces the maintenance burden on the Melos team.

Additional context and comments

Thanks for melos! It works great!

@spydon
Copy link
Collaborator

spydon commented Aug 7, 2024

It is indeed planned, thanks for opening an issue so that we can track it!
I'll link in the Flutter design doc for it is here too: https://flutter.dev/go/pub-workspace

@spydon
Copy link
Collaborator

spydon commented Sep 10, 2024

Related: dart-lang/pub#4376

@spydon
Copy link
Collaborator

spydon commented Sep 18, 2024

Related (globbing in workspace definition, which would make future migrations easier): dart-lang/pub#4391

@spydon spydon self-assigned this Sep 19, 2024
@Leptopoda
Copy link

I can see how globs are nice to have for this use case, but I wouldn't consider it a blocker.
I've migrated some repos to workspaces by using melos list -rp.

I'd love to use melos + workspaces sooner rather than waiting for this that isn't even such a big inconvenience.

@spydon
Copy link
Collaborator

spydon commented Nov 27, 2024

@Leptopoda I agree, it's not a blocker, possibly we could even write a simple migration script for it.

@xaethos
Copy link

xaethos commented Dec 4, 2024

Do Melos and Pub workspaces work together right now? Has anybody gotten a repo migrated by hand?

A few weeks back I took a stab at migrating a repo and couldn't get everything to work. I cannot remember for sure, but I think my blocker ultimately was the Flutter toolchain not handling Pub workspaces, though believe some Melos commands were confused by the dep overrides being elsewhere.

Is there a sense of what needs to be done for Melos and Pub workspaces to coexist?

@spydon
Copy link
Collaborator

spydon commented Dec 4, 2024

@xaethos it shouldn't be a problem for them to co-exist already afaik. With the workspaces we can simplify a lot of our code in Melos and remove the packages config from melos.yaml though, and that needs some work.

@Leptopoda
Copy link

What I have done so far:

  • remove dep overrides
  • add every package to the workspace in the root pubspec
  • change the dependency resolution for every package to "workspace"

Et voilà.
You MUST NOT use melos bootstrap as it will try to generate the overrides again. I suggest to just use dart pub get and melos for all the other commands (format, run scripts, publish, ...).

The current stable flutter version is broken for workspaces and last time I checked master it was also not working. I found 3.26.0-0.1.preto be working in some testing (just specify it in fvm) although your use case might forbid unreleased versions. A stable release should be right around the corner.

@SAGARSURI
Copy link
Contributor

finally workspace is released to stable version 3.27:

https://dart.dev/tools/pub/workspaces

@SAGARSURI
Copy link
Contributor

SAGARSURI commented Dec 12, 2024

I hope melos bootstrap will not be removed but tweaked to handle the new workspace changes.

@spydon
Copy link
Collaborator

spydon commented Dec 12, 2024

I hope melos bootstrap will not be removed but tweaked to handle the new workspace changes.

* This way we can still use `hooks` pre/post `bootstrap` command execution.

* Also the variable `MELOS_PACKAGES` might get effected which we use it in our pipeline to run test on changed packages because of this problem [fix:  melos overrides the applied filter for dependents/dependencies #675](https://github.com/invertase/melos/issues/675)

Yeah, that's true. We should keep bootstrap, but as an optional step.

I'm pretty busy currently, so if there is anyone else that would like to be assigned to this issue, give me a ping!
I don't think it is thaaat much to do, mostly removing a lot of stuff that we have in melos that is now superfluous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants