Skip to content

Commit 273b403

Browse files
committed
feature #859 Implement Stimulus bridge configurator (tgalopin)
This PR was merged into the main branch. Discussion ---------- Implement Stimulus bridge configurator Implement Stimulus bridge configurator for Symfony UX Commits ------- c84cfb3 Implement Stimulus bridge configurator
2 parents f4d4e75 + c84cfb3 commit 273b403

File tree

16 files changed

+163
-0
lines changed

16 files changed

+163
-0
lines changed

fixtures/stimulus/assets/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { startStimulusApp } from '@symfony/stimulus-bridge';
2+
import '@symfony/autoimport';
3+
4+
export const app = startStimulusApp(require.context('./controllers', true, /\.(j|t)sx?$/));
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"controllers": {
3+
"@symfony/mock-module": {
4+
"mock": {
5+
"webpackMode": "lazy",
6+
"enabled": true,
7+
"autoimport": {
8+
"@symfony/mock-module/dist/style.css": true
9+
}
10+
}
11+
}
12+
},
13+
"entrypoints": []
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Controller } from 'stimulus';
2+
3+
export default class extends Controller {
4+
connect() {
5+
console.log('app-controller');
6+
}
7+
}

fixtures/stimulus/autoimport/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@symfony/mock-module/dist/style.css';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@symfony/autoimport",
3+
"license": "MIT",
4+
"version": "1.0.0",
5+
"main": "./index.js"
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'@symfony/mock-module/mock': import(/* webpackMode: "eager" */ '@symfony/mock-module/dist/controller'),
3+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@symfony/controllers",
3+
"license": "MIT",
4+
"version": "1.0.0",
5+
"main": "./index.js"
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Controller } from 'stimulus';
2+
3+
export default class extends Controller {
4+
connect() {
5+
console.log('mock-module-controller');
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
body {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@symfony/mock-module",
3+
"license": "MIT",
4+
"version": "1.0.0",
5+
"symfony": {
6+
"controllers": {
7+
"mock": {
8+
"main": "dist/controller.js",
9+
"webpackMode": "eager",
10+
"enabled": true,
11+
"autoimport": {
12+
"@symfony/mock-module/dist/style.css": true
13+
}
14+
}
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)