Whether the const keyword can be removed from compiler-core exported NodeTypes
Version
3.2.33
Reproduction link
Steps to reproduce
// 1
pnpm i
// 2
pnpm test compiler.demo
so you can see the above error
the reason is:
// vue3/compiler-core/src/ast.ts
export const enum NodeTypes {
ROOT,
ELEMENT,
TEXT,
……
because "const" keyword , see link const enum in Typescript
compiler-core exports the enum NodeType But because of the const keyword, there's really no way to use this NodeType if you want to So I wonder if it is possible to remove the const keyword for NodeType Then it makes sense to export the NodeType so that it can be used externally
What is expected?
The NodeType type can be used
What is actually happening?
The NodeType type can not be used now
Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.
@edison1105 but I think this is an API defect
because '@vue/compiler-core' is released as A separate package
it exports "NodeTypes" API, but outside can not be used.
What do you think?
or about API defects we can where discuss?