Skip to content
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

WinRT support #59

Merged
merged 2 commits into from
Oct 13, 2014
Merged

WinRT support #59

merged 2 commits into from
Oct 13, 2014

Conversation

bennor
Copy link
Contributor

@bennor bennor commented Oct 13, 2014

Hey mate,

This is probably still WIP at the moment, but I've managed to get something to build, and was able to get a simple request working from a dummy WinRT app. 🤘

This is the first time I've even touched WinRT, so I had a few headaches and even managed to convince myself it didn't work for a while because deadlocks. 😠

Anyway, I think it's close, but I'm not really sure how to put it through more thorough testing. I'm not even sure where to begin with unit testing WinRT, so if you have any ideas I'd love some help.

The approach I took was just to polyfill all the reflection stuff and some static Uri methods that are absent (or moved) in WinRT. If that's the wrong approach, or you just have a better one, I'm open to suggestions.

Cheers

I made a whole bunch of shims to try and get the existing
RequestBuilderImplementation to build with as few modifications as
possible, but I have NFI if t will work for real on WinRT.
@clairernovotny
Copy link
Member

static class Uri
{
static readonly Dictionary<char, int> hexDigits
= "0123456789abcdef".Select((c, i) => new {c, i})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uppercase A, B, C, D, E, F are also hex digits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call. That'll teach me to push and go to sleep.

@anaisbetts
Copy link
Member

Ugh, I hate how I'm getting nerd-sniped to support this garbage platform :) Thanks for the PR @bennor

@clairernovotny
Copy link
Member

Hey, at least WinRT/Universal apps have a longer/better path forward than WP8 SL, esp with Threshold.

@anaisbetts anaisbetts merged commit 3eae062 into reactiveui:master Oct 13, 2014
@clairernovotny
Copy link
Member

@bennor bennor deleted the winrt branch October 13, 2014 20:25
@bennor
Copy link
Contributor Author

bennor commented Oct 13, 2014

Feel free to send any hassles supporting it my way. I opened this can of worms. 😸

@anaisbetts
Copy link
Member

@bennor It looks like it works, though I hit the deadlock issue too. Oh wells

@clairernovotny
Copy link
Member

What's the deadlock issue; how can I repro it to dig in?

@anaisbetts
Copy link
Member

@onovotny Try to make any web request from App.Loaded, it'll never return

@bennor
Copy link
Contributor Author

bennor commented Oct 16, 2014

I think the same for anything on the UI thread. Seems to be a limitation of async on the platform. Once I jumped through some hoops to make a proper async request it worked okay.

@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants