Open
Description
In the regular compiler, we disallow various forms of invalid decorator usage. The following validation should be added to the SSR compiler:
- Only
api
,track
, andwire
can be used as decorators.@foo prop
is invalid.
- The decorators cannot be imported and renamed.
import { api as API } from "lwc"
is invalid.
- Other functions called
api
,wire
, ortrack
cannot be used as decorators.const api = () => {}; ... @api prop
is invalid.
- The decorators cannot be called as regular functions.
import { api } from "lwc"; ... api()
is invalid.
- Other functions called
api
,wire
, ortrack
can be used as regular functions.const api = () => {}; api();
is valid.
Activity