[PR #10067] [MERGED] Add a Scratch.sln for prototyping #27877

Open
opened 2026-01-31 09:24:50 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10067
Author: @zadjii-msft
Created: 5/10/2021
Status: Merged
Merged: 6/10/2021
Merged by: @undefined

Base: dev/migrie/interactivity-projection-000Head: dev/migrie/oop/sample-project


📝 Commits (10+)

  • 015c8a5 After much work, a .sln that can be used to just test XI, with MUX
  • 92478bb rename this thing
  • 761b692 Embed a Terminal Control in the app, whoop whoop
  • ad71df3 Some polish for the sample app
  • 07c731d Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project
  • 71d445b Add updates to the project from dev/migrie/oop/the-whole-thing
  • 6e3fadd Some cleanup for review
  • 4a66f61 Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project
  • 6cc9f37 make spellbot happy
  • ede169a Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project

📊 Changes

46 files changed (+3069 additions, -0 deletions)

View changed files

Scratch.sln (+221 -0)
scratch/ScratchIslandApp/Package/Package.appxmanifest (+68 -0)
scratch/ScratchIslandApp/Package/Package.wapproj (+155 -0)
scratch/ScratchIslandApp/Package/Resources/Resources.resw (+126 -0)
scratch/ScratchIslandApp/Package/Resources/en-US/Resources.resw (+123 -0)
scratch/ScratchIslandApp/SampleApp/App.base.h (+40 -0)
scratch/ScratchIslandApp/SampleApp/App.cpp (+65 -0)
scratch/ScratchIslandApp/SampleApp/App.h (+29 -0)
scratch/ScratchIslandApp/SampleApp/App.idl (+16 -0)
scratch/ScratchIslandApp/SampleApp/App.xaml (+71 -0)
scratch/ScratchIslandApp/SampleApp/MyPage.cpp (+54 -0)
scratch/ScratchIslandApp/SampleApp/MyPage.h (+28 -0)
scratch/ScratchIslandApp/SampleApp/MyPage.idl (+10 -0)
scratch/ScratchIslandApp/SampleApp/MyPage.xaml (+56 -0)
scratch/ScratchIslandApp/SampleApp/MySettings.cpp (+11 -0)
scratch/ScratchIslandApp/SampleApp/MySettings.h (+97 -0)
scratch/ScratchIslandApp/SampleApp/MySettings.idl (+14 -0)
scratch/ScratchIslandApp/SampleApp/Resources/en-US/Resources.resw (+120 -0)
scratch/ScratchIslandApp/SampleApp/SampleAppLib.vcxproj (+181 -0)
scratch/ScratchIslandApp/SampleApp/SampleAppLogic.cpp (+84 -0)

...and 26 more files

📄 Description

⚠️ This targets #10051

Summary of the Pull Request

This PR creates a Samples solution which can be used for quickly testing our particular WinUI + Xaml Islands + wapproj setup, with a TermControl. This lets us quickly prototype and minimally repro xaml islands bugs, but also lets us iterate quickly on changes in the process model. I'll be using this in the future to prove that the out-of-proc control works (for tear-out), without having to tear up the entire TerminalApp all at once.

While I'll be leaning on this extensively for tear-out prototyping, I've also found myself wanting this kind of sample sln many times in the past. We run into bugs all the time where we're not sure if they're XAML Islands bugs or Terminal bugs. However, standing up a scratch sln with MUX hooked up, and a XamlApplication from the toolkit, and XAML Islands is time consuming. This sample sln should let us validate if bugs are XI bugs or Terminal bugs much easier.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

This is largely a copy-pasta of our existing projects, in massively simplified form. I'm gonna wontfix most comments on the code that was copy-pasta'd. If it's bad here, it's probably also bad in the real version in OpenConsole.sln.

  • I made an entirely new .sln for this, so that these samples wouldn't need to build in CI. They're not critical code, they're literally just for prototyping.
  • TerminalAppLib & TerminalApp became SampleAppLib and SampleApp. This is just a simple application hosting a single TermControl. It references the winmds and dlls from the main OpenConsole.sln, but in a way that would be more like a project consuming a nuget feed of the control, rather than a ProjectReference.
    • It still does all the App.xaml and Toolkit.XamlApplication stuff that TerminalApp does, so that it can load MUX resources, and do MUX-y things.
  • WindowsTerminal became WindowExe. I tore out all of the NonClientIslandWindow stuff - this is just a window with a xaml island.
  • CascadiaPackage became Package. It does the vclibs hack again for the TerminalConnection dlls (because this package can't actually determine that TerminalConnection.dll requires cprest*.dll), as well as for windowsterminal.exe (which we'll need in the future for out-of-proc controls). I got rid of all the Dev/Preview/Release asset machinations as well.

Wherever possible, I changed filenames slightly so that they won't get accitdentally opened when someone tries to open a file by name in their editor (cough sublime's ctrl+p menu cough).

Validation Steps Performed

The sample app launches, and displays a TermControl. What else do you want? (rhetorical, not a prompt for a wishlist)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10067 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/10/2021 **Status:** ✅ Merged **Merged:** 6/10/2021 **Merged by:** [@undefined](undefined) **Base:** `dev/migrie/interactivity-projection-000` ← **Head:** `dev/migrie/oop/sample-project` --- ### 📝 Commits (10+) - [`015c8a5`](https://github.com/microsoft/terminal/commit/015c8a5411771e1358eebff2090636c774d70c92) After much work, a .sln that can be used to just test XI, with MUX - [`92478bb`](https://github.com/microsoft/terminal/commit/92478bbd62e9b459825fd09b5bb217d2b4db9e87) rename this thing - [`761b692`](https://github.com/microsoft/terminal/commit/761b69208d524da4e6d22f6ab9d958c6a6a667ae) Embed a Terminal Control in the app, whoop whoop - [`ad71df3`](https://github.com/microsoft/terminal/commit/ad71df3bb77c871855af32f7bffb0d786258433f) Some polish for the sample app - [`07c731d`](https://github.com/microsoft/terminal/commit/07c731d06f5172fa65cf8b73f015e5039f5deb6c) Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project - [`71d445b`](https://github.com/microsoft/terminal/commit/71d445b7aaa0175131d132df0d6455d6f43f6a28) Add updates to the project from `dev/migrie/oop/the-whole-thing` - [`6e3fadd`](https://github.com/microsoft/terminal/commit/6e3fadda660a7f01b9653121484f1f97818d9c82) Some cleanup for review - [`4a66f61`](https://github.com/microsoft/terminal/commit/4a66f61c6ed85e2a06dbacfb16d7ee8f88805df9) Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project - [`6cc9f37`](https://github.com/microsoft/terminal/commit/6cc9f37098c1710214727d9faa49dc40dc286031) make spellbot happy - [`ede169a`](https://github.com/microsoft/terminal/commit/ede169a926a6a383dc0dd2e71261f9d9062b9fc5) Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project ### 📊 Changes **46 files changed** (+3069 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `Scratch.sln` (+221 -0) ➕ `scratch/ScratchIslandApp/Package/Package.appxmanifest` (+68 -0) ➕ `scratch/ScratchIslandApp/Package/Package.wapproj` (+155 -0) ➕ `scratch/ScratchIslandApp/Package/Resources/Resources.resw` (+126 -0) ➕ `scratch/ScratchIslandApp/Package/Resources/en-US/Resources.resw` (+123 -0) ➕ `scratch/ScratchIslandApp/SampleApp/App.base.h` (+40 -0) ➕ `scratch/ScratchIslandApp/SampleApp/App.cpp` (+65 -0) ➕ `scratch/ScratchIslandApp/SampleApp/App.h` (+29 -0) ➕ `scratch/ScratchIslandApp/SampleApp/App.idl` (+16 -0) ➕ `scratch/ScratchIslandApp/SampleApp/App.xaml` (+71 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MyPage.cpp` (+54 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MyPage.h` (+28 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MyPage.idl` (+10 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MyPage.xaml` (+56 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MySettings.cpp` (+11 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MySettings.h` (+97 -0) ➕ `scratch/ScratchIslandApp/SampleApp/MySettings.idl` (+14 -0) ➕ `scratch/ScratchIslandApp/SampleApp/Resources/en-US/Resources.resw` (+120 -0) ➕ `scratch/ScratchIslandApp/SampleApp/SampleAppLib.vcxproj` (+181 -0) ➕ `scratch/ScratchIslandApp/SampleApp/SampleAppLogic.cpp` (+84 -0) _...and 26 more files_ </details> ### 📄 Description #### ⚠️ This targets #10051 ## Summary of the Pull Request This PR creates a `Samples` solution which can be used for quickly testing our particular WinUI + Xaml Islands + wapproj setup, with a `TermControl`. This lets us quickly prototype and minimally repro xaml islands bugs, but also lets us iterate quickly on changes in the process model. I'll be using this in the future to prove that the out-of-proc control works (for tear-out), without having to tear up the entire `TerminalApp` all at once. While I'll be leaning on this extensively for tear-out prototyping, I've also found myself wanting this kind of sample sln many times in the past. We run into bugs all the time where we're not sure if they're XAML Islands bugs or Terminal bugs. However, standing up a scratch sln with MUX hooked up, and a `XamlApplication` from the toolkit, and XAML Islands is time consuming. This sample sln should let us validate if bugs are XI bugs or Terminal bugs much easier. ## References * Tear-out: #1256 * Megathread: #5000 * Project: https://github.com/microsoft/terminal/projects/5 ## PR Checklist * [x] Closes one bullet point of https://github.com/microsoft/terminal/projects/5#card-50760312 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments This is _largely_ a copy-pasta of our existing projects, in massively simplified form. I'm gonna wontfix most comments on the code that was copy-pasta'd. If it's bad here, it's probably also bad in the real version in `OpenConsole.sln`. * I made an entirely new `.sln` for this, so that these samples wouldn't need to build in CI. They're not critical code, they're literally just for prototyping. * `TerminalAppLib` & `TerminalApp` became `SampleAppLib` and `SampleApp`. This is just a simple application hosting a single `TermControl`. It references the winmds and dlls from the main `OpenConsole.sln`, but in a way that would be more like a project consuming a nuget feed of the control, rather than a `ProjectReference`. - It still does all the `App.xaml` and `Toolkit.XamlApplication` stuff that TerminalApp does, so that it can load MUX resources, and do MUX-y things. * `WindowsTerminal` became `WindowExe`. I tore out all of the `NonClientIslandWindow` stuff - this is just a window with a xaml island. * `CascadiaPackage` became `Package`. It does the vclibs hack again for the `TerminalConnection` dlls (because this package can't actually determine that `TerminalConnection.dll` requires `cprest*.dll`), as well as for `windowsterminal.exe` (which we'll need in the future for out-of-proc controls). I got rid of all the Dev/Preview/Release asset machinations as well. Wherever possible, I changed filenames slightly so that they won't get accitdentally opened when someone tries to open a file by name in their editor (**cough** sublime's <kbd>ctrl+p</kbd> menu **cough**). ## Validation Steps Performed The sample app launches, and displays a TermControl. What else do you want? <sup>(_rhetorical, not a prompt for a wishlist_)</sup> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:24:50 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27877