Create a node.js target for xterm.js#3212
Merged
Tyriar merged 39 commits intoxtermjs:masterfrom Aug 12, 2021
joyceerhl:nodetarget
Merged
Create a node.js target for xterm.js#3212Tyriar merged 39 commits intoxtermjs:masterfrom joyceerhl:nodetarget
Tyriar merged 39 commits intoxtermjs:masterfrom
joyceerhl:nodetarget
Conversation
Tyriar
requested changes
Jan 11, 2021
Member
Tyriar
left a comment
There was a problem hiding this comment.
Nice work, some high level comments below 🙂
| "include": [ | ||
| "../**/*", | ||
| "../../../typings/xterm-core.d.ts", | ||
| "../../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' |
Member
There was a problem hiding this comment.
This seems like a problem, we can't import from xterm if we want it to run for node because it touches DOM types which will throw for tsconfig targets without the dom lib.
| * to be stable and consumed by external programs. | ||
| */ | ||
|
|
||
| declare module 'xterm-core' { |
Member
There was a problem hiding this comment.
Another problem I'd like for us to solve is the sharing of these typings, I think having xterm.d.ts import from xterm-core.d.ts will cause problems because of this module declaration. We may need separate .d.ts that just export the core types without the module wrapping them to be able to share.
14 tasks
This reverts commit f685d8e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @Tyriar, here's an attempt at what you described in #2749 (comment). This PR:
src/browser/public/Terminal.ts-->src/common/public/Terminal.ts.src/browser/Terminal.ts-->src/common/public/TerminalCore.tssincesrc/browser/public/Terminal.tswrapssrc/browser/Terminal.ts.src/browserimports fromsrc/common/public/Terminal.tsandsrc/common/public/TerminalCore.ts. I took a guess at what to remove based on what I thought would still be meaningful in the Node environment and on the discussion in Create a node.js target for xterm.js #2749, but I'd appreciate feedback here.node-test/index.js, which I used to verify that the changes described above can be compiled, built, and used in a Node project based on the included README.src/common/public/Terminal.ts. Changes to that file should be disregarded for now.I'm expecting this to need lots of work—looking forward to your feedback!