-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ViewManagers to detect unimplemented properties #4575
Conversation
* Created new Microsoft.ReactNative.sln * Update PR to build vnext/Microsoft.ReactNative.sln * Add params to disable ReactUWP nuget pack during PR
* Move playground app to use Microsoft.ReactNative * formatting * Bunch of code review feedback * Change files * formatting * Delete unneeded gitignore * Minor removal of diff * Minor changes to try to avoid having to update cert all the time * Fix bundle command * No need to build rntester seperately, the release build of playground will do it from msbuild * Remove test property
* Disable .net native for managed unit tests * Change files * Enable managed unit tests in ci loop * re-merge unit test tasks, can't run arm anyway * Remove prefer 32bit from 64bit flavors * Update mstest dependencies * Managed tests are separate again * Add comment * Add test adapter path * x86 debug again * Update test adapter folder * Try again * remove frameworkuap10 * Switch to appxrecipie * Try to switch to installed version of vstest * Remove installer task
* Prototype mockable MessageQueueThread and JSExecutor * Declare MockJSExecutor::CallFunctionFunctor * Add missing using std::unique_ptr * Use WebSocketModule::MethodId * clang format * Make WebSocketModule methods override instead of virtual. * Allow WebSocketModule to use custom resource factory * Rename *Impl to *Mock * Move Instance mocks into separate source files * Move Instance mocks into separate source files * Change files * clang format * Define WebSocketModule::SetResourceFactory
-Surface msbuild errors (shows as undefined right now) -downloading nuget with Invoke-WebRequest will usually take a long time because of the PS progress bar (which sadly gets updated for every byte), so I'm disabling the progress bar (it only takes a second to download when the progress bar is turned off) retry once if nuget failed since if you cancel at just the right time, you could end up with a truncated nuget.exe and are wedged unless you know which file to delete. Learned that the hard way. -factor out calling onto powershell functions -we were not exposing whether the function failed or not
* Don't set readyState on connection error * Change files
* Simplified C++ macros and improved their comments * Change files
I like the webview when the error message is clearly an html doc. #Resolved |
m_stackPanel.Children().Clear(); | ||
m_stackPanel.Children().Append(webView); | ||
|
||
auto dispatcher = winrt::Windows::System::DispatcherQueue::GetForCurrentThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
winrt::Windows::System::DispatcherQueue::GetForCurrentThread(); [](start = 26, length = 63)
Thanks for changing this to DispatcherQueue! Strange... I was literally 5 seconds away from suggesting this when I saw your latest revision. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…rosoft#4575)" This reverts commit 31bed1c.
This lays the groundwork for being able to test whether properties are implemented or not.
The meat of the change is to refactor ViewManager classes, so that the only thing view managers should implement is UpdateProperty (i.e. handle a single property, as opposed to UpdateProperties for multiple properties). This factors out the iteration of the property map onto the ViewManagerBase class. In addition to this, UpdateProperty will return bool so that we can detect when nobody in the inheritance chain was able to handle a property.
With this, the test hook will currently print unimplemented properties to the debugger (this will be later augmented to enable us to write tests that check the fact that a property must be implemented, as well as to enable us to measure the % of implemented API surface, see #3587 )
I'm also adding some heuristics to have RedBox point the developer to a page which we hope to augment with more details on how to debug Metro bundling issues.
I'm also detecting a new type of Metro error which is an html document. To display these, we will host a WebView and tell it to navigate to the provided HTML. The trickiest part is sizing the webview since there is currently no way for XAML to measure the element. The HTML we get is also not styled so normally it would display as black text on white background whereas the rest of the redbox is red. To achieve the desired effect and set the right height for the webview, I devised a somewhat clever trick to run some JavaScript on the hosted WebView to get the rendered height and set the background/foreground.
Result:
Fixes #4572 #4573
Microsoft Reviewers: Open in CodeFlow