Skip to content

ASP.NET MVC 4 with Babel 7 + server-side rendering + Fragments ? #798

Description

@oudoulj

I've just added ReactJS.NET 4.1.1 to my ASP.NET MVC 4 project and tried to do some server-side rendering using @Html.React()
I realized I couldn't use React.Fragment though because it requires Babel 7.
So I was wondering if you have any idea when ReactJS.NET with Babel 7 would be available ?

If that's not due soon, can someone advise a good tutorial on how to use the webpack integration as suggested on https://reactjs.net/2019/03/4.1.1-release.html ?
And how to generate a Babel 7-ready bundle.server.js file.
Thank you !

Activity

  1. dustinsoftware commented on May 10, 2019

    @dustinsoftware
    Contributor

    The webpack docs are here: https://reactjs.net/bundling/webpack.html

    There is a webpack sample here: https://github.com/reactjs/React.NET/tree/master/src/React.Sample.Webpack.CoreMvc

    Babel 7 is currently in one of the alpha builds, please enable it via this setting.

    We'll make Babel 7 the default in 5.0 but for now it is opt in.

  2. added this to the 5.0 milestone on May 10, 2019
  3. oudoulj commented on May 11, 2019

    @oudoulj
    Author

    Using the latest 5.0 alpha 3 and adding the following line did the work, thanks !
    ReactSiteConfiguration.Configuration.SetBabelVersion(BabelVersions.Babel7);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions