├── .github └── workflows │ └── on-push.yml ├── .gitignore ├── .gitpod.yml ├── LICENSE ├── README.md ├── langs ├── de │ ├── README.md │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── en │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ ├── server.md │ │ ├── testing.md │ │ └── typescript.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── es │ ├── README.md │ ├── api │ │ └── api.md │ └── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ ├── server.md │ │ └── testing.md ├── fa │ ├── README.md │ └── guides │ │ └── comparison.md ├── fr │ ├── README.md │ ├── api │ │ └── api.md │ └── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md ├── id │ ├── README.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md │ └── tutorials │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── it │ ├── README.md │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── ja │ ├── README.md │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ ├── server.md │ │ ├── testing.md │ │ └── typescript.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── ko-kr │ ├── README.md │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ ├── server.md │ │ ├── testing.md │ │ └── typescript.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json ├── pt │ ├── README.md │ ├── api │ │ └── api.md │ └── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md ├── ru │ ├── README.md │ ├── api │ │ └── api.md │ ├── guides │ │ ├── comparison.md │ │ ├── directory.json │ │ ├── faq.md │ │ ├── getting-started.md │ │ ├── reactivity.md │ │ ├── rendering.md │ │ └── server.md │ └── tutorials │ │ ├── async_lazy │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_resources │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_suspense_list │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── async_transitions │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_classlist │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_directives │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_events │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_forward_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_refs │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_spreads │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── bindings_style │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── directory.json │ │ ├── flow_dynamic │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_error_boundary │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_for │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_index │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_portal │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_show │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── flow_switch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_basics │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_components │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_derived │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_effects │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_jsx │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_memos │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── introduction_signals │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_oncleanup │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── lifecycles_onmount │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_children │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_defaults │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── props_split │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_batch │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_on │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── reactivity_untrack │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_context │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_createstore │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_immutable │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_mutation │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ ├── stores_nested_reactivity │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json │ │ └── stores_nocontext │ │ ├── lesson.json │ │ ├── lesson.md │ │ └── solved.json └── zh-cn │ ├── README.md │ ├── api │ └── api.md │ ├── guides │ ├── comparison.md │ ├── directory.json │ ├── faq.md │ ├── getting-started.md │ ├── reactivity.md │ ├── rendering.md │ ├── server.md │ ├── testing.md │ └── typescript.md │ └── tutorials │ ├── async_lazy │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── async_resources │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── async_suspense │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── async_suspense_list │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── async_transitions │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_classlist │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_directives │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_events │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_forward_refs │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_refs │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_spreads │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── bindings_style │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── directory.json │ ├── flow_dynamic │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_error_boundary │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_for │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_index │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_portal │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_show │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── flow_switch │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_basics │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_components │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_derived │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_effects │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_jsx │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_memos │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── introduction_signals │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── lifecycles_oncleanup │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── lifecycles_onmount │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── props_children │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── props_defaults │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── props_split │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── reactivity_batch │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── reactivity_on │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── reactivity_untrack │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── stores_context │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── stores_createstore │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── stores_immutable │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── stores_mutation │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ ├── stores_nested_reactivity │ ├── lesson.json │ ├── lesson.md │ └── solved.json │ └── stores_nocontext │ ├── lesson.json │ ├── lesson.md │ └── solved.json ├── package.json ├── patches └── gitlog+4.0.4.patch ├── pnpm-lock.yaml ├── rollup.config.mjs ├── scripts └── todos.ts ├── src ├── index.ts └── types.ts └── tsconfig.json /.github/workflows/on-push.yml: -------------------------------------------------------------------------------- 1 | name: on-push 2 | on: 3 | push: 4 | branches: 5 | - "main" 6 | jobs: 7 | run-todos: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | with: 12 | fetch-depth: 0 13 | - uses: actions/setup-node@v3 14 | with: 15 | node-version: 18 16 | - uses: pnpm/action-setup@v2 17 | with: 18 | run_install: | 19 | - args: [--frozen-lockfile] 20 | - run: pnpm build 21 | - run: pnpm todos 22 | - uses: EndBug/add-and-commit@v7 23 | with: 24 | add: "langs/*/README.md" 25 | message: "bot: update language todos" 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | dist 3 | .DS_Store 4 | node_modules 5 | dist 6 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart 6 | 7 | tasks: 8 | - init: yarn install && yarn run build 9 | command: yarn run watch 10 | 11 | 12 | -------------------------------------------------------------------------------- /langs/de/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/de/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/de/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/de/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/de/tutorials/bindings_events/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/de/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | Manchmal unterstützen die eigenen Komponenten eine variable Zahl an Attributen und es macht daher Sinn, diese als Objekt statt einzeln zu übergeben. Das ist besonders dann der Fall, wenn man ein DOM-Element in eine Komponente kapselt, eine gängige Praxis in Design-Systemen. 2 | 3 | Für diesen Fall können wir den Spread-Operator verwenden `...`. 4 | 5 | Wir können damit ein Objekt mit einer beliebigen Zahl von Eigenschaften übergeben: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/de/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | Das ``-Tag ist nützlich, wenn man von Daten abhängig rendert. Es lässt einen entweder einen String für ein natives Element oder eine Komponenten-Funktion übergeben und rendert dieses mit dem Rest der übergebenen Props. 2 | 3 | Das ist häufig kompakter als eine Menge an ``- oder ``-Komponenten. 4 | 5 | In diesem Beispiel können wir die `Switch`-Anweisung ersetzen: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | mit: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | Ein JavaScript-Fehler aus dem User Interface sollte nicht die ganze App kaputt machen. Fehlerbegrenzungen (Error Boundaries) sind Komponenten, die solche Fehler aus ihren Kind-Elementen auffangen, die Fehler vermerken und eine Ausweichansicht anzeigen statt des kaputten Komponentenbaumes. 2 | 3 | Eine Komponente hat unser Beispiel kaputtgemacht. Wir stecken sie in eine Fehlerbegrenzung, die den Fehler anzeigt. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_index/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n
\n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | 10 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | Zur Bequemlichkeit hat Solid einen `on`-Helfer, der es ermöglicht, ausdrücklich Abhängigkeiten einer Berechnung zu definieren. Das ist hauptsächlich ein Weg, um prägnant zu zeigen, welche Signale verfolgt werden (und andere nicht zu verfolgen). Zusätzlich bietet `on` eine `defer`-Option, die es erlaubt, die initiale Berechnung nicht auszuführen und erst bei der ersten Änderung zu laufen. 2 | 3 | Lassen wir unseren Effekt nur laufen, wenn `a` aktualisiert wird und verzögern die Ausführung, bis der Wert sich erstmals ändert: 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/de/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/de/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/en/tutorials/bindings_events/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/en/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes your components and elements accept a variable number of attributes and it makes sense to pass them down as an object instead of individually. This is especially true when wrapping a DOM element in a component, a common practice when making design systems. 2 | 3 | For this we use the spread operator `...`. 4 | 5 | We can pass an object with a variable number of properties: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/en/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | The `` tag is useful when you render from data. It lets you pass either a string for a native element or a component function and it will render that with the rest of the provided props. 2 | 3 | This is often more compact than writing a number of `` or `` components. 4 | 5 | In the example, we can replace the `` statement: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | with: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | A JavaScript error originating in the UI shouldn’t break the whole app. Error boundaries are components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. 2 | 3 | A component has crashed our example. Let's wrap it in an Error Boundary that displays the error. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_index/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes it's beneficial to insert elements outside the normal flow of the app. Z-indexes are sometimes insufficient to deal with render contexts for floating elements like Modals. 2 | 3 | Solid has a `` component whose child content will be inserted at the location of your choosing. By default, its elements will be rendered in a `
` in the `document.body`. 4 | 5 | In the example, we see our information popup get cut off. We can solve this by pulling it out of the flow by wrapping the element in a ``: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_switch/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes you need to deal with conditionals with more than 2 mutual exclusive outcomes. For this case, we have the `` and `` components modeled roughly after JavaScript's `switch`/`case`. 2 | 3 | It will try in order to match each condition, stopping to render the first that evaluates to true. Failing all of them, it will render the fallback. 4 | 5 | In the example, we can replace our nested `` components with this: 6 | 7 | ```jsx 8 | {x()} is between 5 and 10

}> 9 | 10}> 10 |

{x()} is greater than 10

11 |
12 | x()}> 13 |

{x()} is less than 5

14 |
15 |
16 | ``` 17 | -------------------------------------------------------------------------------- /langs/en/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | For convenience, Solid has an `on` helper that enables setting explicit dependencies for our computations. This is mostly used as a terse way to be even more explicit about which Signals are tracked (and not track any other Signals, even if they are read). In addition, `on` provides a `defer` option that allows the computation not to execute immediately and only run on first change. 2 | 3 | Let's have our Effect run only when `a` updates, and defer execution until the value changes: 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_untrack/lesson.md: -------------------------------------------------------------------------------- 1 | It's sometimes desirable to have Signal reads not be tracked, even inside a reactive context. Solid provides the `untrack` helper as a way to prevent the wrapping computation from tracking any reads. 2 | 3 | Let's suppose we did not want to log in our example when `b` changes. We can untrack the `b` signal by changing our effect to the following: 4 | 5 | ```js 6 | createEffect(() => { 7 | console.log(a(), untrack(b)); 8 | }); 9 | ``` 10 | Since Signals are functions, they can be passed directly, but `untrack` can wrap functions with more complex behavior. 11 | 12 | Even though `untrack` disables tracking of reads, it has no effect on writes which still happen and notify their observers. 13 | -------------------------------------------------------------------------------- /langs/en/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | Tag `` berguna saat kamu merender sesuatu dari data. Ini dapat meneruskan string untuk elemen asli atau fungsi komponen dan akan merendernya dengan sisa props yang diberikan. 2 | 3 | Ini lebih ringkas daripada menulis banyak komponen `` atau ``. 4 | 5 | Di contoh ini, kita dapat mengganti `` dengan: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | dengan: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | Kesalahan/error JavaScript pada UI seharusnya tidak merusak seluruh aplikasi. Error boundaries adalah komponen yang menangkap error JavaScript di mana pun di pohon komponen turunannya, mencatat kesalahan tersebut, dan menampilkan UI fallback, bukan pohon komponen yang error. 2 | 3 | Dalam contoh ini, ada komponen yang membuat aplikasi rusak/crash. Mari kita bungkus dalam Error boundaries yang menampilkan error. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_index/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | Ini akan berguna untuk menyisipkan elemen di luar alur normal aplikasi. z-index terkadang tidak cukup untuk menangani konteks render untuk elemen mengambang seperti Modals. 2 | 3 | Solid memiliki komponen `` yang konten turunannya akan disisipkan di lokasi yang kamu pilih. Secara default, elemennya akan dirender dalam `
` di `document.body`. 4 | 5 | Dalam contoh ini, ada popup informasi yang terpotong. Kita dapat mengatasi ini dengan menariknya keluar dari alur dengan membungkus elemen dalam ``: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/id/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/it/tutorials/bindings_events/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/it/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes your components and elements accept a variable number of attributes and it makes sense to pass them down as an object instead of individually. This is especially true when wrapping a DOM element in a component, a common practice when making design systems. 2 | 3 | For this we use the spread operator `...`. 4 | 5 | We can pass an object with a variable number of properties: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/it/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | The `` tag is useful when you render from data. It lets you pass either a string for a native element or a component function and it will render that with the rest of the provided props. 2 | 3 | This is often more compact than writing a number of `` or `` components. 4 | 5 | In the example, we can replace the `` statement: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | with: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | A JavaScript error originating in the UI shouldn’t break the whole app. Error boundaries are components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. 2 | 3 | A component has crashed our example. Let's wrap it in an Error Boundary that displays the error. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_index/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes it's beneficial to insert elements outside the normal flow of the app. Z-indexes are sometimes insufficient to deal with render contexts for floating elements like Modals. 2 | 3 | Solid has a `` component whose child content will be inserted at the location of your choosing. By default, its elements will be rendered in a `
` in the `document.body`. 4 | 5 | In the example, we see our information popup get cut off. We can solve this by pulling it out of the flow by wrapping the element in a ``: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_switch/lesson.md: -------------------------------------------------------------------------------- 1 | Sometimes you need to deal with conditionals with more than 2 mutual exclusive outcomes. For this case, we have the `` and `` components modeled roughly after JavaScript's `switch`/`case`. 2 | 3 | It will try in order to match each condition, stopping to render the first that evaluates to true. Failing all of them, it will render the fallback. 4 | 5 | In the example, we can replace our nested `` components with this: 6 | 7 | ```jsx 8 | {x()} is between 5 and 10

}> 9 | 10}> 10 |

{x()} is greater than 10

11 |
12 | x()}> 13 |

{x()} is less than 5

14 |
15 |
16 | ``` 17 | -------------------------------------------------------------------------------- /langs/it/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Ciao!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Ciao da Solid
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | For convenience, Solid has an `on` helper that enables setting explicit dependencies for our computations. This is mostly used as a terse way to be even more explicit about which Signals are tracked (and not track any other Signals, even if they are read). In addition, `on` provides a `defer` option that allows the computation not to execute immediately and only run on first change. 2 | 3 | Let's have our Effect run only when `a` updates, and defer execution until the value changes: 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_untrack/lesson.md: -------------------------------------------------------------------------------- 1 | It's sometimes desirable to have Signal reads not be tracked, even inside a reactive context. Solid provides the `untrack` helper as a way to prevent the wrapping computation from tracking any reads. 2 | 3 | Let's suppose we did not want to log in our example when `b` changes. We can untrack the `b` signal by changing our effect to the following: 4 | 5 | ```js 6 | createEffect(() => { 7 | console.log(a(), untrack(b)); 8 | }); 9 | ``` 10 | Since Signals are functions, they can be passed directly, but `untrack` can wrap functions with more complex behavior. 11 | 12 | Even though `untrack` disables tracking of reads, it has no effect on writes which still happen and notify their observers. 13 | -------------------------------------------------------------------------------- /langs/it/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/async_lazy/lesson.md: -------------------------------------------------------------------------------- 1 | ほとんどのバンドラー(Webpack, Rollup, Parcel, Vite など)は、動的インポートを使用する際にコード分割を自動的に処理します。Solid の `lazy` メソッドでは、コンポーネントの動的インポートをラップして遅延ロードを行うことができます。出力されるのは、JSX テンプレートで通常どおりに使用できるコンポーネントです。ただし、内部的には、最初にレンダリングされるときに、基となるインポートされたコードを動的にロードし、コードが利用可能になるまでレンダリングのブランチを停止するという例外があります。 2 | 3 | `lazy` を使用するには、import 文を置き換えます: 4 | ```js 5 | import Greeting from "./greeting"; 6 | ``` 7 | このように: 8 | ```js 9 | const Greeting = lazy(() => import("./greeting")); 10 | ``` 11 | 12 | これでもロードが早すぎて見えないかもしれません。しかし、ローディングをより見やすくしたい場合は、偽の遅延を追加します。 13 | 14 | ```js 15 | const Greeting = lazy(async () => { 16 | // 遅延をシミュレート 17 | await new Promise(r => setTimeout(r, 1000)) 18 | return import("./greeting") 19 | }); 20 | ``` 21 | -------------------------------------------------------------------------------- /langs/ja/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // 遅延をシミュレート\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_events/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_forward_refs/lesson.md: -------------------------------------------------------------------------------- 1 | コンポーネント内から親への参照を公開したい場合が多々あります。そのためには、やはり `ref` 属性を使用します。外から見ると、コンポーネントの `ref` を使用することは、ネイティブ要素の `ref` を使用することと非常によく似ています。代入される変数やコールバック関数を渡すことができます。 2 | 3 | ただし、その `ref` を内部の要素に接続して転送させるのはコンポーネント作者の責任です。そのためには、`props.ref` を利用します。これは、どちらかのタイプの `ref` が指定されていればコールバック形式ですが、ほとんどの場合、このコンポーネントの JSX 内の要素やコンポーネントの `ref` 属性に直接割り当てることになるので、この詳細はほとんどわかりません。 4 | 5 | ロゴを再びアニメーションさせるには、`canvas.tsx` から ref を転送する必要があります: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | コンポーネントや要素が不定の数の属性を受け入れる場合、それらを個別に渡すのではなく、オブジェクトとして渡す方が理にかなっている場合があります。これは、DOM 要素をコンポーネントでラップする場合に特に当てはまり、デザインシステムを作る際にはよくあることです。 2 | 3 | これには、スプレッド演算子 `...` を使用します。 4 | 5 | 不定の数のプロパティを持つオブジェクトを渡すことができます: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_style/lesson.md: -------------------------------------------------------------------------------- 1 | Solid の `style` 属性は、スタイルの文字列かオブジェクトのどちらかを受け付けます。 2 | ただし、オブジェクトの形式は `Element.prototype.style` とは異なり、代わりに `style.setProperty` を呼び出すためのラッパーとなります。これは、キーが "backgroundColor "ではなく "background-color "のようにダッシュケース形式をとり、単位は明示的に指定する必要がある(例: `width: 500` ではなく `width: 500px`)ということです。 3 | 4 | 5 | これは CSS 変数を設定できるということでもあります: 6 | 7 | ```js 8 |
9 | ``` 10 | 11 | それでは、いくつかのインラインスタイルを使って、div をアニメーションしてみましょう: 12 | ```jsx 13 |
18 | Some Text 19 |
20 | ``` 21 | -------------------------------------------------------------------------------- /langs/ja/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | `` タグは、データを元にレンダリングするときに便利です。ネイティブ要素を表す文字列やコンポーネント関数を渡すと、提供された残りの props でレンダリングできます。 2 | 3 | `` や `` コンポーネントをたくさん書くよりコンパクトになることが多いです。 4 | 5 | この例では、この `` 文を: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | 以下に置き換えることができます: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>ここには到達しない\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | UI で発生した JavaScript エラーがアプリ全体を壊してはいけません。ErrorBoundary は、子コンポーネントツリーの任意の場所で JavaScript エラーをキャッチし、それらのエラーをログに記録し、クラッシュしたコンポーネントツリーの代わりにフォールバックの UI を表示するコンポーネントです。 2 | 3 | この例では、コンポーネントがクラッシュしました。これをエラーを表示する ErrorBoundary でラップしましょう。 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>ここには到達しない\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_index/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | アプリの通常のフローの外に要素を挿入することが有益な場合があります。モーダルのようなフローティング要素のレンダリングコンテキストを処理するには、z-index では不十分な場合があります。 2 | 3 | Solid には `` コンポーネントがあり、その子コンテンツは選択した場所に挿入されます。デフォルトでは、その要素は `document.body` 内の `
` にレンダリングされます。 4 | 5 | この例では、情報のポップアップが途切れています。これを解決するには、要素を `` でラップして、フローから引き出す必要があります: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_show/lesson.md: -------------------------------------------------------------------------------- 1 | JSX では、JavaScript を使ってテンプレート内のロジックフローを制御できます。しかし仮想 DOM がない場合、`Array.prototype.map` のようなものを単純に使用すると、更新のたびにすべての DOM ノードを無駄に再作成してしまいます。その代わりに、リアクティブライブラリではテンプレートヘルパーを使用するのが一般的です。Solid では、それらをコンポーネントでラップしています。 2 | 3 | 最も基本的な制御フローは、条件分岐です。Solid のコンパイラは賢く、三項演算子(`a ? b : c`)やブーリアンの式(`a && b`)を最適に処理します。しかし、多くの場合は Solid の `` コンポーネントを使用する方が読みやすくになります。 4 | 5 | この例では、現在の状態(ユーザーがログインしているかどうか)を反映した適切なボタンだけを表示したいと思います。JSX を次のように更新します: 6 | ```jsx 7 | Log in} 10 | > 11 | 12 | 13 | ``` 14 | この `fallback` プロパティは `else` の役割を果たし、`when` に渡された条件が `true` でない場合に表示されます。 15 | 16 | これで、ボタンをクリックすると、期待通り交互に変化します。 17 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_switch/lesson.md: -------------------------------------------------------------------------------- 1 | 場合によっては、2 つ以上の排他的な結果を持つ条件式を扱う必要があります。このような場合には、JavaScript の `switch`/`case` を大まかにモデル化した `` と `` のコンポーネントを用意しました。 2 | 3 | 各条件にマッチするかどうかを順に試し、最初に true と評価されたものをレンダリングして停止します。すべてに失敗した場合は、フォールバックをレンダリングします。 4 | 5 | この例では、ネストした `` コンポーネントを次のように置き換えることができます: 6 | 7 | ```jsx 8 | {x()} is between 5 and 10

}> 9 | 10}> 10 |

{x()} is greater than 10

11 |
12 | x()}> 13 |

{x()} is less than 5

14 |
15 |
16 | ``` 17 | -------------------------------------------------------------------------------- /langs/ja/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_derived/lesson.md: -------------------------------------------------------------------------------- 1 | JSX で Signal にアクセスすると、その Signal が変化したときに自動的にビューが更新されることを見てきました。しかし、コンポーネント関数自体は一度しか実行されません。 2 | 3 | Signal を関数でラップすることで、Signal に依存する新しい式を作ることができます。Signal にアクセスする関数は、実質的に Signal でもあります。ラップされた Signal が変化すると、読み込み側も更新されます。 4 | 5 | それでは、`doubleCount` 関数を導入して、2 倍カウントするように Counter を更新してみましょう: 6 | 7 | ```jsx 8 | const doubleCount = () => count() * 2; 9 | ``` 10 | 11 | そして、JSX の中で Signal のように `doubleCount` を呼び出すことができます: 12 | ```jsx 13 | return
Count: {doubleCount()}
; 14 | ``` 15 | 16 | このような関数を「派生 Signal」と呼ぶのは、アクセスする Signal からリアクティビティを得るためです。派生 Signal は、それ自体が値を格納するわけではありません(派生 Signal を作成しても一度も呼び出さなければ、未使用の関数と同様に Solid の出力から取り除かれます)が、派生 Signal に依存する Effect を更新したり、ビューに含まれている場合には再レンダリングをトリガーします。 17 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/lifecycles_oncleanup/lesson.md: -------------------------------------------------------------------------------- 1 | フレームワークの中には、クリーンアップメソッドを副作用やライフサイクルメソッドの戻り値として組み合わせているものもあります。Solid のレンダーツリー内のすべてのものは、(おそらく不活性な)Effect の中に存在し、ネストできるので、`onCleanup` をファーストクラスのメソッドにしました。任意のスコープでこのメソッドを呼び出すことができ、そのスコープが再評価のトリガーを受けたときや、最終的に廃棄されたときに実行されます。 2 | 3 | コンポーネントや Effect の中で使用してください。また、カスタムディレクティブにも使用できます。リアクティブシステムの同期実行の一部となるものであれば、どこでも使用できます。 4 | 5 | はじめに紹介した Signal の例では、自分自身の後始末をしませんでした。`setInterval` の呼び出しを次のように置き換えて修正しましょう: 6 | 7 | ```js 8 | const timer = setInterval(() => setCount(count() + 1), 1000); 9 | onCleanup(() => clearInterval(timer)); 10 | ``` 11 | -------------------------------------------------------------------------------- /langs/ja/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/lifecycles_onmount/lesson.md: -------------------------------------------------------------------------------- 1 | Solid では、すべてがリアクティブシステムによって左右されるため、ライフサイクル関数はほとんどありません。リアクティブシステムは同期的に作成・更新されるため、唯一のスケジューリングは、更新の最後にプッシュされる Effect になります。 2 | 3 | 基本的な作業をしている開発者はこのような考え方をしないことが多いので、少し簡単にするために `onMount` というエイリアスを作りました。`onMount` は単なる`createEffect` の呼び出しで、非追跡、つまり再実行されません。これは単なる Effect の呼び出しですが、最初のレンダリングがすべて完了した後、コンポーネントに対して一度だけ実行されることを確信して使用できます。 4 | 5 | 6 | 7 | 8 | それでは、`onMount` フックを使って、写真を取得してみましょう: 9 | ```js 10 | onMount(async () => { 11 | const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`); 12 | setPhotos(await res.json()); 13 | }); 14 | ``` 15 | 16 | ライフサイクルはブラウザでしか実行されないので、`onMount` にコードを置くことで、SSR 時にサーバー上で実行されないというメリットがあります。この例ではデータのフェッチを行っていますが、通常は真のサーバー/ブラウザ連携のために Solid の Resource を使用します。 17 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_batch/lesson.md: -------------------------------------------------------------------------------- 1 | Solid のリアクティビティは同期的で、変更の次の行で DOM が更新されることになります。Solid のきめ細かいレンダリングは、リアクティブシステムにおける更新の伝搬にすぎないので、ほとんどの場合、これは完全に問題ありません。関連性のない変更が二度「レンダリング」されても、実際には無駄な作業ではありません。 2 | 3 | もし変更が関連していたらどうでしょうか? Solid の `batch` ヘルパーは、複数の変更をキューに入れて、オブザーバーに通知する前にすべてを同時に適用できます。バッチ内では、更新された Signal の値は完了するまでコミットされません。 4 | 5 | この例では、ボタンをクリックしたときに両方の名前を代入していて、レンダリングされた更新を 2 回トリガーしています。ボタンをクリックすると、コンソールにログが表示されます。それでは、`set` の呼び出しを batch でラップしましょう。 6 | 7 | ```js 8 | const updateNames = () => { 9 | console.log("Button Clicked"); 10 | batch(() => { 11 | setFirstName(firstName() + "n"); 12 | setLastName(lastName() + "!"); 13 | }) 14 | } 15 | ``` 16 | これで完了です。これで、チェンジセット全体に対して一度だけ通知するようになりました。 17 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | 便宜上、Solid には `on` ヘルパーが用意されており、計算のための明示的な依存関係を設定できます。これは主に、どの Signal を追跡するかをより明確にするための簡潔な方法として使用されます(他の Signal が読み込まれていても追跡しません)。さらに `on` は、計算をすぐに実行せず、最初の変更時にのみ実行できるようにする `defer` オプションを提供します。 2 | 3 | `a` が更新されたときだけ Effect を実行し、値が変わるまで実行を延期するようにしてみましょう: 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_untrack/lesson.md: -------------------------------------------------------------------------------- 1 | たとえリアクティブコンテキスト内であっても、Signal の読み取りを追跡しないことが望ましい場合があります。Solid では、ラッピングの計算で読み取りを追跡しないようにする方法として、`untrack` ヘルパーを提供しています。 2 | 3 | この例では、`b` が変更されたときに、ログ出したくないとします。Effect を以下のように変更することで、`b` Signal の追跡を解除できます: 4 | 5 | ```js 6 | createEffect(() => { 7 | console.log(a(), untrack(b)); 8 | }); 9 | ``` 10 | Signal は関数なので直接渡すことができますが、`untrack` はより複雑な動作をする関数をラップできます。 11 | 12 | `untrack` は読み取りの追跡を無効にしますが、書き込みには何の影響もありません。書き込みは依然として発生し、オブザーバーに通知されます。 13 | -------------------------------------------------------------------------------- /langs/ja/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/async_lazy/lesson.md: -------------------------------------------------------------------------------- 1 | 대부분의 번들러(Webpack, Rollup, Parcel, Vite)는 동적 임포트를 사용하는 경우 자동으로 코드 분할을 처리합니다. 2 | Solid의 `lazy` 메서드를 사용하면 지연된 로딩을 위해 컴포넌트의 동적 임포트를 래핑할 수 있습니다. 3 | 반환값은 JSX 템플릿에서 사용할 수 있는 컴포넌트입니다. 다만 처음 렌더링될 때 내부적으로는 임포트한 코드를 동적으로 로드하여, 코드를 사용할 수 있을 때까지 해당 렌더링 분기를 중지합니다. 4 | 5 | `lazy`를 사용하려면, 다음과 같은 임포트 문을 6 | ```js 7 | import Greeting from "./greeting"; 8 | ``` 9 | 10 | 아래와 같이 변경합니다. 11 | ```js 12 | const Greeting = lazy(() => import("./greeting")); 13 | ``` 14 | 15 | 변경하더라도 너무 빨리 로드되어 눈으로 확인하기는 힘들기 때문에, 좀 더 잘 보이도록 다음과 같이 딜레이를 추가합니다. 16 | 17 | ```js 18 | const Greeting = lazy(async () => { 19 | // simulate delay 20 | await new Promise(r => setTimeout(r, 1000)) 21 | return import("./greeting") 22 | }); 23 | ``` 24 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_forward_refs/lesson.md: -------------------------------------------------------------------------------- 1 | 컴포넌트 내부의 ref를 부모에게 노출하고 싶은 경우가 많이 있는데, Solid에서는 `ref` 속성을 사용합니다. 2 | 외부에서 컴포넌트에 `ref`를 사용하는 것은 네이티브 엘리먼트에서 `ref`를 사용하는 것과 매우 유사하게 작동하는데, 할당할 변수나 콜백 함수를 전달할 수 있습니다. 3 | 4 | 하지만, 컴포넌트 작성자는 해당 `ref`를 내부 엘리먼트에 연결하여 다시 전달해야 하며, ref 전달을 위해 `props.ref`를 활용할 수 있습니다. 5 | `ref`의 타입이 제공되는 경우 콜백 형식이지만, 대부분의 경우 해당 컴포넌트의 JSX에 있는 엘리먼트나 컴포넌트의 `ref` 속성에 직접 할당할 가능성이 높기 떄문에, 이러한 세부 정보는 대부분 숨겨져 있습니다. 6 | 7 | 로고에 애니메이션을 다시 적용하려면, ref를 `canvas.tsx`에 전달해야 합니다: 8 | 9 | ```jsx 10 | 11 | ``` 12 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | 때로는 컴포넌트와 엘리먼트에서 다수의 속성을 받아서 아래쪽으로 전달할 때 하나씩 전달하기보다 객체로 전달하는 것이 합리적입니다. 2 | 디자인 시스템을 만들 때 일반적인 관행인 컴포넌트 안에 DOM 엘리먼트를 래핑할 때 특히 그렇습니다. 3 | 4 | 이런 경우 스프레드 연산자(`...`)를 사용합니다. 5 | 6 | 이렇게 하면 다수의 속성을 객체로 전달할 수 있습니다: 7 | 8 | ```jsx 9 | 10 | ``` 11 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_style/lesson.md: -------------------------------------------------------------------------------- 1 | Solid의 `style` 속성은 스타일 문자열이나 객체를 받습니다. 2 | 객체는 `Element.prototype.style`과는 다르며, `style.setProperty`를 호출하기 위한 래퍼입니다. 3 | 이는 "backgroundColor"가 아닌 "background-color"와 같은 dash-case 형식을 받아들이며, 단위를 반드시 지정해야 합니다. 예를 들면, `width: 500` 대신 `width: 500px`를 사용해야 합니다. 4 | 5 | 또한 CSS 변수를 설정할 수도 있습니다: 6 | 7 | ```js 8 |
9 | ``` 10 | 11 | 인라인 스타일을 사용해 div에 애니메이션을 추가해보겠습니다: 12 | ```jsx 13 |
18 | Some Text 19 |
20 | ``` 21 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | `` 태그는 데이터를 렌더링할 때 유용합니다. 네이티브 엘리먼트 문자열이나 컴포넌트 함수를 전달할 수 있으며, 제공된 나머지 props를 사용해 렌더링됩니다. 2 | 3 | 이렇게 하면 여러 개의 `` 또는 `` 컴포넌트를 작성하는 것보다 종종 더 간결합니다. 4 | 5 | 이 예제에서 다음과 같은 `` 문을: 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | ``` 13 | 14 | 아래와 같이 바꿀 수 있습니다: 15 | 16 | ```jsx 17 | 18 | ``` 19 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | UI에서 발생하는 자바스크립트 오류로 전체 앱이 중단되면 안됩니다. `ErrorBoundary` 컴포넌트는 자식 컴포넌트 트리에서 발생하는 자바스크립트 에러를 캐치해서, 에러를 기록하고, 충돌이 발생한 컴포넌트 트리 대신 fallback UI를 표시합니다. 2 | 3 | 이 예제에서는 컴포넌트 에러로 인해 제대로 표시되지 않습니다. 에러가 발생하는 컴포넌트를 `ErrorBoundary`로 래핑해 봅시다. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | 때로는 앱의 정상적인 플로우 외부에 엘리먼트를 삽입하는 것이 더 좋은 경우가 있습니다. Z-index 는 때때로 모달과 같은 플로팅 엘리먼트에 대한 렌더링 컨텍스트를 처리하기에 부족한 경우가 있습니다. 2 | 3 | Solid 에는 선택한 위치에 자식 콘텐츠가 삽입되는 `` 컴포넌트가 있습니다. 기본적으로 해당 엘리먼트는 `document.body`의 `
`에 렌더링됩니다. 4 | 5 | 이 예제에서, 팝업창이 잘리는 것을 볼 수 있습니다. 엘리먼트를 ``로 래핑하여 플로우에서 뺴내어 이 문제를 해결할 수 있습니다: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_switch/lesson.md: -------------------------------------------------------------------------------- 1 | 때로는 2개 이상의 상호 배타적 결과가 있는 조건문을 처리해야 합니다. 이런 경우를 위해 자바스크립트의 `switch`/`case`를 본떠 만든 ``, `` 컴포넌트가 있습니다. 2 | 3 | 각 조건을 비교해서 조건식이 true인 첫 번째 항목을 렌더링하며, 모두 매칭되지 않을 경우 fallback을 렌더링합니다. 4 | 5 | 이 예제에서 중첩된 `` 컴포넌트를 다음과 같이 바꿀 수 있습니다: 6 | 7 | ```jsx 8 | {x()} is between 5 and 10

}> 9 | 10}> 10 |

{x()} is greater than 10

11 |
12 | x()}> 13 |

{x()} is less than 5

14 |
15 |
16 | ``` 17 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_derived/lesson.md: -------------------------------------------------------------------------------- 1 | JSX에서 시그널에 액세스하는 경우 해당 시그널이 변경되면 뷰가 자동으로 업데이트되는 것을 보았습니다. 하지만 컴포넌트 함수 자체는 한 번만 실행됩니다. 2 | 3 | 시그널을 함수로 래핑하여 시그널에 의존하는 새로운 표현식을 생성할 수 있습니다. 시그널에 액세스하는 함수도 시그널입니다: 래핑된 시그널이 변경되면 시그널에 의존하는 다른 시그널도 업데이트합니다. 4 | 5 | `doubleCount` 함수를 사용해 Counter의 카운트를 2씩 증가해보겠습니다: 6 | 7 | ```jsx 8 | const doubleCount = () => count() * 2; 9 | ``` 10 | 11 | JSX에서 시그널처럼 `doubleCount`를 호출할 수 있습니다: 12 | ```jsx 13 | return
Count: {doubleCount()}
; 14 | ``` 15 | 16 | 이러한 _파생된 시그널_ 을 호출하는 이유는, 액세스하는 시그널에서 반응성을 얻기 때문입니다. 파생된 시그널은 자체에 값을 저장하지 않습니다(파생된 시그널을 생성하고 호출하지 않으면, Solid는 미사용 함수처럼 결과물에서 제외합니다). 하지만 의존하는 모든 Effect를 업데이트하고, 뷰에 포함된 경우 렌더링을 트리거합니다. 17 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/lifecycles_oncleanup/lesson.md: -------------------------------------------------------------------------------- 1 | 일부 프레임워크는 사이드 이펙트나 라이프사이클 메서드의 반환값을 클린업 메서드로 사용합니다. Solid 렌더 트리의 모든 것이 (비활성일 수도 있음) 이펙트 안에 있고 중첩될 수 있기 때문에, `onCleanup` 함수를 일급 메서드로 만들었습니다. 모든 스코프에서 이 함수를 호출할 수 있으며, 해당 스코프가 재평가를 위해 트리거되고 최종적으로 폐기될 때 실행됩니다. 2 | 3 | 이 함수는 이펙트, 컴포넌트, 커스텀 디렉티브 뿐만 아니라 리액티브 시스템의 동기 실행이 일어나는 거의 모든 곳에서 사용하면 됩니다. 4 | 5 | 1장에 있었던 시그널 예제는 클린업 메서드를 사용해 정리하지 않았습니다. `setInterval` 호출을 다음과 같이 변경해 문제를 해결해 보겠습니다: 6 | 7 | ```js 8 | const timer = setInterval(() => setCount(count() + 1), 1000); 9 | onCleanup(() => clearInterval(timer)); 10 | ``` 11 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/lifecycles_onmount/lesson.md: -------------------------------------------------------------------------------- 1 | Solid는 리액티브 시스템에 의해 생성, 소멸되기 때문에 라이프사이클이라고 할 만한 것이 거의 없습니다. 리액티브 시스템은 동기식으로 생성되고 업데이트되므로, 업데이트가 끝날 때까지 푸시되는 이펙트만 스케줄링됩니다. 2 | 3 | 우리는 기본적인 작업을 하는 개발자들이 이런 식으로 생각하지 않는다는 것을 발견했습니다. 그래서 이해를 쉽게 하기 위해 트래킹하지 않는 (재실행하지 않는) `createEffect` 호출을 `onMount`라는 별칭으로 지정했습니다. 이것은 단지 이펙트 호출일 뿐이지만, 모든 초기 렌더링이 완료되면 컴포넌트당 한 번만 실행된다는 확신을 가지고 사용할 수 있습니다. 4 | 5 | 사진을 불러오기 위해 `onMount` 훅을 사용해 봅시다: 6 | ```js 7 | onMount(async () => { 8 | const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`); 9 | setPhotos(await res.json()); 10 | }); 11 | ``` 12 | 13 | 라이프사이클은 브라우저에서만 실행되므로, `onMount`에 있는 코드는 SSR 동안 서버에서 실행되지 않는다는 장점이 있습니다. 이 예제에서는 데이터를 가져오고 있지만, 일반적으로는 서버/브라우저 코디네이션을 위해 Solid의 Resource를 사용합니다. 14 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | 편의를 위해 Solid는 계산에 필요한 디펜던시를 명시적으로 설정할 수 있도록 `on` 헬퍼를 제공합니다. 2 | 이는 주로 어떤 시그널이 추적되는지에 대한 명시적이고 간결한 방법으로 사용됩니다(다른 시그널들을 읽더라도 이들은 추적하지 않음). 추가로 `on`은 `defer` 옵션을 제공하는데, 이를 사용하면 계산이 즉시 실행되지 않고 첫번째 변경시에만 실행되도록 할 수 있습니다. 3 | 4 | 이펙트가 `a`가 변경된 경우만 실행되도록 하고, 값이 변경될 때까지 실행을 연기하도록 해 보겠습니다: 5 | 6 | ```js 7 | createEffect(on(a, (a) => { 8 | console.log(a, b()); 9 | }, { defer: true })); 10 | ``` 11 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_untrack/lesson.md: -------------------------------------------------------------------------------- 1 | 때로는 리액티브 컨텍스트 내에서도 시그널 읽기 작업을 추적하지 않는 것이 필요합니다. 2 | Solid는 래핑 계산이 읽기 작업을 추적하지 못하도록 하기 위해 `untrack` 이라는 헬퍼를 제공합니다. 3 | 4 | 예제에서 `b`가 변경되었을 때, 로그를 출력하고 싶지 않다고 가정해 보겠습니다. 5 | 이펙트를 다음과 같이 변경하여 `b` 시그널을 추적 해제할 수 있습니다: 6 | 7 | ```js 8 | createEffect(() => { 9 | console.log(a(), untrack(b)); 10 | }); 11 | ``` 12 | 시그널은 함수이기 때문에 직접 전달할 수 있지만, `untrack`은 더 복잡한 동작으로 함수를 래핑할 수 있습니다. 13 | 14 | `untrack`이 읽기 추적을 비활성화하더라도, 쓰기 작업에는 영향을 미치지 않기 떄문에 쓰기 작업은 여전히 추적되고 옵저버에 알림이 가게 됩니다. 15 | -------------------------------------------------------------------------------- /langs/ko-kr/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ru/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ru/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_events/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n }\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | Иногда наши компоненты и элементы получают несколько атрибутов и в таком случае имеет смысл оформить их в виде объекта, а не передавать по одному. Это довольно частый когда мы оборачиваем DOM элемент в компонент, например, при создании систем дизайна. 2 | 3 | Когда нам это необходимо мы можем использовать оператор расширения `...` (`spread operator`). 4 | 5 | Таким образом мы можем удобно передавать несколько атрибутов: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_style/lesson.md: -------------------------------------------------------------------------------- 1 | Атрибут `style` в Solid принимает в себя строки и объекты. Однако объект отличается от `Element.prototype.style` и вместо этого мы используем его как обертку для вызова `style.setProperty`. Это значит, что ключи принимают форму через-дефис (`dash-case`), например `backgroundColor` становится `background-color`. Такая форма позволяет нам использовать CSS переменные: 2 | 3 | ```js 4 |
5 | ``` 6 | 7 | Давайте анимируем наш div с помощью нескольких инлайн (`inline`) стилей: 8 | 9 | ```jsx 10 |
15 | Some Text 16 |
17 | ``` -------------------------------------------------------------------------------- /langs/ru/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | Ошибка JavaScript, возникающая в UI, не должна нарушать работу всего приложения. Границы ошибок - это компоненты, которые перехватывают ошибки JavaScript в любом месте своего дочернего дерева компонентов, регистрируют эти ошибки и отображают резервный пользовательский интерфейс вместо дерева компонентов, в котором произошел сбой. 2 | 3 | В нашем примере произошел сбой компонента. Давайте заключим его в границу ошибки, которая отображает ошибку. 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n { id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n { id: 'z_AbfPXTKms', name: 'Maru' },\n { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n ]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | В вашем приложении может возникнуть необходимость отрендерить элементы вне обычного потока приложения. Не все проблемы с модальными окнами могут быть решены с помощью Z-индексов. 2 | 3 | Специально для решения таких задач в Solid есть компонент , дочерний контент которого будет вставлен в выбранном вами месте. По умолчанию его элементы будут отображаться в
встроенным в `document.body`. 4 | 5 | В этом примере мы видим, что наше всплывающее окно плохо видно. Мы можем решить эту проблему, использовав `: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

{x()} is between 5 and 10

}\n >\n

{x()} is less than 5

\n \n }\n >\n

{x()} is greater than 10

\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

}>\n 10} >\n

{x()} is greater than 10

\n
\n x()}>\n

{x()} is less than 5

\n
\n
\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | 10 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
Hello Solid World!
;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

This is a Header

\n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

This is a Header

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

This is a Paragraph

" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {doubleCount()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n const name = \"Solid\";\n const svg = (
Replace me with an svg
)\n\n return (\n <>\n
Hello {name}!
\n {svg}\n \n )\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
Count: 0
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
Count: {count()}
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | Для удобства Solid имеет функцию-помощник `on`, который позволяет указывать зависимости для наших вычислений явно. Это в основном используется как способ явно указать, какие `Сигналы` должны отслеживаться (и прекратить отслеживать любые другие `Сигналы`, даже если они прочитаны). Кроме того, on предоставляет параметр `defer`, который позволяет вычислению не выполняться немедленно, а запускаться только при первом изменении. 2 | 3 | Давайте запустим наш `Эффект` только при обновлении `a` и отложим выполнение до изменения значения: 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/ru/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/ru/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/async_lazy/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nimport Greeting from \"./greeting\"\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/async_lazy/lesson.md: -------------------------------------------------------------------------------- 1 | 大多数打包器(如 Webpack、Rollup、Parcel、Vite)在使用动态导入时会自动进行代码分割处理。Solid 的 `lazy` 方法允许包装组件的动态导入来实现延迟加载。然后输出一个可以在 JSX 模板中正常使用的组件,它会在第一次渲染时在内部动态加载底层导入的代码,此时会暂停渲染分支直到代码可用。 2 | 3 | 使用 `lazy` 替换 import 语句。 4 | 5 | ```js 6 | import Greeting from "./greeting"; 7 | ``` 8 | 9 | 用下面的代码替换: 10 | 11 | ```js 12 | const Greeting = lazy(() => import("./greeting")); 13 | ``` 14 | 15 | 但是仍然可能因为加载太快而无法看到效果。但是如果想让加载更明显,你可以添加一个模拟延迟。 16 | 17 | ```js 18 | const Greeting = lazy(async () => { 19 | // 模拟延迟 20 | await new Promise((r) => setTimeout(r, 1000)); 21 | return import("./greeting"); 22 | }); 23 | ``` 24 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/async_lazy/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy } from \"solid-js\";\n\nconst Greeting = lazy(() => import(\"./greeting\"));\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/async_suspense/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { lazy, Suspense } from \"solid-js\";\n\nconst Greeting = lazy(async () => {\n // simulate delay\n await new Promise(r => setTimeout(r, 1000))\n return import(\"./greeting\")\n});\n\nfunction App() {\n return (\n <>\n

Welcome

\n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "greeting", 9 | "content": "export default function Greeting(props) {\n return

Hi, {props.name}

\n}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_events/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n const [pos, setPos] = createSignal({x: 0, y: 0});\n\n function handleMouseMove(event) {\n setPos({\n x: event.clientX,\n y: event.clientY\n });\n\t}\n\n return (\n
\n The mouse position is {pos().x} x {pos().y}\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | }, 7 | { 8 | "name": "style", 9 | "type": "css", 10 | "content": "div { width: 100%; height: 100%; }" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_forward_refs/lesson.md: -------------------------------------------------------------------------------- 1 | 在很多情况下,你可能希望将组件内部的 ref 暴露给父组件。我们仍然使用 `ref` 属性来实现。表面上看,在组件上使用 `ref` 与在原生元素上使用 `ref` 非常相似。你可以将要赋值的变量或回调函数传递给 ref。 2 | 3 | 但是,组件作者有义务将该引用连接到内部元素以将其转发回来。为此,我们使用了 `props.ref`。如果 `props.ref` 被定义了,那么这是一个回调形式的 `ref`,但是其中大部分细节对你来说是隐藏的,因为你很可能只是直接将 ref 分配给这个组件的 JSX 中的元素或其中组件之一。 4 | 5 | 为了让 logo 再次动起来,我们需要从 `canvas.tsx` 转发引用。 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_refs/lesson.md: -------------------------------------------------------------------------------- 1 | 在 Solid 中,你可以通过赋值获拿到元素的引用,因为 JSX 会像这下面样创建 DOM 元素: 2 | 3 | ```jsx 4 | const myDiv =
My Element
; 5 | ``` 6 | 7 | 但是,避免将元素拆分并将放在单个连续的 JSX 模板中是有好处的,因为这样可以让 Solid 更好地对元素创建进行优化。 8 | 9 | 与之类似地,在 Solid 中你可以使用 `ref` 属性获取元素的引用。对 Ref 进行赋值类似于上面的例子,赋值行为是在元素创建时,在 DOM 被追加前发生的。 只需声明一个变量,元素引用就会赋值给该变量。 10 | 11 | ```jsx 12 | let myDiv; 13 | 14 |
My Element
; 15 | ``` 16 | 17 | 因此,让我们获取对 canvas 元素的引用并为其设置动画: 18 | 19 | ```jsx 20 | 21 | ``` 22 | 23 | Refs 也可以采用回调函数的形式。这便于封装逻辑,尤其是当你不需要等到元素被追加时。 24 | 25 | ```js 26 |
/* 处理 el... */}>My Element
27 | ``` 28 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_spreads/lesson.md: -------------------------------------------------------------------------------- 1 | 有时你的组件和元素会接收可变数量的属性,将所有属性作为对象而不是单独传递就很有必要了。在组件中包装 DOM 元素时尤其如此,这是制作设计系统时的常见实践。 2 | 3 | 为此,我们使用扩展运算符 `...`。 4 | 5 | 就可以传递一个具有可变数量属性的对象: 6 | 7 | ```jsx 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_style/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return
Some Text
;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_style/lesson.md: -------------------------------------------------------------------------------- 1 | Solid 中的 style 属性接受样式字符串或对象。然而,对象形式不同于 `Element.prototype.style`,Solid 通过调用 `style.setProperty` 的封装来进行样式设置。这意味着键需要采用破折号的形式,如 `background-color` 而不是 `backgroundColor`。 但这意味着我们可以设置 CSS 变量。 2 | 3 | ```js 4 |
5 | ``` 6 | 7 | 让我们用一些内联样式为 div 设置动画: 8 | 9 | ```jsx 10 |
17 | Some Text 18 |
19 | ``` 20 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/bindings_style/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction App() {\n const [num, setNum] = createSignal(0);\n setInterval(() => setNum((num() + 1) % 255), 30)\n\n return (\n
\n Some Text\n
\n );\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_dynamic/lesson.md: -------------------------------------------------------------------------------- 1 | `` 标签处理根据数据渲染时很有用。`` 可以让你将元素的字符串或组件函数传递给它,并使用提供的其余 props 来渲染组件。 2 | 3 | 这通常比编写多个 `` 或 `` 组件更简练。 4 | 5 | 在示例中,我们可以替换 `` 语句 6 | 7 | ```jsx 8 | }> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ``` 17 | 18 | 使用以下代码进行替换: 19 | 20 | ```jsx 21 | 22 | ``` 23 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_error_boundary/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_error_boundary/lesson.md: -------------------------------------------------------------------------------- 1 | 源自 UI 的 JavaScript 错误不应破坏整个应用程序。错误边界(ErrorBoundary)是一个可以捕获子组件树任何位置产生的 JavaScript 错误,错误边界(ErrorBoundary) 会记录这些错误,并显示回退 UI 而非崩溃的组件树。 2 | 3 | 示例中,有一个组件使得我们的应用崩溃了。让我们将代码包裹在一个显示错误的错误边界(ErrorBoundary)组件中。 4 | 5 | ```jsx 6 | err}> 7 | 8 | 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_error_boundary/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { ErrorBoundary } from \"solid-js\";\n\nconst Broken = (props) => {\n throw new Error(\"Oh No\");\n return <>Never Getting Here\n}\n\nfunction App() {\n return (\n <>\n
Before
\n err}>\n \n \n
After
\n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_for/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n\t\t{ id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n\t\t{ id: 'z_AbfPXTKms', name: 'Maru' },\n\t\t{ id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n\t]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_for/lesson.md: -------------------------------------------------------------------------------- 1 | 如果你想遍历一个列表,`` 组件是遍历任何非原始值数组的最佳方式。它通过引用自动键引用,以便在数据更新时对其进行优化以更新或移动行而不是重新创建它们。`` 的回调函数是非跟踪的,并传递数据项和索引 Signal。 2 | 3 | ```jsx 4 | 5 | {(cat, i) => ( 6 |
  • 7 | 8 | {i() + 1}: {cat.name} 9 | 10 |
  • 11 | )} 12 |
    13 | ``` 14 | 15 | `index` 是一个 Signal,因此它可以在移动行时独立更新。数据项不是 Signal,因为更改将意味着新引用并会导致创建新行。进行嵌套更新的方法是创建嵌套 Signal 或使用 Solid 的 Store 代理。 16 | 17 | 你还可以使用 `` 来迭代其他不是数组的可迭代对象,方法是使用类似 `Object.keys` 的方法或简单地扩展到类似 `[...iterable]` 的数组中。 18 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_for/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, For } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n\t\t{ id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n\t\t{ id: 'z_AbfPXTKms', name: 'Maru' },\n\t\t{ id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n\t]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_index/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Index } from 'solid-js';\n\nfunction App() {\n const [cats, setCats] = createSignal([\n\t\t{ id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n\t\t{ id: 'z_AbfPXTKms', name: 'Maru' },\n\t\t{ id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n\t]);\n \n return (\n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_index/lesson.md: -------------------------------------------------------------------------------- 1 | 在某些时候使用引用相等来比较行没有意义。在处理原始值或二维数组时,将值视为键可能会导致很多不必要的渲染。例如,如果我们将一个字符串列表映射到可以编辑每个字段的 `` 字段,对该值的每次更改都会导致 `` 被重新创建,因为它被视为唯一标识符。 2 | 3 | 在上述情况下,从概念上讲,数组索引是列表的实际键。为此,我们提供 `` 组件。 4 | 5 | `` 与 `` 具有相似的签名,除了数据项是 Signal 并且索引是固定的。 6 | 7 | ```jsx 8 | 9 | {(cat, i) => ( 10 |
  • 11 | 12 | {i + 1}: {cat().name} 13 | 14 |
  • 15 | )} 16 |
    17 | ``` 18 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_portal/lesson.md: -------------------------------------------------------------------------------- 1 | 有时在应用程序的正常顺序之外插入元素是很有用。Z-index 有时不足以处理像模态框类浮动元素的渲染上下文。 2 | 3 | Solid 提供一个 `` 组件,`` 的子内容将被插入到选择的位置。默认情况下,它的元素将在 `document.body` 下的 `
    ` 中呈现。 4 | 5 | 在示例中,我们看到信息弹出框被截断了。我们可以通过将元素包装在 `` 中将其从正常 DOM 顺序中拉出来解决这个问题: 6 | 7 | ```jsx 8 | 9 | 13 | 14 | ``` 15 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_show/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n <>\n \n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_show/lesson.md: -------------------------------------------------------------------------------- 1 | JSX 允许使用 JavaScript 来控制模板中的逻辑流。然而,如果没有虚拟 DOM,天真地使用诸如 `Array.prototype.map` 之类的东西会在每次更新时很浪费地重新创建所有 DOM 节点。相反,Reactive 库使用模板工具是很常见。在 Solid 中,我们将其封装在组件中。 2 | 3 | 最基本的控制流是条件。Solid 的编译器足够聪明,可以优化处理三元组 (`a ? b : c`) 和布尔表达式 (`a && b`)。然而,使用 `` 组件通常更简洁。 4 | 5 | 要仅显示正确的按钮来展示当前状态,请将 JSX 更新为: 6 | 7 | ```jsx 8 | } 11 | > 12 | 13 | 14 | ``` 15 | 16 | `fallback` 属性充当 `else`,在传递给 `when` 的条件不为 `true` 时显示。 17 | 18 | 现在单击按钮将像你所期望的那样来回更改。 19 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_show/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, Show } from 'solid-js';\n\nfunction App() {\n const [loggedIn, setLoggedIn] = createSignal(false);\n const toggle = () => setLoggedIn(!loggedIn())\n \n return (\n Log in}\n >\n \n \n );\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_switch/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Show, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n 10}\n fallback={\n x()}\n fallback={

    {x()} is between 5 and 10

    }\n >\n

    {x()} is less than 5

    \n \n }\n >\n

    {x()} is greater than 10

    \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_switch/lesson.md: -------------------------------------------------------------------------------- 1 | 有时需要处理 2 个以上互斥结条件。出于这个原因,我们根据 JavaScript 的 `switch`/`case` 之后大致建模出 `` 和 `` 组件。 2 | 3 | 它将尝试匹配每个条件,当第一个条件求值为真时停止渲染。如果所有这些都失败,它将渲染回退内容。 4 | 5 | 我们可以用下面代码替换嵌套的 `` 组件: 6 | 7 | ```jsx 8 | {x()} is between 5 and 10

    }> 9 | 10}> 10 |

    {x()} is greater than 10

    11 |
    12 | x()}> 13 |

    {x()} is less than 5

    14 |
    15 |
    16 | ``` 17 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/flow_switch/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, Switch, Match } from \"solid-js\";\n\nfunction App() {\n const [x] = createSignal(7);\n\n return (\n {x()} is between 5 and 10

    }>\n 10} >\n

    {x()} is greater than 10

    \n
    \n x()}>\n

    {x()} is less than 5

    \n
    \n
    \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_basics/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
    Hello World!
    ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_basics/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction HelloWorld() {\n return
    Hello Solid World!
    ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_components/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\n\nfunction App() {\n return (\n

    This is a Header

    \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

    This is a Paragraph

    " 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_components/lesson.md: -------------------------------------------------------------------------------- 1 | 在构建应用程序时,你需要拆分代码以获得更好的模块化和复用性。在 Solid 中,你可以通过创建组件达到你的目的。 2 | 3 | 组件仅仅是函数,就像在之前的教程中写的那样。在父级 JSX 中,组件可以用标签展示,并在第一次渲染时执行。之后,组件函数再也不会被调用。相反,所有更新都由 Solid 的响应式系统接管,我们将在接下来的几节课中学习到。 4 | 5 | 在下面例子中,我们将 `Nested` 组件添加到我们的应用程序中。我们已经在另一个文件中定义了它,尽管你可以将多个组件放在同一个文件中。首先我们必须导入它。 6 | 7 | ```js 8 | import Nested from "./nested"; 9 | ``` 10 | 11 | 然后我们需要将它添加到我们的 JSX 中。在这种情况下,我们现在有 2 个要返回的元素,因此我们可以将它们包装在一个 Fragment 中。 12 | 13 | ```jsx 14 | function App() { 15 | return ( 16 | <> 17 |

    This is a Header

    18 | 19 | 20 | ); 21 | } 22 | ``` 23 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_components/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport Nested from \"./nested\";\n\nfunction App() {\n return (\n <>\n

    This is a Header

    \n \n \n );\n}\n\nrender(() => , document.getElementById(\"app\"));\n" 6 | }, 7 | { 8 | "name": "nested", 9 | "content": "export default () =>

    This is a Paragraph

    " 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_derived/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
    Count: {count()}
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_derived/lesson.md: -------------------------------------------------------------------------------- 1 | Signal 是包装可跟踪值的简单 getter 函数。没有什么特别的。这意味着任何包装访问 Signal 的函数实际上都是一个 Signal 并且也是可跟踪的。放在 JSX 中的任何 JavaScript 表达式也是如此。只要它访问一个 Signal,它就会被更新。 2 | 3 | 理解 Solid 中的组件只是执行一次的函数非常重要。确保更新的唯一方法是将 Signal 包裹在计算或 JSX 中。但是,你始终可以通过将表达式包装在函数中来将其提升出来。这样就可以重复使用了。 4 | 5 | 让我们通过引入一个 `doubleCount` 函数来更新我们的 Counter ,将计数乘以 2。 6 | 7 | ```jsx 8 | const doubleCount = () => count() * 2; 9 | ``` 10 | 11 | 然后我们替换读取值位置。 12 | 13 | ```jsx 14 | return
    Count: {doubleCount()}
    ; 15 | ``` 16 | 17 | 这只是个小示例,展示了 `doubleCount` 可以被内联,然而它说明了如何组合 Signal 以及如何使派生 Signal 可传递。 18 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_derived/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const doubleCount = () => count() * 2;\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
    Count: {doubleCount()}
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_effects/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n return ;\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_effects/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\nimport { createSignal, createEffect } from 'solid-js';\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n createEffect(() => {\n console.log(\"The count is now\", count());\n });\n\n return ;\n}\n\nrender(() => , document.getElementById('app'));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_jsx/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from 'solid-js/web';\n\nfunction App() {\n return \"SVG goes here\";\n}\n\nrender(() => , document.getElementById('app'))\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_signals/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n return
    Count: 0
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/introduction_signals/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
    Count: {count()}
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/lifecycles_oncleanup/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n setInterval(() => setCount(count() + 1), 1000);\n\n return
    Count: {count()}
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/lifecycles_oncleanup/lesson.md: -------------------------------------------------------------------------------- 1 | 一些框架的清理方法直接是框架的副作用或生命周期方法的返回值。由于 Solid 渲染树中的所有内容都存在于(可能是惰性的)Effect 中并且可以嵌套,因此我们将 `onCleanup` 设为一级方法。您可以在任何范围内调用它,它会在该范围被触发以重新求值以及最终销毁时运行。 2 | 3 | 你可以在组件或 Effect 中使用 `onCleanup`。在自定义指令中使用 `onCleanup`。 在响应式系统同步执行的任何地方都可以使用 `onCleanup`。 4 | 5 | 介绍章节中的 Signal 示例在执行之后从未清理过。让我们通过用这个替换 `setInterval` 调用来解决这个问题: 6 | 7 | ```js 8 | const timer = setInterval(() => setCount(count() + 1), 1000); 9 | onCleanup(() => clearInterval(timer)); 10 | ``` 11 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/lifecycles_oncleanup/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n\n const timer = setInterval(() => setCount(count() + 1), 1000);\n onCleanup(() => clearInterval(timer));\n\n return
    Count: {count()}
    ;\n}\n\nrender(() => , document.getElementById('app'));" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/lifecycles_onmount/lesson.md: -------------------------------------------------------------------------------- 1 | Solid 中只有少量的生命周期,因为一切的存活销毁都由响应系统控制。响应系统是同步创建和更新的,因此唯一的调度就是将逻辑写到更新结束的 Effect 中。 2 | 3 | 我们发现处理简单任务的开发者通常不会这么想,所以为了让事情变得更容易一些,我们将非跟踪(从不重新运行)`createEffect` 调用取了一个别名 —— `onMount`。它只是一个 Effect 调用,但你可以放心使用它,一旦所有初始渲染完成,它只会在组件中运行一次。 4 | 5 | 让我们使用 `onMount` 钩子来获取一些照片: 6 | 7 | ```js 8 | onMount(async () => { 9 | const res = await fetch( 10 | `https://jsonplaceholder.typicode.com/photos?_limit=20` 11 | ); 12 | setPhotos(await res.json()); 13 | }); 14 | ``` 15 | 16 | 生命周期仅在浏览器中运行,因此将代码放在 `onMount` 中的好处是在 SSR 期间不在服务器上运行。即使我们在这个例子中进行数据获取,通常我们使用 Solid 的 Resource 来实现真正的服务器/浏览器协调。 17 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/props_defaults/lesson.md: -------------------------------------------------------------------------------- 1 | Props 是一个在函数组件执行时传递进来的对象,其中包含了调用组件时绑定到 JSX 上的所有属性。Props 对象是只读的,并且含有封装为对象 getter 的响应式属性。它们具有一致的形式,无论调用者是使用 Signal、Signal 表达式还是简单值或静态值。 你只需通过 `props.propName` 访问它们。 2 | 3 | 正因如此,请时刻记住不能直接解构它们,这会导致被解构的值脱离追踪范围从而失去响应性。通常,在 Solid 的 primitive 或 JSX 之外访问 props 对象上的属性可能会失去响应性。除了解构,像是扩展运算以及 `Object.assign` 这样的函数也会导致失去响应性。 4 | 5 | Solid 有一些工具函数可以帮助我们处理 props。 第一个 `mergeProps` 函数听起来很像它名字描述得那样合并 props。`mergeProps` 将潜在的响应式对象合并而不会失去响应式性。最常见的情况就是是为组件设置默认 props。 6 | 7 | 在示例中,在 `greetings.tsx` 中,我们内联了模板中的默认值,但我们也可以使用 `mergeProps` 设置默认值与此同时保持响 props 响应式更新。 8 | 9 | ```jsx 10 | const merged = mergeProps({ greeting: "Hi", name: "John" }, props); 11 | 12 | return

    {merged.greeting} {merged.name}

    13 | ``` 14 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_batch/lesson.md: -------------------------------------------------------------------------------- 1 | Solid 的响应式是同步的,这意味着在任何变更后的下一行 DOM 都会更新。在大多数情况下,这完全没问题,因为 Solid 的粒度渲染只是更新在响应式系统中的传播。渲染两次无关的更改实际上并不意味着浪费性能。 2 | 3 | 如果更改是相关的怎么办?Solid 的 `batch` 工具函数允许将多个更改推入队列,然后在通知观察者之前同时使用它们。在批处理中更新的信号值直到批处理完成才会提交。 4 | 5 | 在这个例子中,我们在按钮点击时分配了两个名字,触发了渲染更新两次。单击该按钮后,可以在控制台中看到日志。因此,让我们将 `set` 调用打包成一个批次。 6 | 7 | ```js 8 | const updateNames = () => { 9 | console.log("Button Clicked"); 10 | batch(() => { 11 | setFirstName(firstName() + "n"); 12 | setLastName(lastName() + "!"); 13 | }) 14 | } 15 | ``` 16 | 17 | 就是这样。现在整个变更集只会通知一次。 -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_on/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_on/lesson.md: -------------------------------------------------------------------------------- 1 | 为方便起见,Solid 提供一个 `on` 工具函数,可以为我们的计算设置显式依赖。这主要用来更明确地简洁地声明跟踪哪些信号。然而,它也允许计算不立即执行而只在第一次更改时运行。可以使用`defer` 选项启用此功能。 2 | 3 | 让 Effect 只在 `a` 更新时运行,并推迟到值发生变化时执行。 4 | 5 | ```js 6 | createEffect(on(a, (a) => { 7 | console.log(a, b()); 8 | }, { defer: true })); 9 | ``` 10 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_on/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(on(a, (a) => {\n console.log(a, b());\n }, { defer: true }));\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_untrack/lesson.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), b());\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_untrack/lesson.md: -------------------------------------------------------------------------------- 1 | 有时希望 Signal 读取行为不被跟踪,即使在响应式上下文中也是如此 Solid 提供了 `untrack` 工具函数来避免包装计算跟踪任何读取行为。 2 | 3 | 在示例中,假设我们不想在 `b` 更改时输出日志。我们可以通过将 Effect 更改为以下内容来取消跟踪 `b` Signal: 4 | 5 | ```js 6 | createEffect(() => { 7 | console.log(a(), untrack(b)); 8 | }); 9 | ``` 10 | 11 | 由于 Signal 是函数,可以直接传递,但 untrack 可以包装具有行为更复杂的函数。 12 | 13 | 即使 `untrack` 禁用了对读取的跟踪,但对写入并通知观察者并没有影响。 14 | -------------------------------------------------------------------------------- /langs/zh-cn/tutorials/reactivity_untrack/solved.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "main", 5 | "content": "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, untrack } from \"solid-js\";\n\nconst App = () => {\n const [a, setA] = createSignal(1);\n const [b, setB] = createSignal(1);\n\n createEffect(() => {\n console.log(a(), untrack(b));\n });\n\n return <>\n \n \n \n};\n\nrender(App, document.getElementById(\"app\"));\n" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /patches/gitlog+4.0.4.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/gitlog/dist/gitlog.cjs.development.js b/node_modules/gitlog/dist/gitlog.cjs.development.js 2 | index ab409a1..b7a6d32 100644 3 | --- a/node_modules/gitlog/dist/gitlog.cjs.development.js 4 | +++ b/node_modules/gitlog/dist/gitlog.cjs.development.js 5 | @@ -155,6 +155,8 @@ function createCommandArguments(options) { 6 | command.push("-m"); 7 | } 8 | 9 | + command.push("--follow"); 10 | + 11 | command.push("-n " + options.number); 12 | command = addOptionalArguments(command, options); // Start of custom format 13 | 14 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export interface Section { 2 | depth: string; 3 | value: string; 4 | children?: Section[]; 5 | } 6 | 7 | export interface LessonLookup { 8 | lessonName: string; 9 | internalName: string; 10 | } 11 | 12 | export interface ResourceMetadata { 13 | title: string, 14 | description: string, 15 | resource: string 16 | } 17 | 18 | export interface DocFile { 19 | toc: Section[]; 20 | default: string; 21 | } 22 | 23 | export interface LessonFile { 24 | lesson?: any; 25 | solved?: any; 26 | markdown?: string; 27 | } 28 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "allowSyntheticDefaultImports": true, 6 | "esModuleInterop": true, 7 | "declaration": true, 8 | "moduleResolution": "node", 9 | "jsx": "preserve", 10 | "resolveJsonModule": true, 11 | "newLine": "lf", 12 | "sourceMap": true, 13 | "jsxImportSource": "solid-js", 14 | "skipLibCheck": true, 15 | "strict": true, 16 | "lib": ["ESNext", "DOM"], 17 | "outDir": "dist" 18 | }, 19 | "include": ["src"], 20 | "exclude": ["node_modules/"] 21 | } 22 | --------------------------------------------------------------------------------