Conversation
|
Work is not fully complete but i decided to send the pull request so we could discuss here further. |
|
Thanks, I'll take a look at this soon! |
|
Have you had a chance to take a look yet? Please let me know if I can do anything to help with the progress :) |
|
@gunnim - Sorry for the delay! The past month has been very busy for me 😢 nonetheless, reviewing this is still on my list of things to do. Thanks for your patience! |
|
Gotcha, glad to hear I'm on the list! :) |
Daniel15
left a comment
There was a problem hiding this comment.
I'm so sorry for taking so long to review this!
Overall, this looks pretty good to me. I left a few comments inline.
Some of the files have very incorrect indentation (eg. lines indented by one space instead of one tab). Could you please fix those too?
| <Major>3</Major> | ||
| <Minor>0</Minor> | ||
| <Build>1</Build> | ||
| <Minor>1</Minor> |
There was a problem hiding this comment.
Don't worry about bumping this, I'll bump it on release.
build.proj
Outdated
| <PackageAssemblies Include="React.Owin" /> | ||
| <PackageAssemblies Include="React.Web" /> | ||
| <PackageAssemblies Include="React.Web.Mvc4" /> | ||
| <PackageAssemblies Include="React.Router" /> |
There was a problem hiding this comment.
Indentation looks a bit off here, maybe it's using spaces instead of tabs?
There was a problem hiding this comment.
Whoops, i went over the .cs files and tabified but i missed this file and some xml. fixed
| </namespaces> | ||
| </pages> | ||
| </system.web.webPages.razor> | ||
| </configuration> No newline at end of file |
There was a problem hiding this comment.
The react router htmlhelper lives in this namespace. I seem to recall being unable to use it if I didn't either have this statement in my web.config or an explicit using statement in file.
You have a similar file in the mvc4 project.
| ); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
You can probably just use ReactEnvironment.Current directly rather than wrapping it and rethrowing.
There was a problem hiding this comment.
Sure, that particular block is copied from react.aspnet\htmlhelperextensions.cs.
I imagined you had a reason for doing it there that would also apply here?
There was a problem hiding this comment.
In that case, I wanted to show a more specific error message for if ReactJS.NET was misconfigured. I guess that's useful here too though! Maybe ReactEnvironment should have a getter that does that (like ReactEnvironment.GetCurrentOrThrow()) so that the code is not duplicated.
| try | ||
| { | ||
| path = path ?? htmlHelper.ViewContext.HttpContext.Request.Path; | ||
| Response = Response ?? htmlHelper.ViewContext.HttpContext.Response; |
There was a problem hiding this comment.
Do you actually need the Response argument if it can come from the htmlHelper?
There was a problem hiding this comment.
No, this was just intended as a convenience and i was hoping it might help for unit testing?
But I guess it might just be confusing, I'll remove it
There was a problem hiding this comment.
Yeah i'm mocking the response obj in the unit tests, should I be doing this a different way?
There was a problem hiding this comment.
i was hoping it might help for unit testing
For unit testing, you should be able to mock the ViewContext property on the IHtmlHelper.
|
|
||
| namespace React.Router | ||
| { | ||
| /// <summary> |
There was a problem hiding this comment.
same as above, tabs on my end
| [Fact] | ||
| public void CreatesIReactComponent() | ||
| { | ||
| var mocks = new Mocks(); |
There was a problem hiding this comment.
it's tabbed I swear haha!
| public class EntryAssemblyFileSystemTests | ||
| { | ||
| [Theory] | ||
| [Theory] |
There was a problem hiding this comment.
It's tabbed. I don't remember but i must have been fixing the indentation since the file shows as changed.
There was a problem hiding this comment.
Sorry, looks good to me now, I guess there was a GitHub bug with rendering.
| { | ||
| public class HtmlHelperExtensionsTest | ||
| { | ||
| /// <summary> |
| } | ||
|
|
||
| //[Fact] | ||
| //public void EngineIsReturnedToPoolAfterRender() |
There was a problem hiding this comment.
Remove this if you don't need it.
There was a problem hiding this comment.
I was hoping for feedback from you on how to fix some of these tests.
I managed to fix
EngineIsReturnedToPoolAfterRender and
EnvironmentShouldGetCalledClientOnly myself but I think i need help with
ReactWithClientOnlyTrueShouldCallRenderHtmlWithTrue and
ReactWithServerOnlyTrueShouldCallRenderHtmlWithTrue
It's a static extension method calling another static extension method. Is there a way to proxy this behavior and have CreateRouterComponent create a Mocked reactcomponent?
Or should I let this and similar tests go?
Also please advise if you feel there should be more tests for some or any parts of this feature
There was a problem hiding this comment.
It's a static extension method calling another static extension method. Is there a way to proxy this behavior and have CreateRouterComponent create a Mocked reactcomponent?
Hmm, that's tricky 😕 Static methods can't be mocked. Are you having issues with the test because of that?
There was a problem hiding this comment.
Booya! Got all of my tests working :)
But my previous statement stands, this is not something I have good experience with so let me know if you think I need more.-.
|
Sorry about the confusing comments around indentation! It looks okay to me now. I guess I was hitting a Github bug - All the code was hard along the left margin, with no indentation at all. |
|
Hehe no problem, and I did in fact leave some spaces. Regarding the check failure, should i pull changes from this repo to fix the merge conflict? |
|
Noooo @Daniel15 ! |
|
Looking forward to trying this out - will build it locally and give it a go in one of our projects :) |
|
Was actually doing exactly the same hehe, got it building but some unit tests are failing on Message: System.IO.FileLoadException : Could not load file or assembly 'JavaScriptEngineSwitcher.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=c608b2a8cc9e4472' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) I actually just finished pulling your 3.1.0 release building from source and I get the same error there |
Try doing a clean build and see if that works. Usually this happens when you have an old assembly in the It looks like the AppVeyor build is working: https://ci.appveyor.com/project/Daniel15/react-net/build/269 |
|
So what did i did after trying to get the merge of branches working was... |
|
@Daniel15 This issue should be easily reproducible since I verified by doing a fresh clone of version 3.1.0. Problem goes away if i manually specify a binding redirect. |
|
The build still seems to be working fine for me. Released this today as version 3.2. Sorry for the delay. Thanks! |

No description provided.