Skip to content
Commit ded8ccf9 authored by Jo-Philipp Wich's avatar Jo-Philipp Wich
Browse files

luci-base-ucode: add initial ucode based LuCI runtime



This commits introduces an initial ucode based LuCI runtime. It supports
JSON menu files as used by Lua based LuCI and the template, call, view and
alias dispatch targets.

It is able to render a basic LuCI installation without errors. An embedded
Lua VM is lazily loaded when Lua based resources are encountered, such as
`*.htm` templates or server side Lua call targets.

When a template is requested, the ucode runtime first tries to render an
`/usr/share/ucode/luci/template/${path}.uc` ucode template and falls back
to rendering the corresponding `/usr/lib/lua/luci/view/${path}.htm` Lua
template in case no suitable ucode replacement is found. This allows for
gradual migration of existing Lua based tmeplates to ucode.

Furthermore, a set of stripped down LuCI libraries is shipped in the
`/usr/lib/lua/luci/ucodebridge/` directory. Those libraries provide
compatibility shims for the current Lua API towards Lua templates and Lua
based server side actions while utilizing the ucode request runtime state
internally.

Signed-off-by: default avatarJo-Philipp Wich <jo@mein.io>
parent f2133059
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment