Skip to content

[StimulusBundle] Added docs on TypeScript support #1345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/StimulusBundle/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
var/
vendor/
tests/fixtures/var
12 changes: 11 additions & 1 deletion src/StimulusBundle/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ necessary files. If not, or you're curious, see :ref:`Manual Setup <manual-insta
Usage
-----

You can now create custom Stimulus controllers inside of the ``assets/controllers.``
You can now create custom Stimulus controllers inside of the ``assets/controllers``
directory. In fact, you should have an example controller there already: ``hello_controller.js``:

.. code-block:: javascript
Expand All @@ -71,6 +71,14 @@ will activate.
There's a *lot* more to learn about Stimulus. See the `Stimulus Documentation`_
for all the goodies.

TypeScript Controllers
~~~~~~~~~~~~~~~~~~~~~~

If you want to use `TypeScript`_ to define your controllers, you can! Install and set up the
`sensiolabs/typescript-bundle`_. Then be sure to add the ``assets/controllers`` path to the
`sensiolabs_typescript.source_dir` configuration. Finally, create your controller in that
directory and you're good to go.

.. _ux-packages:

The UX Packages
Expand Down Expand Up @@ -541,3 +549,5 @@ it will normalize it:
.. _`Vue`: https://vuejs.org/
.. _`stimulus-use`: https://stimulus-use.github.io/stimulus-use
.. _`stimulus-components`: https://stimulus-components.netlify.app/
.. _`TypeScript`: https://www.typescriptlang.org/
.. _`sensiolabs/typescript-bundle`: https://github.com/sensiolabs/AssetMapperTypeScriptBundle