ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Let Parser ignore TypseScript syntax

Open ShortDevelopment opened this issue 2 years ago • 2 comments

Idea

Since CC is now a standalone js engine it might be cool to have the capability to execute typescript files directly via CC to allow for a faster development cycle.

Implementation

This feature would work by just throwing away type information in the parser. It should be available via an opt-in flag.

Tasks

  • [ ] Ignore simple type-annotations
  • [ ] Ignore type definitions (type keyword)
  • [ ] Ignore type declarations (declare keyword)
  • [ ] Ignore TS interface syntax (interface and implements keyword)
  • [ ] Parse and expose TS enum fields (future)
  • [ ] Handle namespaces
  • [ ] Handle TS decorators (future)

...


See https://github.com/chakra-core/ChakraCore/issues/1435#issuecomment-396316373

ShortDevelopment avatar Oct 01 '23 10:10 ShortDevelopment

I'm a little concerned about quite how intrusive this could be in the parser; would it be intended as a feature for an embedded use cases or just for testing with ch?

rhuanjl avatar Apr 22 '24 22:04 rhuanjl

This was just a general idea. It might be a nice feature to attract users (like bun does) but it of cause may not impact parsing performance.

The priority for this is definitely very low.

ShortDevelopment avatar Apr 22 '24 22:04 ShortDevelopment