Skip to content

Commit 2c2eead

Browse files
committed
bug #580 Turbo mercure package abandoned (weaverryan)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- Turbo mercure package abandoned | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | Fix #578 | License | MIT Hi! The `symfony/ux-turbo-mercure` package is now abandoned - see #578 - and instead now lives in `symfony/ux-turbo`. That's actually already the case in 2.6.0, but in 2.6.1, we will move the actual Stimulus controller as well. This moves the controller, fixes the autoloading & updates the README and CHANGELOG. I tested locally on ux.symfony.com (you can see those changes here too, though I'll need to update the package properly in that project after this is merged). Cheers! Commits ------- 0747273 Turbo mercure package abandoned
2 parents 25b7635 + 0747273 commit 2c2eead

21 files changed

+47
-208
lines changed

src/Turbo/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# CHANGELOG
22

3+
## 2.6.1
4+
5+
- The `symfony/ux-turbo-mercure` package was abandoned and moved into this package.
6+
If you were previously using `symfony/ux-turbo-mercure`, you can remove it
7+
and only install mecure-bundle:
8+
9+
```
10+
composer require symfony/mercure-bundle
11+
composer remove symfony/ux-turbo-mercure
12+
```
13+
14+
After upgrading this package to 2.6.1, you should have a new entry in
15+
`assets/controllers.json` called `mercure-turbo-stream`. Change
16+
`enabled: false` to `enabled: true`.
17+
318
## 2.6.0
419
520
- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make

src/Turbo/assets/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"webpackMode": "eager",
1212
"fetch": "eager",
1313
"enabled": true
14+
},
15+
"mercure-turbo-stream": {
16+
"main": "dist/turbo_stream_controller.js",
17+
"fetch": "eager",
18+
"enabled": false
1419
}
1520
}
1621
},
@@ -20,6 +25,7 @@
2025
},
2126
"devDependencies": {
2227
"@hotwired/turbo": "^7.1.0",
23-
"@hotwired/stimulus": "^3.0.0"
28+
"@hotwired/stimulus": "^3.0.0",
29+
"jest-canvas-mock": "^2.3.0"
2430
}
2531
}

src/Turbo/src/Bridge/Mercure/assets/test/turbo_stream_controller.test.ts renamed to src/Turbo/assets/test/turbo_stream_controller.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import TurboStreamController from '../src/turbo_stream_controller';
1616

1717
const startStimulus = () => {
1818
const application = Application.start();
19-
application.register('symfony--ux-turbo-mercure--turbo-stream', TurboStreamController);
19+
application.register('symfony--ux-turbo--mercure-turbo-stream', TurboStreamController);
2020
};
2121

2222
/* eslint-disable no-undef */
@@ -31,7 +31,7 @@ describe('TurboStreamController', () => {
3131
}));
3232

3333
container = mountDOM(
34-
'<div data-testid="turbo-stream-mercure" data-controller="symfony--ux-turbo-mercure--turbo-stream" data-symfony--ux-turbo-mercure--turbo-stream-hub-value="https://example.com/.well-known/mercure" data-symfony--ux-turbo-mercure--turbo-stream-topic-value="foo"></div>'
34+
'<div data-testid="turbo-stream-mercure" data-controller="symfony--ux-turbo--mercure-turbo-stream" data-symfony--ux-turbo--mercure-turbo-stream-hub-value="https://example.com/.well-known/mercure" data-symfony--ux-turbo--mercure-turbo-stream-topic-value="foo"></div>'
3535
);
3636
});
3737

@@ -44,7 +44,7 @@ describe('TurboStreamController', () => {
4444

4545
// smoke test
4646
expect(getByTestId(container, 'turbo-stream-mercure')).toHaveAttribute(
47-
'data-symfony--ux-turbo-mercure--turbo-stream-topic-value',
47+
'data-symfony--ux-turbo--mercure-turbo-stream-topic-value',
4848
'foo'
4949
);
5050
});

src/Turbo/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
],
2525
"autoload": {
2626
"psr-4": {
27-
"Symfony\\UX\\Turbo\\": "src/",
28-
"Symfony\\UX\\Turbo\\Bridge\\Mercure\\": "src/Bridge/Mercure/src"
27+
"Symfony\\UX\\Turbo\\": "src/"
2928
}
3029
},
3130
"autoload-dev": {

src/Turbo/doc/index.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,19 @@ Start by installing `the Mercure support`_ on your project:
383383

384384
.. code-block:: terminal
385385
386-
$ composer require symfony/ux-turbo-mercure
387-
$ yarn install --force
388-
$ yarn encore dev
386+
$ composer require symfony/mercure-bundle
387+
388+
Then, enable the "mercure stream" controller in ``assets/controllers.json``:
389+
390+
.. code-block:: diff
391+
392+
"@symfony/ux-turbo": {
393+
"mercure-turbo-stream": {
394+
+ "enabled": true,
395+
- "enabled": false,
396+
"fetch": "lazy"
397+
}
398+
},
389399
390400
The easiest way to have a working development (and production-ready)
391401
environment is to use `Symfony Docker`_, which comes with

src/Turbo/src/Bridge/Mercure/LICENSE

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Turbo/src/Bridge/Mercure/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)