Skip to content

Commit

Permalink
minor #1345 [StimulusBundle] Added docs on TypeScript support (everth…
Browse files Browse the repository at this point in the history
…armeling, weaverryan)

This PR was merged into the 2.x branch.

Discussion
----------

[StimulusBundle] Added docs on TypeScript support

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Issues        | #1335 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

Follow-up on #1335, added more info on usage of TypeScript controllers support.

Commits
-------

237164f Tweaking wording
60c0b8e [StimulusBundle] Added docs about Typescript controller usage
3724401 [StimulusBundle] Revert adding var/ to .gitignore
  • Loading branch information
weaverryan committed Jan 9, 2024
2 parents d8c0068 + 237164f commit 3c5d7a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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 Down Expand Up @@ -84,6 +84,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 @@ -570,3 +578,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

0 comments on commit 3c5d7a4

Please sign in to comment.