framework icon indicating copy to clipboard operation
framework copied to clipboard

Page.js is generated on stateless pages

Open fanf opened this issue 7 years ago • 2 comments

Mailing List thread: https://groups.google.com/forum/#!topic/liftweb/nGl82UL6T4k

[Example project] https://github.com/fanf/demo-bug-lift-session

When a page is stateless (for ex with the >> Stateless modifier in Menu), it still get the following code at its end (which force create a session):

<script type="text/javascript" src="/lift/page/F446450137052YRAVO5.js"></script>

fanf avatar Mar 28 '18 00:03 fanf

Easiest way to deal with this is probably to check for stateful_? and if it's false emit the JS inline instead of as a referenced page.

Shadowfiend avatar Mar 28 '18 18:03 Shadowfiend

We also need to provide a way to clear LiftRules.javaScriptSettings completely, whether in stateless or stateful mode. Right now all we can do is return an empty JsObj, but we still emit some Lift JS setup stuff, rather annoyingly, even if autoIncludeAjax and friends are off.

Shadowfiend avatar Mar 28 '18 18:03 Shadowfiend