xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.66k stars 1.63k forks source link

Have addons implement their API at compile time #4847

Closed tisilent closed 1 year ago

tisilent commented 1 year ago

fix #4828

  1. Missing clearTextureAtlas found in canvas addon
  2. xterm-addon-serialize , xterm-addon-unicode-graphemes may error TS2307: Cannot find module will happen and the reason cannot be found :dizzy:
tisilent commented 1 year ago

ok . All addons have been added.

edit: But I don't know if this method is right or not. :joy:

tisilent commented 1 year ago

@Tyriar After you handle #4859, I will resubmit it.

Tyriar commented 1 year ago

I'm trying to fix the conflicts now

jerch commented 1 year ago

@tisilent Wow - thats a really interesting idea to solve the issue. :heart:

On a sidenote - that even solves another (non?) issue: its not possible anymore to accidentally import the addon into itself due to the path masking rule, whoever would have wanted that in the first place :smiley_cat:

I still wonder - was there a specific reason to do it via a path rule, and not by directly importing the types from the d.ts files?

tisilent commented 1 year ago

@jerch Without specifying path rules, TS compile may encounter problems. :sweat_smile:

tisilent commented 1 year ago

When the '. d. ts' file uses the import. declared module, it cannot be found during compilation. It is uncertain if there is anything else that needs to be configured.

jerch commented 1 year ago

Ah ok, glad you found a way around. I kinda never fully understood the declare module ideas/limitations - whenever I tried messing with it, it was a mess :sweat_smile:.