Skip to content

Allow Javascript engines to be bypassed entirely. #254

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

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

dustinsoftware
Copy link
Member

If no server-side rendering will occur on a page, for instance if
component render is called with clientOnly: true, it is
pointless to initialize a Javascript engine on the server. This allows the
consumer to easily disable all server side Javascript if the server is
under heavy load.

@dustinsoftware
Copy link
Member Author

I see that I forgot to sign the CLA before submitting this PR - just did that.

@Daniel15
Copy link
Member

Seems reasonable to me!

It looks like there's a number of "invisible" changes that aren't actually related to this diff (looks like it might be changing the line endings from \r\n to \n or vice versa. Could you please revert those? We can fix those up in a separate commit :)

#if LEGACYASPNET
namespace React.Web.Mvc
namespace React.Web.Mvc
Copy link
Member

Choose a reason for hiding this comment

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

I can't see any noticeable change in this line so it's probably replaced newlines (\r\n with \n or vice versa). Could you please revert all the lines that aren't directly related to your change?

@dustinsoftware
Copy link
Member Author

Yeah, it looks like the line endings are mixed in some of the files and VS auto corrected them :) Fix pushed

@Daniel15
Copy link
Member

It looks like a unit test is failing. Can you please take a look? https://ci.appveyor.com/project/Daniel15/react-net/build/108

Mvc\HtmlHelperExtensionsTests.cs(39,27): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\projects\react-net\src\React.Tests\React.Tests.csproj]
Mvc\HtmlHelperExtensionsTests.cs(64,27): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\projects\react-net\src\React.Tests\React.Tests.csproj]
Mvc\HtmlHelperExtensionsTests.cs(86,27): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\projects\react-net\src\React.Tests\React.Tests.csproj]
Done Building Project "C:\projects\react-net\src\React.Tests\React.Tests.csproj" (Rebuild target(s)) -- FAILED.

You can run the dev-build.bat file which will build the project and run the unit tests. Please ensure the bundled example site (React.Sample.Mvc4) still works fine as well.

@dustinsoftware
Copy link
Member Author

Fixed, sorry about that. I had been using the sample site to test before, but forgot to build solution before I pushed.

If no server-side rendering will occur on a page, for instance if
component render is called with clientOnly: true, it is
pointless to initialize a Javascript engine on the server. This allows the
consumer to easily disable all server side Javascript if the server is
under heavy load.
@Daniel15
Copy link
Member

Thanks 😄

@Daniel15 Daniel15 merged commit cf333b2 into reactjs:master Apr 18, 2016
@dustinsoftware dustinsoftware deleted the client-rendering branch April 18, 2016 20:46
@dustinsoftware
Copy link
Member Author

@Daniel15 would you mind publishing a package update so I can consume these changes?

@Daniel15
Copy link
Member

Will try to do that soon :) In the meantime, you could use the latest development package (see http://reactjs.net/getting-started/download.html#development-builds)

@Daniel15
Copy link
Member

This has been included in the 2.4 release (http://reactjs.net/2016/05/2.4.0-release.html). Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

3 participants