Migrating from Lift 2.6 to Lift 3.5: Pointers required

90 views
Skip to first unread message

Akhilesh

unread,
Oct 4, 2022, 7:04:58 AM10/4/22
to Lift
Hi folks,

I am running a Lift 2.6.2 / Scala 2.11 application without modifications since 2012-2013. Now I would like to migrate it to current Lift 3.5.0 and Scala 2.13 due to other projects being updated as well.

Any recommendations on how to proceed? We have a lot of pages and a LOT of code, and right off the bat I can see over ~500 bind related errors in the application among other scala issues. We use the OldHtmlProperties and have not moved to HTML5. I am a complete newbie and would appreciate some pointers on stuff I need to look out for.

Thank you very much,
Akhilesh

Andreas Joseph Krogh

unread,
Oct 6, 2022, 8:55:49 AM10/6/22
to lif...@googlegroups.com

There's no “best practice” here, that I'm aware of, and kind of depends on how you've used Lift's binding-mechanisms and other Scala-language features. My best advice is to just upgrade and incrementally fix compiler-errors as they occur, and ask on this list if you get stuck.

 

--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

Akhilesh

unread,
Oct 10, 2022, 2:59:35 AM10/10/22
to Lift
Thank you for your response. Off the top of my head, the htmls use the lift: tags, and surround templates, some of the functions return FuncBindParams and BindParams which were removed and I have no idea how to replace these. I will replace the bind functions with Css selector transforms, what other changes will I need to make?

Andreas Joseph Krogh

unread,
Oct 10, 2022, 4:02:34 AM10/10/22
to Akhilesh, Lift
På mandag 10. oktober 2022 kl. 08:59:35, skrev Akhilesh <ar...@tracelink.com>:

Thank you for your response. Off the top of my head, the htmls use the lift: tags, and surround templates, some of the functions return FuncBindParams and BindParams which were removed and I have no idea how to replace these. I will replace the bind functions with Css selector transforms, what other changes will I need to make?

I don't remember, but you have to go all inn for CssSelectorTransforms, and also use data-lift= instead of <lift:-tags although I believe <lift:?-tags should still work.

Akhilesh

unread,
Oct 10, 2022, 4:36:44 AM10/10/22
to Lift
Thank you.
What I tried for a quick fix was from this comment:

I basically lifted the Helpers class from 2.6 and fixed it for Scala 2.13, and used the bind() function from there which resolved the compile time issues, but I still get errors like 
Error processing snippet: comet
Error processing snippet: bind

on this file: template.html:

<lift:BaseTemplate.surround body-class="app-lite-body">
<lift:comet type="Flash"/>
<div id="content" class="app-lite-content-holder">
<div class="contentHolder">
<div id="title" class="app-lite-title clear">
<lift:bind name="titlearea"/>
</div>
<div id="instructions" class="app-lite-instructions">
<lift:bind name="instructionarea"/>
</div>
<div class="app-lite-content">
<lift:bind name="contentarea"/>
</div>
</div>
</div>
</lift:BaseTemplate.surround>

(Changing these to data-lift did not help.)

and this file is used in a different file, in the tag 
<lift:surround xmlns:lift="http://liftweb.net/" with="template">

I guess the only option might be to rewrite it using Css Selectors, but what do I do about the functions like:

private def bindModalJsCmd(modalTitle: String, contentLocation: String, confirmFunc: () => JsCmd, dialogIcon: Option[String], bindings:Seq[BindParam]): () => JsCmd =
bindModalJsCmd(modalTitle,contentLocation,() => true, confirmFunc, dialogIcon, bindings)


private def bindModalJsCmdSubmit(modalTitle: String, contentLocation: String, buttonFunc: () => Boolean, confirmFunc: () => JsCmd, dialogIcon: Option[String], bindings:Seq[BindParam]): () => JsCmd =
_bindBasicModalSubmit(modalTitle, contentLocation, buttonFunc, dialogIcon, bindings ++ Seq(FuncBindParam("dialogConfirm", (ns: NodeSeq) 
makeCloseModalButtonWithCustomJS(ns, confirmFunc))))

which accept these types in bold? They are not available in 3.x anymore and I couldn't find anything similar to this here.
Thanks.

Andreas Joseph Krogh

unread,
Oct 10, 2022, 4:55:53 AM10/10/22
to Akhilesh, Lift

I'm not familiar with BindParam and friends…

 

Note that in Boot.scala I have:

LiftRules.contentParsers = ContentParser(
Seq("lift", "liftfo"),
(content:InputStream) => S.htmlProperties.htmlParser(content),
identity[NodeSeq](_) // These templates are not surrounded by default
) :: LiftRules.contentParsers

This way we use .lift for all our HTML-stuff (templates in Lift-speak).

 

Take this example:

In the folder templates-hidden:

 

origo-main-template.lift

<!DOCTYPE html>
<html data-lift="menu.PageLanguageSnippet.render">
<head>
<title data-lift="Menu.title"></title>
</head>
<body>
<div id="mainContainer">
<div id="origo_menu">The main menu goes here</div>
<div id="content">The main content will get bound here</div>
</div>
</body>
</html>

 

origo-page.lift

 

<div data-lift="surround?with=origo-main-template">
<div id="top_menu" data-lift="bind-at?name=origo_menu">
<div data-lift="embed?what=origo-main-menu"/>
</div>
<div data-lift="bind-at?name=content">
<div id="main-content"/>
</div>
</div>

 

Then this template is referenced in Loc

/path/to/page-templates/someRealPage.lift

<div data-lift="surround?with=origo-page">
<div data-lift="bind-at?name=main-content">
<div data-lift="MyViewSnippet.render">
</div>
</div>
</div>

Akhilesh

unread,
Oct 12, 2022, 5:13:20 AM10/12/22
to Lift
Hi,

Can you help me with the replacement for the lift:band tags that were used in the older versions of lift? I am aware that I am supposed to changed the lift:bind-at 's and others with data-lift=bind-at?.. etc, but cannot find anything for lift:bind?

Andreas Joseph Krogh

unread,
Oct 12, 2022, 7:45:52 AM10/12/22
to Akhilesh, Lift
På onsdag 12. oktober 2022 kl. 11:13:20, skrev Akhilesh <ar...@tracelink.com>:

Hi,

 
Can you help me with the replacement for the lift:band tags that were used in the older versions of lift? I am aware that I am supposed to changed the lift:bind-at 's and others with data-lift=bind-at?.. etc, but cannot find anything for lift:bind?

I have no experience with lift:bind, sorry…

Reply all
Reply to author
Forward
0 new messages