Skip to content

Commit adc4149

Browse files
weaverryantgalopin
authored andcommitted
Upgrading all packages to Stimulus 3
1 parent 9d72de1 commit adc4149

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+325
-107
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,21 @@ jobs:
8080
- name: Chartjs
8181
run: |
8282
cd src/Chartjs
83-
composer config platform.php 7.4.99
8483
composer update --prefer-dist --no-interaction --no-ansi --no-progress
8584
php vendor/bin/simple-phpunit
8685
- name: Cropperjs
8786
run: |
8887
cd src/Cropperjs
89-
composer config platform.php 7.4.99
9088
composer update --prefer-dist --no-interaction --no-ansi --no-progress
9189
php vendor/bin/simple-phpunit
9290
- name: Dropzone
9391
run: |
9492
cd src/Dropzone
95-
composer config platform.php 7.4.99
9693
composer update --prefer-dist --no-interaction --no-ansi --no-progress
9794
php vendor/bin/simple-phpunit
9895
- name: LazyImage
9996
run: |
10097
cd src/LazyImage
101-
composer config platform.php 7.4.99
10298
composer update --prefer-dist --no-interaction --no-ansi --no-progress
10399
php vendor/bin/simple-phpunit
104100
- name: TwigComponent

src/Chartjs/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# CHANGELOG
22

3-
## 1.4
3+
## 2.0
44

5+
- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus`
6+
version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300)
7+
for more details.
58
- Support added for Symfony 6
69

710
## 1.3

src/Chartjs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Symfony UX Chart.js allows you to extend its default behavior using a custom Sti
8484
```js
8585
// mychart_controller.js
8686

87-
import { Controller } from 'stimulus';
87+
import { Controller } from '@hotwired/stimulus';
8888

8989
export default class extends Controller {
9090
connect() {

src/Chartjs/Resources/assets/dist/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", {
1515
});
1616
exports["default"] = void 0;
1717

18-
var _stimulus = require("stimulus");
18+
var _stimulus = require("@hotwired/stimulus");
1919

2020
var _chart = require("chart.js");
2121

@@ -35,7 +35,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
3535

3636
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3737

38-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
38+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3939

4040
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4141

src/Chartjs/Resources/assets/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"peerDependencies": {
2222
"chart.js": "^2.9.4",
23-
"stimulus": "^2.0.0"
23+
"@hotwired/stimulus": "^3.0.0"
2424
},
2525
"devDependencies": {
2626
"@babel/cli": "^7.12.1",
@@ -30,7 +30,7 @@
3030
"@symfony/stimulus-testing": "^1.1.0",
3131
"chart.js": "^2.9.4",
3232
"jest-canvas-mock": "^2.3.0",
33-
"stimulus": "^2.0.0"
33+
"@hotwired/stimulus": "^3.0.0"
3434
},
3535
"jest": {
3636
"testRegex": "test/.*\\.test.js",

src/Chartjs/Resources/assets/src/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Controller } from 'stimulus';
12+
import { Controller } from '@hotwired/stimulus';
1313
import { Chart } from 'chart.js';
1414

1515
export default class extends Controller {

src/Chartjs/Resources/assets/test/controller.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Application, Controller } from 'stimulus';
12+
import { Application, Controller } from '@hotwired/stimulus';
1313
import { getByTestId, waitFor } from '@testing-library/dom';
1414
import { clearDOM, mountDOM } from '@symfony/stimulus-testing';
1515
import ChartjsController from '../dist/controller';

src/Chartjs/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Chartjs/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new ChartjsBundle()];
3030
}

src/Chartjs/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new ChartjsBundle()];
3232
}

src/Chartjs/Tests/Kernel/TwigAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TwigAppKernel extends Kernel
2727
{
2828
use AppKernelTrait;
2929

30-
public function registerBundles()
30+
public function registerBundles(): iterable
3131
{
3232
return [new FrameworkBundle(), new TwigBundle(), new ChartjsBundle()];
3333
}

src/Cropperjs/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# CHANGELOG
22

3-
## 1.4
3+
## 2.0
44

5+
- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus`
6+
version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300)
7+
for more details.
58
- Support added for Symfony 6
69

710
## 1.3

src/Cropperjs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Symfony UX Cropper.js allows you to extend its default behavior using a custom S
126126
```js
127127
// mycropper_controller.js
128128

129-
import { Controller } from 'stimulus';
129+
import { Controller } from '@hotwired/stimulus';
130130

131131
export default class extends Controller {
132132
connect() {

src/Cropperjs/Resources/assets/dist/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", {
1515
});
1616
exports["default"] = void 0;
1717

18-
var _stimulus = require("stimulus");
18+
var _stimulus = require("@hotwired/stimulus");
1919

2020
var _cropperjs = _interopRequireDefault(require("cropperjs"));
2121

@@ -37,7 +37,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
3737

3838
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3939

40-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
40+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4141

4242
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4343

src/Cropperjs/Resources/assets/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"peerDependencies": {
2626
"cropperjs": "^1.5.9",
27-
"stimulus": "^2.0.0"
27+
"@hotwired/stimulus": "^3.0.0"
2828
},
2929
"devDependencies": {
3030
"@babel/cli": "^7.12.1",
@@ -33,7 +33,7 @@
3333
"@babel/preset-env": "^7.12.7",
3434
"@symfony/stimulus-testing": "^1.1.0",
3535
"cropperjs": "^1.5.9",
36-
"stimulus": "^2.0.0"
36+
"@hotwired/stimulus": "^3.0.0"
3737
},
3838
"jest": {
3939
"testRegex": "test/.*\\.test.js",

src/Cropperjs/Resources/assets/src/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Controller } from 'stimulus';
12+
import { Controller } from '@hotwired/stimulus';
1313
import Cropper from 'cropperjs';
1414

1515
export default class extends Controller {

src/Cropperjs/Resources/assets/test/controller.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Application, Controller } from 'stimulus';
12+
import { Application, Controller } from '@hotwired/stimulus';
1313
import { getByTestId, waitFor } from '@testing-library/dom';
1414
import { clearDOM, mountDOM } from '@symfony/stimulus-testing';
1515
import CropperjsController from '../dist/controller';

src/Cropperjs/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Cropperjs/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new CropperjsBundle()];
3030
}

src/Cropperjs/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new CropperjsBundle()];
3232
}

src/Cropperjs/Tests/Kernel/TwigAppKernel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1515
use Symfony\Bundle\TwigBundle\TwigBundle;
1616
use Symfony\Component\Config\Loader\LoaderInterface;
17+
use Symfony\Component\DependencyInjection\Alias;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
19+
use Symfony\Component\Form\FormFactoryInterface;
1820
use Symfony\Component\HttpKernel\Kernel;
1921
use Symfony\UX\Cropperjs\CropperjsBundle;
2022

@@ -27,7 +29,7 @@ class TwigAppKernel extends Kernel
2729
{
2830
use AppKernelTrait;
2931

30-
public function registerBundles()
32+
public function registerBundles(): iterable
3133
{
3234
return [new FrameworkBundle(), new TwigBundle(), new CropperjsBundle()];
3335
}
@@ -37,6 +39,9 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3739
$loader->load(function (ContainerBuilder $container) {
3840
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true]);
3941
$container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]);
42+
43+
// create a public alias - FormFactoryInterface is removed otherwise
44+
$container->setAlias('public_form_factory', new Alias(FormFactoryInterface::class, true));
4045
});
4146
}
4247
}

src/Dropzone/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3-
## 1.4
3+
## 2.0
44

5+
- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus`
6+
version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300)
7+
for more details.
58
- Support added for Symfony 6

src/Dropzone/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Symfony UX Dropzone allows you to extend its default behavior using a custom Sti
8585
```js
8686
// mydropzone_controller.js
8787

88-
import { Controller } from 'stimulus';
88+
import { Controller } from '@hotwired/stimulus';
8989

9090
export default class extends Controller {
9191
connect() {

src/Dropzone/Resources/assets/dist/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", {
1515
});
1616
exports["default"] = void 0;
1717

18-
var _stimulus = require("stimulus");
18+
var _stimulus = require("@hotwired/stimulus");
1919

2020
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2121

@@ -33,7 +33,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
3333

3434
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3535

36-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
36+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3737

3838
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3939

src/Dropzone/Resources/assets/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
"lint": "eslint src test"
2323
},
2424
"peerDependencies": {
25-
"stimulus": "^2.0.0"
25+
"@hotwired/stimulus": "^3.0.0"
2626
},
2727
"devDependencies": {
2828
"@babel/cli": "^7.12.1",
2929
"@babel/core": "^7.12.3",
3030
"@babel/plugin-proposal-class-properties": "^7.12.1",
3131
"@babel/preset-env": "^7.12.7",
3232
"@symfony/stimulus-testing": "^1.1.0",
33-
"stimulus": "^2.0.0"
33+
"@hotwired/stimulus": "^3.0.0"
3434
},
3535
"jest": {
3636
"testRegex": "test/.*\\.test.js",

src/Dropzone/Resources/assets/src/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Controller } from 'stimulus';
12+
import { Controller } from '@hotwired/stimulus';
1313

1414
export default class extends Controller {
1515
static targets = ['input', 'placeholder', 'preview', 'previewClearButton', 'previewFilename', 'previewImage'];

src/Dropzone/Resources/assets/test/controller.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
import { Application, Controller } from 'stimulus';
12+
import { Application, Controller } from '@hotwired/stimulus';
1313
import { getByTestId, waitFor } from '@testing-library/dom';
1414
import user from '@testing-library/user-event';
1515
import { clearDOM, mountDOM } from '@symfony/stimulus-testing';

src/Dropzone/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Dropzone/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new DropzoneBundle()];
3030
}

src/Dropzone/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new DropzoneBundle()];
3232
}

0 commit comments

Comments
 (0)