Skip to content

Refactor pure C++ types from TerminalApp.dll into a lib #1042

@zadjii-msft

Description

@zadjii-msft

Right now we have one big dll that is declaring both cppwinrt types (e.g. AppKeyBindings, App) and pure c++ types (Tab, Profile, etc.).

If one were to try and create a unittesting project for the TerminalApp project, you unfortunately would be unable to do this, because many of the types are only linked into this TerminalApp.dll. For pure cppwinrt types, this isn't that big of a deal, because instantiating the types just does cppwinrt magic to activate them. However, for pure cpp classes, we can't actually link them. This means we can't test things like json parsing, Pane recursing, settings synthesis.

So we'll have to pull all the types that aren't winrt types out into their own lib, and have the TerminalApp project consume that lib.

I'm not worried about TermControl and TermConnection so much, since those are only using cppwinrt types at the moment. Should they get more elaborate, then it might be necessary to do a similar refactoring.

Worries:

  1. Does this mean we're going to have now two pch.pch files for the TerminalApp, one for the lib and one for the dll? could we avoid that? See Share PCH files #946.
  2. The lib seems to need to include winrt/coroutine.h (and any other cppwinrt headers that components might need). Those are generated files. Right now they're generated by the TerminalApp(dll) build, but theoretically they'll need to be created before that, because the lib will theoretically be built before the dll. This may mean that the lib needs to have some sort of cppwinrt tooling turned on, but I don't know what quite yet.

Metadata

Metadata

Assignees

Labels

Area-BuildIssues pertaining to the build system, CI, infrastructure, metaIssue-TaskIt's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions