Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

ScalaTags Interoperability #16

Open
mdedetrich opened this issue Oct 28, 2014 · 4 comments
Open

ScalaTags Interoperability #16

mdedetrich opened this issue Oct 28, 2014 · 4 comments

Comments

@mdedetrich
Copy link

ScalaTags is an excellent high performance HTTP templating library in Scala (https://github.com/lihaoyi/scalatags) that works both in Scala.js and Scala JVM. It would be fantastic if we could provide support for scalajs-angualar with scala-tags so that we can have type highlighting for directives (and even possibly their arguments)

It also means that we can use ScalaTags in template sections of Angular, instead of just using raw HTML strings

@mdedetrich mdedetrich changed the title TypeAware Highlighting when Using ScalaTags ScalaTags Interoptarability Oct 28, 2014
@mdedetrich mdedetrich changed the title ScalaTags Interoptarability ScalaTags Interoperability Oct 28, 2014
@mysticfall
Copy link
Member

I definately agree with you on this one. Actually, olivergg seems to be exploring a similar idea of using scalatags to auto-generate templates, as you can see here: #10

Although his current approach seems to rely on SBT plugin, rather than directives I believe the basic ideas to be quite similar, and we should consider adopting it in the framework itself in future.

@olivergg
Copy link
Contributor

@mdedetrich If you're still interested and as @mysticfall said, I've implemented a solution based on a SBT task. You can see some example there https://github.com/olivergg/scalajs-ionic-starttabs/tree/master/src/main/scala/com/olivergg/html
Templates are generated from scala source, and thus could also be referenced from a directive definition.
I'm not entirely satisfied with this solution because :

  • the scala source code for the HTML is shared with the rest of the application. Even though it would allow to share some variables with the rest of the application, it also means it will be embedded with the final JS. Fixed by using crossbuilding
  • there is no incremental compilation since the sbt task depends on the fullclasspath task.

@mdedetrich
Copy link
Author

Thanks @olivergg, will have a look, however getting incremental compilation to work would be a massive boost

@olivergg
Copy link
Contributor

@mdedetrich Well, now that I have separated the source code into three projects (shared, js and jvm), I think it would be easier to do. I'll think of a solution.

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

No branches or pull requests

3 participants