Skip to content

Commit 7db0032

Browse files
authored
docs: adjust Q&A discussion template, repro sample docs
1 parent 7d0c72e commit 7db0032

3 files changed

Lines changed: 130 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Q&A
2+
description: Ask the community for help
3+
body:
4+
5+
- type: textarea
6+
id: question
7+
attributes:
8+
label: Describe your issue
9+
description: |
10+
- Explain your problem in the most specific way. Provide any relevant error logs, full stack traces of exceptions, browser logs, etc...
11+
- If you have a build error, [make sure to attach a binlog](https://aka.platform.uno/msbuild-troubleshoot)
12+
13+
- type: textarea
14+
id: repro-steps
15+
attributes:
16+
label: Provide repro steps and sample
17+
description: |
18+
- Attach a [**minimal repro project**](https://aka.platform.uno/uno-repro-sample) and provide detailed **steps to reproduce**.
19+
- Make sure to attach the zip file to this discussion (you can use drag and drop of the zip file).
20+
21+
- type: textarea
22+
id: nuget-versions
23+
attributes:
24+
label: NuGet package version(s)
25+
26+
- type: dropdown
27+
id: platforms
28+
attributes:
29+
label: Affected platforms
30+
multiple: true
31+
options:
32+
- WebAssembly
33+
- Android
34+
- iOS
35+
- Mac Catalyst
36+
- Skia (WPF)
37+
- Skia (GTK on Linux/macOS/Windows)
38+
- Skia (Linux Framebuffer)
39+
- Windows
40+
- macOS (AppKit)
41+
- Build tasks
42+
43+
- type: dropdown
44+
id: ide
45+
attributes:
46+
label: IDE
47+
multiple: true
48+
options:
49+
- Visual Studio 2022
50+
- Visual Studio Code
51+
- Visual Studio for Mac
52+
- Rider Windows
53+
- Rider macOS

doc/articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@
426426
items:
427427
- name: Troubleshooting build errors
428428
href: uno-builds-troubleshooting.md
429+
- name: How to create a repro sample
430+
href: uno-howto-create-a-repro.md
429431
- name: Build error codes
430432
href: uno-build-error-codes.md
431433
- name: 'Debugging C# on WASM'
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
uid: Uno.Development.Create-Repro
3+
---
4+
5+
This documentation describes the steps needed to create a "repro" or reproduction project, which will help the community and maintainers troubleshoot issues that you may find when developing with Uno Platform.
6+
7+
## How to create a reproduction project (aka "repro")
8+
9+
The goal of a repro app is to find the **smallest possible piece of code that demonstrates the problem**, with the least dependencies possible. This is needed to make the resolution as fast as possible, as the Uno Platform team and community members do not have access to your projects sources nor understand your own expertise domain.
10+
11+
Some steps and questions to answer:
12+
1. Make sure to test with the latest Uno Platform pre-release builds, the issue might have already been fixed.
13+
1. Start from a new "blank uno app" from the Uno platform Visual Studio extension, or `dotnet new unoapp --preset=blank` app.
14+
1. Attach a .zip file of that repro to the issue.
15+
> [!TIP]
16+
> Watch out for the size of zip created. Check the section below on reducing the sample size.
17+
1. If you can, add a video or screenshots reproducing the issue. Github supports uploading `mp4`` files in issues.
18+
19+
## Tips on how to create the simplest repro app
20+
- Find the smallest piece of API used by your app (XAML Control, method, type) and extract that code into the repro app
21+
- If it's impacting a control:
22+
- Try replicating the interactions as minimally as possible by cutting the ties with the rest of your original app
23+
- Try altering the properties of the control by either removing the styles, changing the styles, changing modes of the control if there are any.
24+
- If you can't repro in a separate app because there are too many dependencies in your app try, removing as much code as you can around the use of failing API or Control. This may include removing implicit styles, global initializations.
25+
- If the control offers events, try adding logging to Loading/Unloading/PropertyChanged/LayoutUpdated or other available events to determine if the Control or API is interacting with your code in expected ways. Sometimes adding a breakpoint in the handler of those events can show interesting stack traces.
26+
- When debugging data bindings:
27+
- Show the text version of the binding expression somewhere in the UI, to see the type of the bound data:
28+
- `<TextBlock Text="{Binding}" />`
29+
- `<TextBlock Text="{Binding MyProperty}" />`
30+
- `<TextBlock Text="{Binding Command, ElementName=MyButton}" />`
31+
- Add an event handler to `DataContextChanged` in the code behind to see if and when the `DataContext` changed.
32+
- Analyze device and app logs for clues about the control's behavior.
33+
- You may enable [the controls debug logs](https://github.com/unoplatform/uno/blob/master/doc/articles/logging.md), if any.
34+
- To validate that logs are enabled and in Debug, those starting with `Windows`, `Microsoft` or `Uno` should be visible in the apps output. If not, make sure to [setup the logging properly](https://platform.uno/docs/articles/migrating-from-previous-releases.html).
35+
- Logs on iOS may need to have the [OSLog logger](https://github.com/unoplatform/uno.extensions.logging) enabled when running on production devices.
36+
- Try on different versions of Visual Studio, iOS, Android, Linux, or browsers
37+
- If available, try the API on Windows (UWP or WinUI) and see if it behaves differently that what Uno Platform is doing
38+
- When issues occur, try breaking on all exceptions to check if an exception may be hidden and not reported.
39+
- Update Uno.WinUI or other dependencies to previous or later versions, using a [bisection technique](https://git-scm.com/docs/git-bisect). Knowing which version of a package introduced an issue can help orienting the investigations.
40+
41+
## Creating a smaller zip file to upload to github
42+
43+
> Yowza, that’s a big file Try again with a file smaller than 10MB.
44+
> -- Github
45+
46+
If you get the above message when attempting to upload the zipped sample, thats usually because you have included, beside the source codes, needless build outputs inside `bin` and `obj` folders for each target heads.
47+
48+
You can usually reduce this by performing `Build > Clean Solution` before zipping the entire solution folder. It also helps to manually delete the `bin\` and `obj\` folders under each project heads that you've compiled.
49+
50+
However, sometimes that still may not be enough. In such case, you can leverage the `git` tool and a `.gitignore` file to further reduce the size of the solution.
51+
52+
# [**Windows**](#tab/windows)
53+
If you're inside of Visual Studio 2022:
54+
- Open the solution
55+
- At the bottom of the IDE window, click the **Add to Source Control** button, then **git**
56+
- Select **Local only**, then **Create**
57+
- Wait a few seconds for the changes to be committed
58+
- Close visual studio
59+
- Open a command line prompt in your solution folder and type `git clean -fdx`
60+
61+
Once done, you can zip the folder and send it to github in your issue or discussion.
62+
63+
# [**macOS / Linux**](#tab/nix)
64+
65+
Using a terminal:
66+
- Navigate to your sample's root folder
67+
- Type `wget https://raw.githubusercontent.com/github/gitignore/main/VisualStudio.gitignore -O .gitignore`
68+
- Type `git init`
69+
- Type `git add .`
70+
- Type `git commit -m "Initial sample commit"`
71+
- Type `git clean -fdx`
72+
73+
Once done, you can zip the folder and send it to github in your issue or discussion.
74+
75+
***

0 commit comments

Comments
 (0)