v1.5.4
What's New
WebSocket 支持
- 新增
websocket.connect(url, options)Lua API - 独立接收线程 + 非阻塞消息队列,配合
@realtime实现低延迟推送 - 支持
ws://和wss://协议 - 默认自动重连(指数退避 1s~30s),可关闭
- 连接生命周期绑定 bar,移除时自动关闭
Dialog 布局增强
- table 支持
col_widths自定义列宽(固定 + 自动填充) - table 支持
height自定义行高 - table 支持
wrap单元格文本自动换行 - button 支持
width/height/align布局控制
其他改进
- Bar 首次加载时显示 "loading..." 状态
- http 响应体大小上限从 256KB 提升到 2MB
- GitHub Trending 示例插件
Lua API 示例
-- WebSocket
local ws = websocket.connect("wss://example.com/stream", {
reconnect = true,
headers = "Authorization: Bearer xxx"
})
ws:send("hello")
local msg = ws:recv() -- non-blocking
ws:close()
-- Table with custom layout
{ type = "table",
columns = { "Name", "Status", "Detail" },
col_widths = { 80, 60, 0 },
height = 24, wrap = true,
rows = { ... } }
-- Button with size and alignment
{ type = "button", value = "Submit",
width = 200, height = 36, align = "center",
color = "#FFF", bg_color = "#336699" }完整文档: LUA_API.md
Full Changelog: v1.5.3...v1.5.4