Skip to content

Commit 3721f53

Browse files
committed
updated documentation
1 parent 99b3247 commit 3721f53

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

forge-wire.html

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,8 @@ <h3 class="text-lg font-semibold mb-3">Component with DTO</h3>
735735
</div>
736736
</section>
737737

738-
<!-- Best Practices -->
739738
<section id="best-practices" class="section-anchor mb-12">
740-
<h2 class="text-2xl font-bold text-gray-900 mb-4">Best Practices</h2>
739+
<h2 class="text-2xl font-bold text-gray-900 mb-4">Some Suggestions</h2>
741740
<p class="text-gray-600 mb-6">
742741
Recommendations for using ForgeWire effectively.
743742
</p>
@@ -747,9 +746,6 @@ <h2 class="text-2xl font-bold text-gray-900 mb-4">Best Practices</h2>
747746
<h3 class="font-semibold text-lg mb-3 text-green-600">Things That Often Help</h3>
748747
<ul class="space-y-2 text-sm text-gray-600">
749748
<li>• Use #[State] for simple scalar/array values</li>
750-
<li>• Use #[DTO] for complex form data</li>
751-
<li>• Use #[Model] for database entities</li>
752-
<li>• Use #[Service] for dependency injection</li>
753749
<li>• Keep components focused and single-purpose</li>
754750
<li>• Use computed properties for derived values</li>
755751
<li>• Leverage fw:model.debounce for search inputs</li>
@@ -763,26 +759,12 @@ <h3 class="font-semibold text-lg mb-3 text-orange-600">Things to Consider</h3>
763759
<li>• Don't expose sensitive data without attributes</li>
764760
<li>• Don't use complex objects with #[State]</li>
765761
<li>• Don't forget #[Action] on callable methods</li>
766-
<li>• Don't pass arrays/objects to action methods</li>
767762
<li>• Don't poll too frequently (performance impact)</li>
768763
<li>• Don't store large amounts of state in session</li>
769-
<li>• Don't forget to implement toArray()/fromArray() for DTOs</li>
770764
<li>• Don't skip validation for user input</li>
771765
</ul>
772766
</div>
773767
</div>
774-
775-
<h3 class="text-lg font-semibold mb-3">When to Use State vs DTO vs Model</h3>
776-
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6">
777-
<ul class="space-y-2 text-sm text-gray-600">
778-
<li><strong>#[State]:</strong> Simple values (strings, numbers, arrays) that change
779-
frequently</li>
780-
<li><strong>#[DTO]:</strong> Complex form data with multiple related fields</li>
781-
<li><strong>#[Model]:</strong> Database entities that need to be loaded/saved</li>
782-
<li><strong>#[Service]:</strong> Business logic services, repositories, external APIs
783-
</li>
784-
</ul>
785-
</div>
786768
</section>
787769
</div>
788770
</div>

0 commit comments

Comments
 (0)