-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Consider publishing an SBT Plugin? #103
Comments
Heyo, it's true that we're using SDT somewhat as a build tool – at compile time as a code generator – however keep in mind that this is not the only use case, so core functionality must remain sbt-free. For example, some users may want to use mill instead of sbt, others may want to load SDT as a runtime dependency, e.g. to make some interactive website with the data contained in SDT. I haven't made it an sbt plugin mainly because I'm trying to minimize dependencies, including dependencies on specialized knowledge and concepts. My lack of sbt skill is a big part of not having any fancy integration with it. I'm not even sure, what exactly could AutoPlugin give us? If you look at how Laminar uses SDT, then what can we get by making an AutoPlugin? Can it save our users (libraries like Laminar) some boilerplate under |
Yes, exactly. A plugin would / could eliminate the need to have the boilerplate code in In case I haven't been clear: adding an SBT plugin to this project would leave the core library unchanged. The result would be publishing both a library and a complimentary SBT plugin. If I have time, I'll put together a pull request to illustrate and for discussion. |
Nice idea with the sbt-plugin! The configuration surface of such a plugin might be quite big, because I am guessing, we would need to add an option for everything that is currently configured in the I have just recently created two code-generation projects as well and for both have created an sbt and a mill plugin, so I am happy to help on that front if I can. Actually, I was taking the idea of @raquo for the shoelace-components and tried to write a generic web-components generator project: https://github.com/cornerman/scala-web-components-codegen. You can write your own template to generate code for your ui framework, or it includes a predefined one for outwatch. |
One of the great things about AutoPlugins is how they are composable. I imagine a separate AutoPlugin per use case, each with configuration (setting and task keys) specific to their uses. I.e. one for code gen, one for |
@markschaake Sounds good, thanks! If I understand correctly, it seems that the sbt part will be pretty small / self-contained. It would be nice if you could keep the sbt API surface reasonably small. For example, we have methods like |
@raquo yes agreed on keeping the API surface small. It might be only two SBT settings and one task, where one of the settings allows the user to do all the default configuration overrides. I'll try to get something small up tomorrow so we can have a concrete reference to discuss (if I can steal an hour from family time). |
Thanks for the discussion on #104 . I closed it with the following takeaways:
Thanks again for taking the time to help me learn. I know for me and @YakimaProgrammer this knowledge will help us with work we're doing this summer around Shoelace.js integration with Laminar. @cornerman I will taking a look at your https://github.com/cornerman/scala-web-components-codegen project along with @YakimaProgrammer. It looks like there is some overlap with what we're trying to do this summer - hopefully we can help out! |
Hi! My understanding (correct me if I'm wrong) is that
scala-dom-types
is now really a build tool - whose purpose is to be used at build / compile time to generate code. If that's accurate, then it seems to me the elegant way to provide build tool functionality is via SBT AutoPlugin. Has this been considered? If you are open to the idea, I would be happy to whip together a pull request adding ansbt-scala-domtypes
subproject for this. (I already have the start of the code locally in my fork).I have quite a bit of experience with SBT plugins and would be happy to contribute to this project in this way, unless of course there is a reason to avoid SBT plugins?
The text was updated successfully, but these errors were encountered: