From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 3B2FC1FF135 for ; Sun, 05 Apr 2026 11:08:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A493418A6B; Sun, 5 Apr 2026 11:08:46 +0200 (CEST) Message-ID: <3570c013-8109-45cb-a054-7072fcea559e@proxmox.com> Date: Sun, 5 Apr 2026 11:08:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH yew-widget-toolkit v2] widget: add 'div' macro To: Dominik Csapak , yew-devel@lists.proxmox.com References: <20260402134337.3433085-1-d.csapak@proxmox.com> Content-Language: en-US, de-DE From: Thomas Lamprecht In-Reply-To: <20260402134337.3433085-1-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775380029458 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.001 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VM6JOUMHYIA4PHIXOBWMAIFFMESJZBU4 X-Message-ID-Hash: VM6JOUMHYIA4PHIXOBWMAIFFMESJZBU4 X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 02/04/2026 15:43, Dominik Csapak wrote: > this is just a simple wrapper around the `Container` widget, but it's > very useful in situations where bare strings are used in a flex layout, > since e.g. a `Row` with multiple children that are all strings won't get > a proper flex layout (since they're not elements) > > So instead of writing > ``` > Row::new() > .with_child(Container::new().with_child("Text1")) > .with_child(Container::new().with_child("Text2")) > ``` > > one can now write > ``` > Row::new() > .with_child(div!("Text1")) > .with_child(div!("Text2")) > ``` > > which is much shorter and more readable. Yes, but why a macro and not a normal method for this? Macro's are a bit opaque, totally fine if there is a benefit for adding them, but here I cannot see a big blocker against adding an e.g. TextContainer wrapper or an Container::new_with_text (might need better naming, but just to relay the idea), especially if that's your main use case. Or for a more generic use case we could add a "Container::new_with_child" constructor or also a wrapper type (SimpleContainer::new(child)). And it isn't exactly a plain div, as then one could just use the html! macro from yew, so the name as is, is IMO not totally ideal. If we go the macro way (what's Dietmars opinion on this?), I'd favor to call it container! to better reflect that it uses the pwt container class.