Skip to content

refactor: upgrade to frappe-ui 1.0.0 (beta.52) - #733

Closed
surajshetty3416 wants to merge 10 commits into
frappe:developfrom
surajshetty3416:frappe-ui-1.0.0
Closed

refactor: upgrade to frappe-ui 1.0.0 (beta.52)#733
surajshetty3416 wants to merge 10 commits into
frappe:developfrom
surajshetty3416:frappe-ui-1.0.0

Conversation

@surajshetty3416

Copy link
Copy Markdown
Member

Works through everything tracked in #718 as of today, pinned to v1.0.0-beta.52 (the latest tag; all tracked PRs verified as ancestors).

What's here

  • Socket — the plugin no longer sets $socket; src/socket.ts builds the connection like other Frappe apps and main.ts assigns it before mount.
  • Popover / Tooltip v1 — all 14 + 9 listed sites, plus the sites that consume ColorPicker's passthrough slot (TextBlockBubbleMenu, 4× TokenManager), which break identically. #target/#body/#body-main#trigger/#default (+bare wherever the content brings its own panel — including the #body-main site in AIPageGeneratorModal, since the v1 PopoverPanel has visible chrome), placementside/align, arrowClass:offset="12", trigger="hover" in InputLabel → v1 Tooltip with #content.
    • The trigger wires its own click now, so editable inputs living inside triggers (ColorInput, ImageUploadInput) are shielded with @click.stop, and GradientEditor's draggable stops keep their "don't open after a drag" guard the same way.
  • Dropdown v1 — the 11 listed sites plus PublishButton, PropertyLabel, and the "New Script" dropdown in PageClientScriptManager. placementalign, { group, items }{ group, options }, and the slot's open is state now, so the old @click="open" handlers are gone. PageActionsDropdown forwards align; its triggers inside router-links use @click.stop.prevent so opening the menu can't navigate.
  • Input refs — the 2 listed .el.focus() sites plus two more the sweep found (VersionHistory.vue, PagePersonaSurvey.vue).
  • FileUploaderuploadArgs flattened to props; :private="false" survives on both sites (verified against v1's uploadOptions plumbing). v1 no longer exposes inputRef, so ImageUploadInput's programmatic open now reaches the hidden input through $el.
  • FeatherIcon → lucide span in TrackingDisabledNotice.
  • Tailwind globs — replaced with the content export. Note: experimental/ListView sits outside frappe-ui's published globs (only SpriteIcons/TextEditor/Calendar/Charts are covered), so an extra glob keeps ListView styled while we still use it.
  • Experimental importsListView (3 files) and AxisChart (1 file) now import from frappe-ui/experimental.
  • @framework/ui — dep added (link:../../frappe/ui), 12 files re-pointed. These use deep subpath imports (@framework/ui/telemetry, @framework/ui/components/TrialBanner) rather than the root barrel — see below.
  • Follow-ups the v1 typings surfaced: Badge/Dialog dropped orange/yellow (→ amber), stale frappe-ui > feather-icons prebundle entry removed, vue/frappe-ui/@vueuse/core deduped in vite so @framework/ui's peers resolve to this app's single copies.

⚠️ Upstream skew (why deep imports, and why this stays draft)

frappe/frappe's ui package hasn't caught up with two frappe-ui breaks yet:

  1. CodeEditorField.vue still imports frappe-ui/code-editor, which was folded into the experimental barrel (refactor(charts)!: park the old Charts family in experimental frappe-ui#1043-era fold) — this makes the root barrel of @framework/ui unbuildable against beta.52, hence the deep imports.
  2. TrialBanner.vue still imports the removed FeatherIcon. I verified the build with a two-line local patch to the frappe worktree (FeatherIcon → lucide span); that fix needs to land in frappe/frappe before this merges.

Once both are fixed upstream, the deep imports can collapse back to plain @framework/ui root imports.

Verification

  • vite build is green (in a bench-shaped worktree with frappe at develop + the TrialBanner patch above).
  • vue-tsc baseline-diffed against develop/beta.21: 157 → 72 errors, zero new Builder-side errors (the remainder are pre-existing plus frappe-ui's own experimental-barrel noise at beta.52).
  • Not yet QA'd in the browser — that's why this is a draft. The behavioral hot spots to click through: color picker (focus-to-open, swatch toggle, token save), background/shadow handlers (open via row click now, not input focus), gradient stop drag vs click, page-card/list/route-tree "…" menus (must not navigate), AI modal style picker, image upload input + programmatic open from the store, search filter popover, token manager swatches, page-title popover (external-link icon must not toggle), publish dropdown.

surajshetty3416 and others added 10 commits August 13, 2026 13:50
Pin the submodule and frontend dependency to the beta.52 tag, add
@framework/ui (link:../../frappe/ui) for the pieces that moved out of
frappe-ui, dedupe the peer deps it resolves against, and drop the
feather-icons prebundle entry that no longer exists.

Co-Authored-By: Claude <noreply@anthropic.com>
frappe-ui 1.0.0 removed initSocket and the plugin no longer sets
$socket; build the socket.io connection in src/socket.ts like other
Frappe apps and assign it before mount. main.ts also picks up the
telemetry plugin's new home in @framework/ui.

Co-Authored-By: Claude <noreply@anthropic.com>
#target/#body/#body-main become #trigger/#default (with bare where the
content brings its own panel), togglePopover/isOpen become toggle/open,
placement splits into side/align, arrowClass becomes an offset, and the
hover popover in InputLabel becomes a Tooltip #content. The trigger now
wires its own click, so the old toggle handlers are dropped; editable
inputs inside triggers are shielded with @click.stop. ColorPicker keeps
its placement prop but exposes the v1 trigger slot to its consumers.

Co-Authored-By: Claude <noreply@anthropic.com>
placement becomes align (right maps to end, left to the start default),
{ group, items } groups become { group, options }, and the trigger slot's
open is now state rather than a method, so the click handlers go away.
PageActionsDropdown forwards align instead of placement, and triggers
inside links keep .stop/.prevent so opening the menu doesn't navigate.

Co-Authored-By: Claude <noreply@anthropic.com>
TextInput/Textarea refs expose focus() directly now (ref.el is gone),
FeatherIcon is replaced by a lucide span, and the hand-written frappe-ui
content globs are replaced by the list frappe-ui exports, plus an extra
glob for the parked experimental ListView which sits outside it.

Co-Authored-By: Claude <noreply@anthropic.com>
ListView and AxisChart moved out of the frappe-ui root into the
experimental barrel, and the frappe-ui/frappe subpath is gone; telemetry
and TrialBanner now come from @framework/ui. Deep subpath imports are
used for the latter because the root barrel doesn't compile against
frappe-ui beta.52 yet (its CodeEditorField still imports the removed
frappe-ui/code-editor path).

Co-Authored-By: Claude <noreply@anthropic.com>
Badge/Dialog dropped orange/yellow for amber, import.meta.env needs the
vite/client types, and vue-tsc now resolves frappe-ui and @framework/ui
sources through explicit path mappings. Boolean tab values are cast at
the TabButtons boundary; the v1 TabValue is string|number but matching
is by identity so they keep working.

Co-Authored-By: Claude <noreply@anthropic.com>
The toolbar refactor on develop moved the page-title popover, action
tooltips, viewer avatars and read-only badge into ToolbarItems; apply
the same Popover/Tooltip/Badge migration there and refresh the lockfile
for the beta.52 pin.

Co-Authored-By: Claude <noreply@anthropic.com>
OptionToggle and SplitModeInput serialize boolean values to strings at
the TabButtons boundary and map them back on select, keeping their own
boolean APIs without any-casts. The Combobox handlers narrow their
unknown payloads instead of asserting.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant