-
Notifications
You must be signed in to change notification settings - Fork 252
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
Explore the usage of manganis for assets #759
Comments
I decided to take a look into this. To add support for Following the example for cli-support, I was able to get images working. Other assets also work, but will require a bit more done to get things integrated in a clean fashion. Though, I am not sure on what you meant with the ways we can integrate Apologies if I'm deeply misunderstanding what you meant. |
Sounds cool. So here is what I had in mind:
I still think we should start with 1. … Which would enable users to use it, identify gaps in trunk, and give some insight on how we could improve with 2. and 3.. |
For 3, you are right that we can only include a single version. Things will very likely break when a change in https://github.com/DioxusLabs/collect-assets/tree/master/common is introduced. That being said, at the time of writing I still am not sure how this is to be integrated with 1, and 2. So I think I am going to leave those for someone else to tackle for the time being. |
You're right, I missed that point. Judging from Which basically rules out 1 and 2 … and I am not a big fan of adding more complexity to the existing Maybe we should take a different route then: create a hook system inside of trunk. Based on a trait. Kind of like a plugin concept, but starting slowly. I guess the current build hooks could be one implementation of this. I also do recall the general idea of having "trunk plugins" (through WASM or maybe even something like |
I agree, though Take tailwind for example. If a user has We could use meta information (MetadataAsset), as a workaround, but I don't like that solution either, as it could result in hard to track bugs when using it. Issue is, Point is, there is quite a bit of different cases to consider. It is also worth noting the I also think the idea of "trunk plugins" will be better for our use case. |
Fair points. And that's why the issue has a title of "Explore" not "Implement" 😁 … I think it worth exploring and coming up with either a plan, or a list of point to report back to the folks of manganis.
I think that's a way forward in any case. It's "just" some work. And it's independent of this issue. The idea was to use manganis as a driver for this effort. |
What about a minimal subset of magnanis that just works with files and doesn't need to effect the HTML directly at all? Trunk could just support
It would be very useful to have a list of what trunk would need to make it easier to support manganis (A separate CLI? More granular optimization options for each file?). It was developed with dioxus in mind, but I would like to make it easy to use it the broader ecosystem 🙂 |
That would be a better way to implement initial support of
I would be happy to provide a list of things that would help 😄 , but first I would like to attempt implementing proper support for a minimal subset of A CLI could be useful in general, in a case a user is trying to hook things up themselves with scripts (in As I also said above, I will start by attempting to implement support for a subset of |
Here's a few things I would like to note. Issues:
Possible Changes:Things mentioned here shouldn't be needed for a minimal implementation, but would improve flexibility overall. I'm pretty sure some of the things I mentioned are unreasonable or would be considered nit's, and feel free to ignore them if that is the case.
There is also this PR being worked on DioxusLabs/manganis#26 which brings quite a bit of changes to how things work, so its possible that some of the things I mentioned will be changed, or fixed once the PR is finalized, and merged. These are just a few things I thought, that could help in adding support for General Notes for Trunk:I'm pretty sure that an extending library will be required for good integration with |
Thanks for putting a list together!
This would be great to support in Manganis. I opened a tracking issue here: DioxusLabs/manganis#28
There are some places where Manganis currently panics where is should return an error. For file operations or other things that may fail it should return a result. There will likely still be some I also agree anyhow makes properly handling errors in CLIs more difficult than it needs to be. I can work on switching to a proper error enum Tracking issue: DioxusLabs/manganis#27
DioxusLabs/collect-assets#26 should fix the workspace issues because it embeds asset links directly into the binary instead of using a global cache. It is mostly an internal change to fix some bugs. Asset types stay the same. I think the only breaking change for trunk is the way loading assets will work. Instead of providing the path to the workspace, trunk will need to load the assets from the path to the WASM |
Coming from a discussion on #710 this issue tracks the idea of using manganis for assets.
I think there are three levels of integration possible:
I think we should start with 1, and see how that works.
There was also the idea of trunk having a WebAssembly based extension system. It might be that this could be a use case for this. But this would also mean some bigger effort. Just mentioning this here to not forget about it.
The text was updated successfully, but these errors were encountered: