Hello Symfony with transition
'));
+ });
+});
diff --git a/src/Svelte/assets/test/util/require_context_poylfill.ts b/src/Svelte/assets/test/util/require_context_poylfill.ts
new file mode 100644
index 00000000000..376746d8f08
--- /dev/null
+++ b/src/Svelte/assets/test/util/require_context_poylfill.ts
@@ -0,0 +1,39 @@
+import fs from 'fs';
+import path from 'path';
+
+export function createRequireContextPolyfill (rootDir: string) {
+ return (base: string, deep: boolean, filter: RegExp): __WebpackModuleApi.RequireContext => {
+ const basePrefix = path.resolve(rootDir, base);
+ const files: { [key: string]: boolean } = {};
+
+ function readDirectory(directory: string) {
+ fs.readdirSync(directory).forEach((file: string) => {
+ const fullPath = path.resolve(directory, file);
+
+ if (fs.statSync(fullPath).isDirectory()) {
+ if (deep) {
+ readDirectory(fullPath);
+ }
+
+ return;
+ }
+
+ if (!filter.test(fullPath)) {
+ return;
+ }
+
+ files[fullPath.replace(basePrefix, '.')] = true;
+ });
+ }
+
+ readDirectory(path.resolve(rootDir, base));
+
+ function Module(file: string) {
+ return require(basePrefix + '/' + file);
+ }
+
+ Module.keys = () => Object.keys(files);
+
+ return (Module as __WebpackModuleApi.RequireContext);
+ };
+}
diff --git a/src/Svelte/composer.json b/src/Svelte/composer.json
new file mode 100644
index 00000000000..fc7c11937db
--- /dev/null
+++ b/src/Svelte/composer.json
@@ -0,0 +1,50 @@
+{
+ "name": "symfony/ux-svelte",
+ "type": "symfony-bundle",
+ "description": "Integration of Svelte in Symfony",
+ "keywords": [
+ "symfony-ux"
+ ],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Titouan Galopin",
+ "email": "galopintitouan@gmail.com"
+ },
+ {
+ "name": "Thomas Choquet",
+ "email": "thomas.choquet.pro@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "Symfony\\UX\\Svelte\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Symfony\\UX\\Svelte\\Tests\\": "tests/"
+ }
+ },
+ "require": {
+ "symfony/webpack-encore-bundle": "^1.15"
+ },
+ "require-dev": {
+ "symfony/framework-bundle": "^5.4|^6.2",
+ "symfony/phpunit-bridge": "^5.4|^6.2",
+ "symfony/twig-bundle": "^5.4|^6.2",
+ "symfony/var-dumper": "^5.4|^6.2"
+ },
+ "extra": {
+ "thanks": {
+ "name": "symfony/ux",
+ "url": "https://github.com/symfony/ux"
+ }
+ },
+ "minimum-stability": "dev"
+}
diff --git a/src/Svelte/doc/index.rst b/src/Svelte/doc/index.rst
new file mode 100644
index 00000000000..c29b6e3c2ed
--- /dev/null
+++ b/src/Svelte/doc/index.rst
@@ -0,0 +1,130 @@
+Symfony UX Svelte
+=================
+
+Symfony UX Svelte is a Symfony bundle integrating `Svelte`_ in
+Symfony applications. It is part of `the Symfony UX initiative`_.
+
+Svelte is a JavaScript framework for building user interfaces.
+Symfony UX Svelte provides tools to render Svelte components from Twig,
+handling rendering and data transfers.
+
+Symfony UX Svelte supports Svelte 3 only.
+
+Installation
+------------
+
+Before you start, make sure you have `Symfony UX configured in your app`_.
+
+Then install the bundle using Composer and Symfony Flex:
+
+.. code-block:: terminal
+
+ $ composer require symfony/ux-svelte
+
+ # Don't forget to install the JavaScript dependencies as well and compile
+ $ npm install --force
+ $ npm run watch
+
+ # or use yarn
+ $ yarn install --force
+ $ yarn watch
+
+You also need to add the following lines at the end to your ``assets/app.js`` file:
+
+.. code-block:: javascript
+
+ // assets/app.js
+ import { registerSvelteControllerComponents } from '@symfony/ux-svelte';
+
+ // Registers Svelte controller components to allow loading them from Twig
+ //
+ // Svelte controller components are components that are meant to be rendered
+ // from Twig. These component can then rely on other components that won't be
+ // called directly from Twig.
+ //
+ // By putting only controller components in `svelte/controllers`, you ensure that
+ // internal components won't be automatically included in your JS built file if
+ // they are not necessary.
+ registerSvelteControllerComponents(require.context('./svelte/controllers', true, /\.svelte$/));
+
+To make sure Svelte components can be loaded by Webpack Encore, you need to add and configure
+the `svelte-loader`_ library in your project :
+
+.. code-block:: terminal
+
+ $ npm install svelte svelte-loader --save-dev
+
+ # or use yarn
+ $ yarn add svelte svelte-loader --dev
+
+Enable it in your ``webpack.config.js`` file :
+
+.. code-block:: javascript
+
+ // webpack.config.js
+ Encore
+ // ...
+ .enableSvelte()
+ ;
+
+Usage
+-----
+
+UX Svelte works by using a system of **Svelte controller components**: Svelte components that
+are registered using ``registerSvelteControllerComponents()`` and that are meant to be rendered
+from Twig.
+
+When using the ``registerSvelteControllerComponents()`` configuration shown previously, all
+Svelte components located in the directory ``assets/svelte/controllers`` are registered as
+Svelte controller components.
+
+You can then render any Svelte controller component in Twig using the ``svelte_component()`` function:
+
+.. code-block:: javascript
+
+ // assets/svelte/controllers/MyComponent.svelte
+
+
+