💻
How are you using Babel?
@babel/cli
Input code
function test(target, context) {
console.log(context.metadata); // undefined
}
class A {
@test foo;
}
I am not able to make a reproduction with the REPL due to: babel/website#1292 since the decorator plugin has a required option that can't be set.
Configuration file name
.babelrc
Configuration
{
"plugins":[
"@babel/plugin-transform-class-static-block",
["@babel/plugin-proposal-decorators", {"version": "2023-05", "decoratorsBeforeExport": true}],
["@babel/plugin-proposal-class-properties"]
]
}
Current and expected behavior
context.metadata should be an object per https://github.com/tc39/proposal-decorator-metadata
Environment
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.11",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.22.10",
"@babel/plugin-transform-class-static-block": "^7.22.11",
Possible solution
No response
Additional context
TypeScript 5.2 (due to be released the week of 8/22) implements decorator metadata.
💻
How are you using Babel?
@babel/cli
Input code
I am not able to make a reproduction with the REPL due to: babel/website#1292 since the decorator plugin has a required option that can't be set.
Configuration file name
.babelrc
Configuration
{ "plugins":[ "@babel/plugin-transform-class-static-block", ["@babel/plugin-proposal-decorators", {"version": "2023-05", "decoratorsBeforeExport": true}], ["@babel/plugin-proposal-class-properties"] ] }Current and expected behavior
context.metadatashould be an object per https://github.com/tc39/proposal-decorator-metadataEnvironment
Possible solution
No response
Additional context
TypeScript 5.2 (due to be released the week of 8/22) implements decorator metadata.