Skip to content

Commit 58bab47

Browse files
committed
guides/Forms: best practises => mention explicit module imports #6916
1 parent bc14c79 commit 58bab47

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

learn/guides/Forms.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ myFormContainer.on('fieldUserChange', (data) => {
440440
lazy loading modules for individual pages or fieldsets to improve initial
441441
application load times. This is demonstrated in `apps/form/view/FormContainer.mjs`
442442
where pages are imported dynamically.
443+
* **Explicit Module Imports**: While the core `Neo` global namespace is always available, it's a best practice to
444+
explicitly import all Neo.mjs modules you use (e.g., `import FormContainer from '../../src/form/Container.mjs';`).
445+
Relying on implicit availability of classes within `Neo`'s sub-namespaces can lead to less readable and maintainable code.
446+
Explicit imports improve code readability, maintainability, and ensure consistent behavior.
443447
* **`Neo.overwrites`**: Use global overwrites (as seen in `apps/form/Overwrites.mjs`)
444448
to enforce consistent styling or behavior across all instances of a
445449
component type.

0 commit comments

Comments
 (0)