Changing asJValue signature for Record and MetaRecord

31 views
Skip to first unread message

Torsten Uhlmann

unread,
Apr 27, 2016, 8:20:46 AM4/27/16
to Lift
Hi,

a while back I raised the issue that the asJValue methods of Record fields have an inconsistent signature (https://groups.google.com/forum/#!topic/liftweb/kTBHlK7xBHM).
We discussed that and I changed them to return JValue (https://github.com/lift/framework/pull/1621).

In this course I also changed the signature of Record and MetaRecord to return JValue instead of JObject which turns out to be a mistake,
because now we can't call ~ anymore to join multiple records.

Are there any objections to changing the signature back to return JObject for Record and MetaRecord in the Lift 3 codebase?

Torsten.

Antonio Salazar Cardozo

unread,
Apr 27, 2016, 5:43:40 PM4/27/16
to Lift
It seems like the better approach would be to add `asJObject` and make `asJValue`
invoke it… Having `asJValue` return something that isn't strictly a `JValue` from the
consumer's perspective, and then using that on the caller side, seems a little weird.
At least that's what it looks like to me. What do others think?
Thanks,
Antonio

Tim Nelson

unread,
Apr 28, 2016, 9:18:44 AM4/28/16
to Lift
I understand the mismatch there in types may be a little unexpected, but I also think having a Record return anything other than a JObject doesn't make much sense either.

My preference would have been that this change was never made, but since we can't go back in time, I think adding an asJObject function is a good solution and works for me.

Would we able to get that in 3.0? Not sure it's technically a bug, but I'd hate to see 3.0 released the way it is.

Tim

Torsten Uhlmann

unread,
Apr 28, 2016, 9:24:22 AM4/28/16
to Lift
I can provide a PR in the coming days...

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Torsten Uhlmann

unread,
Apr 28, 2016, 10:28:11 AM4/28/16
to Lift

Antonio Salazar Cardozo

unread,
Apr 28, 2016, 3:30:22 PM4/28/16
to Lift
I'm down to have another RC built with this… Mostly because I haven't
had time to write a proper script to detect situations when LiftScreen templates
need to be migrated, and this is a perfectly fine thing to hide behind <_<
Thanks,
Antonio

Peter Petersson

unread,
Apr 28, 2016, 4:14:36 PM4/28/16
to lif...@googlegroups.com
+1 ;)

Diego Medina

unread,
Apr 28, 2016, 8:16:27 PM4/28/16
to Lift
+1 for having another RC so 3.0 final has this fix in
--
Diego Medina
Lift/Scala Consultant
di...@fmpwizard.com
http://blog.fmpwizard.com/
Reply all
Reply to author
Forward
0 new messages