What's here and what's coming¶
Working today:
- Components: XML templates with
{{ }}and:attrbindings, two-way@bindfor every form control, event handlers (methods, expressions or inline statements) with modifiers (@submit.prevent,@keydown.enter) and a detailed event object (keys, modifier keys, mouse, form fields),<If>/<For>with keyed lists,@propertycomputed values,ref=withfocus(),scroll_to()andkeep_in_view(), and input masks (data-mask). - Composition: child components with props, events (
emit) and lifecycle hooks; slots (named, with fallbacks and slot props);@bindon components; attributes passed through to a component's root element; components in subfolders as<folder.Name>, or imported from packages (ComponentLibrary), shipped to the browser from your environment;Storefor state many components share;<Dynamic :is>for a component chosen at runtime. - Pages:
router("pages")turns a folder into screens, with<Link>,navigate(), Back/Forward, typed{params}and query values as fields. - Reacting to change:
@effectmethods with automatic dependency tracking and cleanup;state_has_changed()for changes from timers and callbacks. - Async:
async defhandlers andon_init,self.start_task()for background work, cancellation when a component is removed. - Heavy work:
run_in_background()runs a function in a Web Worker, so the page stays responsive; on a thread outside the browser. - Styling: scoped
<style>blocks, global.cssfiles,head.htmlfor CDN stylesheets and scripts, anassets/folder, so CSS frameworks such as Tailwind and Bootstrap work. - Desktop:
pyweft run --desktopopens the same app in a native window, with Python running on your machine and hot reload included; the window's size and the like come from[tool.pyweft.desktop].pyweft build --desktopmakes it a single program to hand out (an.exe,.appor Linux program) with nothing to install. - Files and dialogs:
pyweft.dialogsopens and saves files and asks for confirmation with one API: the browser's picker and downloads on the web, the system's dialogs on the desktop. - Title and icon:
[tool.pyweft]names the app and gives it an icon for the browser tab and the window;set_title()changes the title as the app runs. - Tooling:
pyweft new/run/build; hot reload that keeps state, with an error overlay; the first screen rendered ahead of time, so pages appear at once; a customizable loading screen that shows real progress; PyPI dependencies frompyproject.toml, installed in the browser. - Data in and out:
pyweft.httpcalls web APIs and loads the app's data files;pyweft.storagekeeps data between visits. Same code on both targets. - Controls:
pyweft-ui, 63 ready-made, themeable controls: layout, form fields with validation, autocomplete, chips, sliders and masks, date and date-range pickers, calendars of events, charts, menus, tabs, tables, dialogs, toasts (see "Ready-made controls" in section 5), with a live gallery. - Releases:
pyweftandpyweft-uion PyPI.
Coming next: a faster first start that also works offline, pyweft check
for errors without running the app, and installers (.msi, .dmg) and code
signing for desktop apps.