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

added a documentation for webrequest #291

Merged
merged 15 commits into from
Jan 25, 2019
Merged

added a documentation for webrequest #291

merged 15 commits into from
Jan 25, 2019

Conversation

SergejDK
Copy link
Collaborator

Documentation for making a webrequest is added in the documentation.

Is there a need for the example application?

fix #66

@SergejDK SergejDK changed the title added a documentation for webrequest with fsharp.data added a documentation for webrequest Jan 23, 2019
@TimLariviere
Copy link
Member

TimLariviere commented Jan 23, 2019

Thanks! It looks good.
Indentation could use a little fixing (in the code samples), but apart from that, it's great.

Is there a need for the example application?

Yes, please.

@SergejDK
Copy link
Collaborator Author

Will take a look at the identation this evening.
Sample will be added in the samples folder, too.

@TimLariviere
Copy link
Member

@SergejDK You can add this sample in the AllControls sample directly I think.

@SergejDK
Copy link
Collaborator Author

Ok, should not be a Problem.

@SergejDK
Copy link
Collaborator Author

MacOs, iOS and GTK need to be tested.
Somehow i can't add a nuget package there...

@SergejDK
Copy link
Collaborator Author

On Mac, iOs and GTK I get:

Could not load type of field 'Fabulous.DynamicViews.ViewElement:update' (0) due to: Could not resolve type with token 01000021 from typeref (expected class 'Microsoft.FSharp.Core.FSharpValueOption1' in assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:Microsoft.FSharp.Core.FSharpValueOption1 member:(null)

@TimLariviere do you know why?

@SergejDK
Copy link
Collaborator Author

Did not change anything, now it works on iOS, macOS and GTK.
But macOS has still a bug. When clicked on "MainPage" it gets a nullreference exception.

@SergejDK SergejDK changed the title added a documentation for webrequest [WIP] added a documentation for webrequest Jan 24, 2019
@TimLariviere
Copy link
Member

@SergejDK Yes, I saw this one when I tested the macOS node of AllControls.
If you can gather more information and open an issue, it would be great.
Thank you.

I'll take a look later to see if I can find why you were having an error with FSharpValueOption.

@SergejDK
Copy link
Collaborator Author

SergejDK commented Jan 24, 2019

The issue with the nullreference is in XF itself.
Will open an issue here just to show the others that is in progress.
xamarin/Xamarin.Forms#4156

@SergejDK
Copy link
Collaborator Author

The Travis build fails because it can not download fsharp data into the Android project. Any ideas ?

@TimLariviere
Copy link
Member

Yes, the samples don't use NuGet/packages.config.
Instead, we add the dependency in paket (https://github.com/fsprojects/Fabulous/blob/master/paket.dependencies) and then we make a manual reference to the dll in the fsproj.

This is kinda counter-intuitive.
But someday, I hope we can make that better. See #181 and #222.

For example: FSharp.Core in Android
https://github.com/fsprojects/Fabulous/blob/0f76787cba92635a6b7cb2c90242c5975b6b9bbc/paket.dependencies#L17-L20

https://github.com/fsprojects/Fabulous/blob/0f76787cba92635a6b7cb2c90242c5975b6b9bbc/samples/AllControls/Droid/AllControls.Droid.fsproj#L167-L169

So, to add FSharp.Data for Android, you can add a line in the group androidapp in the paket.dependencies file.
Make sure to do a paket.exe install to download the dependency on your machine.
Then change the path to the dll in the fsproj.

Also remove the unused packages.config.

@SergejDK
Copy link
Collaborator Author

Thanks!
Forgot about Paket ...
Will change asap

<Reference Include="FSharp.Core">
<HintPath>../../../packages/androidapp/FSharp.Core/lib/netstandard1.6/FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="FSharp.Data">
<HintPath>../../../packages/androidapp/FSharp.Data.3.0.0/lib/netstandard2.0/FSharp.Data.dll</HintPath>
Copy link
Member

Choose a reason for hiding this comment

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

Paket doesn't add the version number in the path

Suggested change
<HintPath>../../../packages/androidapp/FSharp.Data.3.0.0/lib/netstandard2.0/FSharp.Data.dll</HintPath>
<HintPath>../../../packages/androidapp/FSharp.Data/lib/netstandard2.0/FSharp.Data.dll</HintPath>

@@ -78,6 +78,7 @@
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
<None Include="Assets\AboutAssets.txt" />
<Content Include="packages.config" />
Copy link
Member

@TimLariviere TimLariviere Jan 25, 2019

Choose a reason for hiding this comment

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

Can you remove this line and the associated file (if still there)? Thanks

@@ -8,6 +8,7 @@
<EmbeddedResource Include="Baboon_Serengeti.jpg" />
<EmbeddedResource Include="styles.css" />
<PackageReference Include="FSharp.Core" />
<PackageReference Include="FSharp.Data" Version="3.0.0" />
Copy link
Member

@TimLariviere TimLariviere Jan 25, 2019

Choose a reason for hiding this comment

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

Versioning is centralized in the Packages.targets file at the root of the repository.
In this file, you only need to include the package (without version)
Then in the Packages.targets, you can add the version, just like the other packages.

Suggested change
<PackageReference Include="FSharp.Data" Version="3.0.0" />
<PackageReference Include="FSharp.Data" />

@SergejDK
Copy link
Collaborator Author

learned a lot ! Thank you 👍

@SergejDK SergejDK changed the title [WIP] added a documentation for webrequest added a documentation for webrequest Jan 25, 2019
@TimLariviere
Copy link
Member

@SergejDK The sample works great!

@TimLariviere
Copy link
Member

Thank you. I'm merging it now.

@TimLariviere TimLariviere merged commit 605ded1 into fabulous-dev:master Jan 25, 2019
@dsyme
Copy link
Collaborator

dsyme commented Jan 26, 2019

This is a fantastic addition to the docs

@TimLariviere TimLariviere mentioned this pull request Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs on making web requests
3 participants