From 520440beea42e498eb585360f040206be7333c14 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sun, 5 Jan 2025 14:32:11 +0100 Subject: [PATCH 1/3] Add missing @babel/plugin-proposal-class-properties dependency --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 78ec593..e9c64ff 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ }, "devDependencies": { "@babel/core": "^7.15.8", + "@babel/plugin-proposal-class-properties": "^7.15.8", "@babel/preset-env": "^7.15.8", "@babel/preset-typescript": "^7.15.0", "@hotwired/stimulus": "^3.0", @@ -92,5 +93,6 @@ "dist/", "controllers.json", "lazy-controller-loader.js" - ] + ], + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } From a258b7c5faa5e3ce945be44263f83d6a07e996fd Mon Sep 17 00:00:00 2001 From: ameotoko Date: Sun, 29 Sep 2024 13:36:22 +0200 Subject: [PATCH 2/3] Fix lazy-controller detection when controller contain static properties (update `acorn` ECMAScript version) --- dist/webpack/lazy-controller-loader.js | 2 +- src/util/get-stimulus-comment-options.ts | 2 +- test/util/get-stimulus-comment-options.test.ts | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/webpack/lazy-controller-loader.js b/dist/webpack/lazy-controller-loader.js index 75b4176..a93c5eb 100644 --- a/dist/webpack/lazy-controller-loader.js +++ b/dist/webpack/lazy-controller-loader.js @@ -5583,7 +5583,7 @@ function getCommentsFromSource(source) { parse(source, { onComment: comments, sourceType: 'module', - ecmaVersion: 2020, + ecmaVersion: 2022, }); return comments; } diff --git a/src/util/get-stimulus-comment-options.ts b/src/util/get-stimulus-comment-options.ts index 65a2bb3..1d301c0 100644 --- a/src/util/get-stimulus-comment-options.ts +++ b/src/util/get-stimulus-comment-options.ts @@ -24,7 +24,7 @@ function getCommentsFromSource(source: string) { parse(source, { onComment: comments, sourceType: 'module', - ecmaVersion: 2020, + ecmaVersion: 2022, }); return comments; diff --git a/test/util/get-stimulus-comment-options.test.ts b/test/util/get-stimulus-comment-options.test.ts index 5497b5d..19aa565 100644 --- a/test/util/get-stimulus-comment-options.test.ts +++ b/test/util/get-stimulus-comment-options.test.ts @@ -42,4 +42,12 @@ describe('getStimulusCommentOptions', () => { errors: [], }); }); + + it('parses source with static properties', () => { + const src = '/* stimulusFetch: "lazy" */ export default class extends Controller { static targets = []; }'; + expect(getStimulusCommentOptions(src)).toEqual({ + options: { stimulusFetch: 'lazy' }, + errors: [], + }); + }); }); From 771a0770568915c17531c4d7abb8d30ebb742f66 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 9 Jan 2025 08:14:02 +0100 Subject: [PATCH 3/3] Tagging 3.2.3 --- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633aef5..6b80bdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # CHANGELOG +## 3.3.3 + +* Add missing `@babel/plugin-proposal-class-properties` dev dependency by @Kocal in https://github.com/symfony/stimulus-bridge/pull/92 +* Fix lazy-controller detection when controller contain static properties (update `acorn` ECMAScript version) by @ameotoko in https://github.com/symfony/stimulus-bridge/pull/93 + +## 3.2.3 + +* [Bug] Removing unnecessary Promise in object of controllers to be loaded. See #81. + +* Fix README: registering lazy controllers in bootstrap.js. See #76. + +## 3.2.1 + +* Normalizing custom names "/" to "--" like normal controller names. See #72. + ## 3.2.0 * Allow the controller name to be overridden by the package or user. See #70. diff --git a/package.json b/package.json index e9c64ff..fe17aea 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@symfony/stimulus-bridge", "description": "Stimulus integration bridge for Symfony projects", - "version": "3.2.2", + "version": "3.2.3", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT",