Skip to content

Commit

Permalink
iAPI: Refactor types and add a "Core Concepts - Using TypeScript" gui…
Browse files Browse the repository at this point in the history
…de (#64577)

* Initial version

* Add a section with instructions to install the package

* Add basic create-block template for typescript

* Fix all the types

* Reorganize the sections on how to type the store

* Add a test for when the store is divided into multiple parts

* Update the example of when the store is divided into multiple parts

* Try a `typed` function to type promises

* Refactor derived state and async actions

* Add an example casting the entire state

* Add entry to the changelog

* Add last section and conclusion

* Remove the template

* Add basic JSDoc for the typed function

* Export `typed`

* Delete template from manifest

* Add the skeleton for TypeScript variant of the template

* Add types and global state to the template

* Add the scaffolding section again

* Add a note and `@since` annotation to the `typed` function to ensure people don’t use it before WP 6.7

* Added typescript guide to  the README of Core Concepts, toc.json and manifest.json

* Improve iapi type "tests"

* Add tsconfig for type tests

* REVERTME: Introduce intentional type error

* Revert "REVERTME: Introduce intentional type error"

This reverts commit ac5590f.

* fixup! Merge branch 'trunk' into iapi-docs-typescript-guide

* Remove typed function

* Remove references to `typed` function from docs

* Update and fix changelog

---------

Co-authored-by: Grzegorz Ziółkowski <[email protected]>
Co-authored-by: JuanMa Garrido <[email protected]>
Co-authored-by: Jon Surrell <[email protected]>
Co-authored-by: JuanMa <[email protected]>

Co-authored-by: luisherranz <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: juanmaguitar <[email protected]>
Co-authored-by: sirreal <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: adamziel <[email protected]>
Co-authored-by: michalczaplinski <[email protected]>
Co-authored-by: spencerfinnell <[email protected]>
Co-authored-by: ryanwelcher <[email protected]>
  • Loading branch information
10 people authored Sep 23, 2024
1 parent 842b86a commit a1f8bb5
Show file tree
Hide file tree
Showing 18 changed files with 1,230 additions and 25 deletions.
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@
"markdown_source": "../docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md",
"parent": "core-concepts"
},
{
"title": "Using TypeScript",
"slug": "using-typescript",
"markdown_source": "../docs/reference-guides/interactivity-api/core-concepts/using-typescript.md",
"parent": "core-concepts"
},
{
"title": "Quick start guide",
"slug": "iapi-quick-start-guide",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ This section provides some guides on important concepts and mental models relate
2. **[Understanding global state, local context and derived state](/docs/reference-guides/interactivity-api/core-concepts/undestanding-global-state-local-context-and-derived-state.md):** The guide explains how to effectively use global state, local context, and derived state within the Interactivity API emphasizing the importance of choosing the appropriate state management technique based on the scope and requirements of your data.

3. **[Server-side rendering: Processing directives on the server](/docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md):** The Interactivity API allows WordPress to use server-side rendering to create interactive and state-aware HTML, smoothly connected with client-side features while maintaining performance and SEO benefits.

4. **[Using TypeScript](/docs/reference-guides/interactivity-api/core-concepts/using-typescript.md):** This guide will walk you through the process of using TypeScript with Interactivity API stores, covering everything from basic type definitions to advanced techniques for handling complex store structures.
Loading

0 comments on commit a1f8bb5

Please sign in to comment.