Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
John Sullivan
@sullivan-
This time I got an email notification when you posted here, so next time I won't be three weeks late in responding :smile:
I wish I had a more optimistic response. Despite all the great features that longevity has, there are some good reasons I haven't hit 1.0 yet
The schema migrations thing is really high priority for me. But migrating the codebase to shapeless has become a sort of prereq for that, since it potentially affects the migrations implementation in significant ways
Mardo Del Cid
@mardo

Hahaha… Naaah, that user guide is killer :) it gives a good impression of the framework, that was a huge deal when I decided to look into it. I am not doing scala development in my day job so I have very little time to look into all the libraries I like :D but I love what I’ve seen so far.

Nice that you’re adding shapeless into the mix :D… It will certainly add more flexibility, less dev work and also you won’t need to maintain the inhouse reflection project (that’s “Emblem", right?).

John Sullivan
@sullivan-
That's right, emblem is sort of my attempt to use reflection to do what shapeless does, before I really understood what shapeless did
so yeah, emblem would go to trash heap
(will)
anyway real glad you like it
Mardo Del Cid
@mardo
;)
John Sullivan
@sullivan-
0.23 release coming soon!
John Sullivan
@sullivan-
Okay, 0.23 is getting real close. I'm just writing a little something up before I start working through my release steps
John Sullivan
@sullivan-
Mardo Del Cid
@mardo

Hi @sullivan- !
Thanks a lot for the demo and the video, it is awesome!

I’m facing an issue with my IDE integration. I’m currently using IntelliJ IDEA, and when looking at the companion objects (object User), there Cannot resolve symbol error for both primaryKey and props., I bet this is because the macros. Do you have a suggestion or workaround for this? Or I just got to learn to live with it? :)… not a huge deal, really; but I would prefer not see red font in my source code :D

In any case, thanks a lot!

John Sullivan
@sullivan-
Hi @mardo! Thanks for writing. I'm glad you liked the video
I don't use IDEA much, so I haven't seen that before. It's no good if IDEA is reporting errors like this. Let me look into it.
It might take a bit as I probably should install a recent version of IDEA first
Mardo Del Cid
@mardo
I remember IDEA didn’t play well with “old style” macros
I think it supports scalameta now
John Sullivan
@sullivan-
If I can't get IDEA to clear those errors, I think there's stuff we can do on the longevity side
Yeah. I would like to migrate to scalameta, but the feature set isn't quite there yet to support what we're doing
Mardo Del Cid
@mardo
ok, I just wanted to raise the concern :)
John Sullivan
@sullivan-
Yes, thank you very much for pointing that out. I definitely want to know about things like this!! (And I don't have the bandwidth to experiment in every possible dev environment ;))
Mardo Del Cid
@mardo
that’s what the community is for ;)
John Sullivan
@sullivan-
On the longevity API side, one thing we could do is allow the user to write object User extends PType[DomainModel, User] ..., even tho the macro puts in that extension for you
that would allow for the resolution of the error on primaryKey
Mardo Del Cid
@mardo
yeah, that’s an easy fix
John Sullivan
@sullivan-
But not the props
Mardo Del Cid
@mardo
yup :)
John Sullivan
@sullivan-
For props, I think other ppl use dynamic method approach to work around that
for instance, something where you could write User.dprops.username[Username] instead 0f User.props.username
so you would have to supply the type manually, and dynamic methods have a minor runtime overhead.. and you could get a runtime error if the types don't match
Mardo Del Cid
@mardo
hehehe… I think I prefer to see a couple of red text than going through all this
John Sullivan
@sullivan-
I should really look into how shapeless handles this, and if code that uses shapeless presents spurious compiler errors in IDEA
Mardo Del Cid
@mardo
or use ENSIME as you do!
aaah yeah, the more you do on shapeless the better
Sorry, what I wanted to say is that maybe you can not only see how shapeless does this, but do more things with shapeless than with macros
John Sullivan
@sullivan-
I've got to get back into using ENSIME more. I'm typically lazy and just use Emacs
Mardo Del Cid
@mardo
not sure if everything is possible though
John Sullivan
@sullivan-
yeah, i still intend to migrate a lot of internals to longevity. but it just takes time. at the moment, I'm putting "schema migrations" at top priority.
Okay, I'm going to install IDEA and take a look
Mardo Del Cid
@mardo
cool
the whole project is awesome
John Sullivan
@sullivan-
thanks man!
Mardo Del Cid
@mardo
One question I was curious about, there’s no support for inheritance in the persisted case classes props, like this for instance:
@persistent[DomainModel]
  case class User(
    username: Username,
    email: Email,
    fullName: FullName,
    answers: List[Answer] = Nil
  )

  trait Answer

  @component[DomainModel]
  case class AAnswer(a: String) extends Answer

  @component[DomainModel]
  case class BAnswer(b: Int) extends Answer
Mardo Del Cid
@mardo
:O !
John Sullivan
@sullivan-
when we move to shapeless we'll have to start sealing that trait
Mardo Del Cid
@mardo
I just had a geekgasm
John Sullivan
@sullivan-
:smile: