Add support for emitting native `class`

Description

Currently, there is no way to emit a `class` declaration from ClojureScript code.

In a JS environment that has native class support, there are certain cases with `class` that cannot be replicated with ES3/5 prototypal syntax, and require to use the environment’s native `class` and `extends` keywords.

Resolving this issue would involve two parts:

  • a `defclass` macro which provides syntax for declaring a name, superclass and methods

  • compiler support to do a second pass on the file in order to convert to ES3 if the user does not want their project to only target ES6+ environments

Environment

None

Assignee

Unassigned

Reporter

Will Acton

Labels

None

Approval

None

Patch

None

Priority

Major
Configure