V13

Warning

Vocabulary

V13 — A deprecated built-in

A built-in on its way out: it still draws as it always has through 8.x, and is removed in 9.0. The finding names what replaces it, and wf fix rewrites it where the rewrite is exact.

What the compiler said

warning[V13]: `Dialog` is deprecated since 8.0: `Modal` takes its place, and `Dialog` is removed in 9.0 --> src/App.wf:4:5 | 4 | Dialog(visible: asking, title: "Discard the draft?") { | ^^^^^^ = help: It takes the same props, events and `Title` part. A `Modal` is drawn wider (500px against 400px) with its heading and body padded apart; `class:` or `style { width: … }` sizes it. `wf fix --code V13` rewrites it = docs: https://webfluent.monzeromer.dev/errors/V13

Your editor offers this fix: Write Modal. wf fix --code V13 applies it to every place it fits.

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state asking = false Heading("Settings").h1 Dialog(visible: asking, title: "Discard the draft?") { Text("What you wrote is lost.") } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state asking = false Heading("Settings").h1 Modal(visible: asking, title: "Discard the draft?") { Text("What you wrote is lost.") } }

Write the replacement the finding names, or run wf fix --code V13.

Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).

Why this rule exists

A few built-ins were near-copies of another, and are on their way out. Each still draws exactly as it did through every 8.x release, and is removed in 9.0. The finding names what takes its place:

Deprecated Write instead
Dialog, Dialog.Title Modal, Modal.Title
Dropdown(label: x) { Dropdown.Item { … } } Menu(trigger: x) { Menu.Item { … } }
Tag("x") Chip("x")
Toast("Saved").success toast("Saved", tone: .success), called where it becomes true
Code(text).block CodeBlock(text)
CircularProgress(…) Progress(…).circular

wf fix --code V13 — and wf migrate, for a project moving to 8 — makes each rewrite that is exact: the name, the parts in its block, a Dropdown's label as the menu's trigger:, a .block flag dropped. A Toast is rewritten as a toast(…) call only at the top of a page or a component, where it is drawn once; one inside an if or a for is shown each time that branch or item is drawn, so the call belongs in the handler or action that makes it true, which a person writes.

lints may lower it:

"lints": { "V13": "off" } // wf-allow(V13)