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

Feature Request: Namespace and Pathing Support #13

Open
siglocpp opened this issue Jun 9, 2022 · 8 comments
Open

Feature Request: Namespace and Pathing Support #13

siglocpp opened this issue Jun 9, 2022 · 8 comments
Labels

Comments

@siglocpp
Copy link
Contributor

siglocpp commented Jun 9, 2022

I quite like, what this plugin does, but I'm missing some key features to make it better usable in bigger/structured projects:

Namespace-Support

Currently the generated files are part of the default namespace. This works for smaller projects, but not for bigger or better structured ones.
While it's possible to move the UI-Script into a namespace manually, it's impossible to do that reliable for the Bindings-Script, which will be rewritten repeatedly.
There should be some option to generate the Binding-Scripts for a specific namespace.
Idealy, there would even be a support for multiple namespaces, either on folder, or on a VTA by VTA basis.

Pathing Support

Currently the UI-Script and the Bindings-Script are created next to the VTA. While it's possible to move the UI-Script to a different path, Rosalina does not notice, when you move the Bindings-Script and just recreates a new one next to the VTA.
It would be good, if it was possible to move Bindings-Scripts and keep them on a sperate path, enabling the sepparation of VTA and the scripts.
Again Idealy, there would even be a support for multiple target folders, either on folder or on a VTA by VTA basis.

Disabling Rosalino for some VTAs

It would be good, if it was possible to disable auomatic file generation for each VTA.
Especially if you are working with an already existing UI and start using Rosalina at a later point, you might not want to rework all your code and VTAs just to make the generated Bindings-Scripts compile.
Currently, you either have to repeatedly delete the generated Bindings-Scripts or rework everything already existing, if you e.g. used kebab case for the field identifier until starting to use Rosalina.
The same may apply if you are designing VATs which will be used as internal templates/controls, used wihtin other of your VATs.

@Eastrall
Copy link
Owner

Hi, these are some cool features you are mentioning here!

I just have a little remark on the "Pathing Support" feature you are describing. I believe the UI script should remain in the same folder along the uxml file, just like the traditional WinForm/WPF code-behind approach. But when we think about the binding script, we don't really need to have it along with them and we could just put all generated scripts in the same folder. Maybe a Rosalina/Generated folder at the root of the Assets folder.

This Rosalina folder could also be the place where we store its configuration file for namespace and disabled documents.

@Eastrall Eastrall added enhancement New feature or request discussion labels Jun 16, 2022
@siglocpp
Copy link
Contributor Author

I think the idea with the Rosalina folder for configurations and binding scripts is a good idea.

I understand your point with UI script/uxml file.
I just happen to have a background where I prefere to seperate code and declaring visuals.
Fortunately it's currently possible to just move the UI script where ever you want, since it does not get regenerated on uxml save.
So our different approaches are a non issue and this part of the pathing idea can be scrapt.
If we move the generated bindings to the suggested rosalina folder, we can just skip the whole pathing request, since it's fully resolved with this change.

@InvalidCode505
Copy link

Thumbs up to this idea. My suggestion would be to handle the generation using a scriptable object. There, you could drag the uxml files that you want to generate from, the file generation path (absolute or relative to the scriptable object location) and whatever generation setting you want to add there (like the namespace of the generated script files).

@Eastrall
Copy link
Owner

Update: The generated binding files are now located in Assets/Rosalina/AutoGenerated.

@chikacc
Copy link

chikacc commented Oct 15, 2022

I have some references on this topic:

@Eastrall
Copy link
Owner

Eastrall commented Nov 28, 2022

Partially shipped in version 2.0.0 :

  • Generated files are now located in Assets/Rosalina/AutoGenerated.

@markcastle
Copy link

markcastle commented Mar 26, 2023

I've added some very basic support for being able to change the default namespace and also added some simple settings support that could be a help for some of the other features mentioned here. See: main...markcastle:Rosalina:main

I'll happily create some basic docs and a PR if this is of any interest?

The settings...
RosalinaSettings

@Eastrall
Copy link
Owner

Sorry for the late reply @markcastle, feel free to open a PR if you want to contribute to the project! We are always looking for contributors in order to improve the tool!

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

No branches or pull requests

5 participants