Document about alternative JS assets installation with npm packages

This commit is contained in:
Hugo Alliaume
2025-03-02 11:43:43 +01:00
parent 94d549f798
commit 14db287b9c
2 changed files with 16 additions and 3 deletions

View File

@@ -1,10 +1,18 @@
# @symfony/ux-notify
Native notification integration for Symfony using Mercure.
JavaScript assets of the [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) PHP package.
** Direct installation of this package is for advanced users only.** We strongly recommend installing it through the PHP package [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) in a Symfony application with Flex enabled.
## Installation
If you still want to install this package directly, **make sure its version exactly matches [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) PHP package version.**
This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.).
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) PHP package version:
```shell
composer require symfony/ux-notify:2.23.0
npm add @symfony/ux-notify@2.23.0
```
## Resources

View File

@@ -25,6 +25,10 @@ needed if you're using AssetMapper):
$ npm install --force
$ npm run watch
.. note::
For more complex installation scenarios, you can install the JavaScript assets through the `@symfony/ux-notify npm package`_
Usage
-----
@@ -154,3 +158,4 @@ https://symfony.com/doc/current/contributing/code/bc.html
.. _`Mercure`: https://mercure.rocks
.. _`running Mercure server`: https://symfony.com/doc/current/mercure.html#running-a-mercure-hub
.. _`native notifications`: https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API
.. _`@symfony/ux-notify npm package`: https://www.npmjs.com/package/@symfony/ux-notify