♻️ Migrate render-wasm api object-svg to modern component syntax (#9459)

* ♻️ Migrate render-wasm api object-svg to modern component syntax

* 📎 Add minor changes

Signed-off-by: Andrey Antukh <niwi@niwi.nz>

---------

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Dexterity 2026-06-24 04:24:53 -04:00 committed by GitHub
parent d757f96633
commit a530cf0dec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -320,9 +320,8 @@
(.postMessage (.-port2 ch) nil))))) (.postMessage (.-port2 ch) nil)))))
;; Based on app.main.render/object-svg ;; Based on app.main.render/object-svg
(mf/defc object-svg (mf/defc object-svg*
{::mf/props :obj} [{:keys [shape]}]
[{:keys [shape] :as props}]
(let [objects (mf/deref refs/workspace-page-objects) (let [objects (mf/deref refs/workspace-page-objects)
shape-wrapper shape-wrapper
(mf/with-memo [shape] (mf/with-memo [shape]
@ -344,7 +343,7 @@
(defn get-static-markup (defn get-static-markup
[shape] [shape]
(-> (->
(mf/element object-svg #js {:shape shape}) (mf/element object-svg* #js {:shape shape})
(rds/renderToStaticMarkup))) (rds/renderToStaticMarkup)))
;; forward declare helpers so render can call them ;; forward declare helpers so render can call them