mgechev / aspect.js

JavaScript library for aspect-oriented programming using modern syntax.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Babel 7's @babel/plugin-proposal-decorators in modern mode

matthewadams opened this issue · comments

aspect.js@0.7.5 fails when using @babel/plugin-proposal-decorators@>=7.1.6 in a pure JavaScript project. The workaround is to set the plugin's legacy property to true.

Since the modern (legacy: false) mode of the plugin is now the default and closer to the expected final version of the ECMAScript decorators proposal, aspect.js should be updated accordingly to work with the plugin's modern mode. For backward compatibility, there should probably be an aspect.js setting to opt-in to using the modern decorator mode. The next major version of aspect.js could then be changed to use the modern mode by default.

The project at https://github.com/matthewadams/aspect.js-babel7-poc can be used as a pure JavaScript test client for such an environment for integration testing.