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

Install packages for React, create ReactController #901

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

ycanardeau
Copy link
Contributor

First step towards #900.

@ycanardeau ycanardeau added the React JavaScript library: React label Jul 3, 2021
@ycanardeau ycanardeau added this to the React conversion milestone Jul 3, 2021
@ycanardeau ycanardeau self-assigned this Jul 3, 2021
@ycanardeau ycanardeau force-pushed the react-controller branch 3 times, most recently from 15e559d to d1e4a21 Compare July 6, 2021 10:23
@ycanardeau ycanardeau changed the title Create ReactController and components for Bootstrap and jQuery UI Install packages for React, create ReactController Jul 6, 2021
Comment on lines +69 to +75
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.11.0",
"react-overlays": "^5.1.0",
"react-router-dom": "^6.0.0-beta.0",
"react-transition-group": "^4.4.2",
"react-use": "^17.2.4"
Copy link
Contributor Author

@ycanardeau ycanardeau Jul 7, 2021

Choose a reason for hiding this comment

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

The react-overlays, react-transition-group and react-use packages can be uninstalled after #851. These packages are only used by #903.

Comment on lines +39 to +41
<remikus path="/bundles/manifest.js" />
<remikus path="/bundles/vendor.js" />
<remikus path="/bundles/index.js" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Powered by ReMikus. :)

</head>
<body class="vdb">
<div id="app"></div>
<script>window.vdb = @ToJS(new { Values = new GlobalValues(this) })</script>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The vdb global variable is used to pass data from backend to frontend. This variable is initialized only once, when the page is first loaded. See also the GlobalValues class.

@@ -0,0 +1,43 @@
@using System.Globalization
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: Some features in this file are not yet implemented.

@@ -370,6 +370,8 @@ void HandleHttpError(int code, string? description = null, string? msg = null)
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");

endpoints.MapFallbackToController(action: "Index", controller: "React");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ReactController controller will handle requests to the React app, which will simply serve the single page in the React app.

@ycanardeau ycanardeau merged commit c6c0f12 into future Jul 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
React JavaScript library: React
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant