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/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/package.json b/package.json index 78ec593..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", @@ -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" } 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: [], + }); + }); });