Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Updating Razor to official MS version #1479

Merged
merged 6 commits into from
May 15, 2014

Conversation

phillip-haydon
Copy link
Member

PR for #1325

@thecodejunkie thecodejunkie added this to the 0.23 milestone Mar 15, 2014
@grumpydev
Copy link
Member

Several failing tests so can't pull this in .. I've re-run the build but it's definitely a "proper" fail rather than Mono being daft.

@luisrudge
Copy link

Why 2.0 and not 3.0?

@grumpydev
Copy link
Member

@luisrudge 3.0 requires 4.5 I think.. although I don't think there's any reason for them to build it that way :(

@thecodejunkie
Copy link
Member

Yep, 3.0 is .NET 4.5 only

@luisrudge
Copy link

http://www.asp.net/visual-studio/overview/2013/release-notes#TOC14

It would be really hard to use nancy with asp.net mvc 5 then?

@phillip-haydon
Copy link
Member Author

@luisrudge - no, this would just make it easier to use binding redirects for 3.0 and make it easier to support Nancy + MVC in a single app.

We don't use any advanced features from Razor besides templating anyway.

Razor 3 doesn't actually use anything form .NET 4.5, and could be built on 4.0 if they wanted. I donno the purpose behind their choose to go 4.5.

@luisrudge
Copy link

Well, but a new mvc project comes with razor 3, and, if i install nancy.razor, it will come with mvc 2, right? or it will work with mvc 3 just fine?

@phillip-haydon
Copy link
Member Author

Binding Redirects.

@stanislavromanov
Copy link
Contributor

Why do you still want to support .NET 3 tho?

@khellang
Copy link
Member

@stanislavromanov We don't. .NET 4.0 is good enough 😄

@grumpydev
Copy link
Member

@stanislavromanov we don't, we support .net 4 and above,

@hmemcpy
Copy link
Contributor

hmemcpy commented May 7, 2014

Preliminary checks tell me that the ReSharper plugin will not be affected by this change. I'll allow it :D

@phillip-haydon
Copy link
Member Author

Thanks for signing off @hmemcpy ;)

@PureKrome
Copy link
Contributor

polite bump 😄

tehehehe

@grumpydev
Copy link
Member

Given this isn't the latest version of razor, because of the 4.5 issue, wont this actually make us less compatible with projects that use razor, or will an automatic huge binding redirect work? That needs to be checked, if it hasn't already, before this comes in.

@grumpydev
Copy link
Member

Huge==nuget

@phillip-haydon
Copy link
Member Author

I want to get this in for the CI build to test everything. I've tested with a locally built and it works with a binding redirect to 3.0. But like I say. Want a CI all to double test and make sure.

-----Original Message-----
From: "Steven Robbins" notifications@github.com
Sent: ‎5/‎12/‎2014 1:44 PM
To: "NancyFx/Nancy" Nancy@noreply.github.com
Cc: "Phillip Haydon" phillip.haydon@gmail.com
Subject: Re: [Nancy] Updating Razor to official MS version (#1479)

Huge==nuget

Reply to this email directly or view it on GitHub.

@grumpydev
Copy link
Member

Locally built as in you've directly referenced the assembly, or as in you've manually built the nuget locally and installed it via nuget with a local package source?

@phillip-haydon
Copy link
Member Author

I built the project locally and then referenced those. That worked for me,
but maybe I did something wrong, hence why I've been bugging you in JabbR
to get CI build done so I can test with that instead.

On Mon, May 12, 2014 at 1:49 PM, Steven Robbins notifications@github.comwrote:

Locally built as in you've directly referenced the assembly, or as in
you've manually built the nuget locally and installed it via nuget with a
local package source?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1479#issuecomment-42800675
.

Kind Regards,
Phillip Haydon
www.philliphaydon.com

@grumpydev
Copy link
Member

But it can't go into a CI build until it's been tested, and the only way to test this is to build the package locally and use a local nuget repo to install it alongside the latest MVC and see what happens.

@thecodejunkie
Copy link
Member

If we get it into CI we would risk having someone fork master and then risk having those forks screwed up if we had to rollback the changes, thus rewriting history. We can't pull stuff into master to test something out =/

@PureKrome
Copy link
Contributor

With our CI (for our priv work stuff) we have it look at upstream/dev (and other builds looking our own forks, etc)

can we have a build that kicks in when upstream/dev has a new commit?

@grumpydev
Copy link
Member

I don't see any reason to have that when it's one command from the commandline to build the packages yourself. Plus, we are running on a free azure subscription so putting additional load on the CI may well push us over the limits.

@phillip-haydon
Copy link
Member Author

Ok when you build the package locally send me the zip with the nugets so I can test.

@thecodejunkie
Copy link
Member

Hmm why don't you build it yourself? It's as simple as rake nuget_package :)

@grumpydev
Copy link
Member

I assumed he was :trollface:-ing

@phillip-haydon
Copy link
Member Author

Simple if you have all that setup... Not something that has ever worked for me.

@grumpydev
Copy link
Member

Pulled this locally and created the nugets:

https://dl.dropboxusercontent.com/u/21341/nancy/nuget.zip

@phillip-haydon
Copy link
Member Author

So far testing isn't going well. It looks like MVC steals the razor files and pre-compiles them making them unusable for Nancy.

The result is Nancy will render a blank page.

@grumpydev
Copy link
Member

Steals them? How? All we need is the file on the disk, we do our own thing after that.. unless there's some horrible hardwiring going on inside razor itself?

@phillip-haydon
Copy link
Member Author

I'm not sure @grumpydev

I created a new MVC App...

Returned "Hello World from MVC" and "Hello World from Nancy"

Both these work.

I Then created a View that output some text from a model. Wired it up in Nancy. Ran it. It works...

I then created an action in MVC and told it to use the same view.

The view is rendered by MVC, but now blank in Nancy... I comment out the MVC stuff, works in Nancy....

It's like the Razor thing is caching it.

@phillip-haydon
Copy link
Member Author

I got it all working, the web.config got messed up and was causing weird results in testing.

OK so I've tested:

  • MVC 4 App with Razor 2 + Nancy
  • MVC 5 App with Razor 3 + Nancy (binding redirect)
  • MVC 4 App with Razor 2 + Nancy (Mono)
  • MVC 5 App with Razor 3 + Nancy (binding redirect + Mono)
  • Nancy + Razor 2
  • Nancy + Razor 3
  • Nancy + Razor 2 (Mono)
  • Nancy + Razor 3 (Mono)

This is all with and without View Models, and layouts.

Everything seems to be working perfectly.

Note: All this was done using shared views (same view used by both Nancy and MVC) and the only thing that is an issue would be using the Nancy Base View.

It will cause an exception, but that's fine IMO. I expected an exception when I tested that.

grumpydev added a commit that referenced this pull request May 15, 2014
@grumpydev grumpydev merged commit f077181 into NancyFx:master May 15, 2014
@grumpydev
Copy link
Member

👍

@thecodejunkie
Copy link
Member

❤️

@PureKrome
Copy link
Contributor

WoHoo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants