diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..43e40c7
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,27 @@
+version: 2
+updates:
+- package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: monthly
+ time: "21:00"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: axios
+ versions:
+ - "> 0.19.2, < 0.20"
+ - dependency-name: axios
+ versions:
+ - "> 0.20.0, < 1"
+ - dependency-name: webpack-cli
+ versions:
+ - 4.3.1
+ - 4.4.0
+ - 4.5.0
+ - dependency-name: webpack
+ versions:
+ - 5.24.2
+ - dependency-name: css-loader
+ versions:
+ - 5.0.1
+ - 5.1.1
diff --git a/.gitignore b/.gitignore
index 901ec32..f95bc96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -306,3 +306,5 @@ __pycache__/
*.odx.cs
*.xsd.cs
.vscode/set_dev.ps1
+vuejs-aspnetcore-ssr1.sln
+vuejs-aspnetcore-ssr.sln
diff --git a/.whitesource b/.whitesource
new file mode 100644
index 0000000..f056952
--- /dev/null
+++ b/.whitesource
@@ -0,0 +1,8 @@
+{
+ "generalSettings": {
+ "shouldScanRepo": true
+ },
+ "checkRunSettings": {
+ "vulnerableCheckRunConclusionLevel": "failure"
+ }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 7f3e437..b264b2a 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,18 @@
# README
+Update 2022/05/01: I was trying to figure out how to do SSR in .NET6 for Vue3 app,
+however it seems Microsoft has ditched the SPA / JS Service in favor of Blazor since .NETCore 3.
+Therefore it seems not possible to do SSR in ASP.NET for Vue anymore... -_-
+
+[[Announcement] Obsoleting Microsoft.AspNetCore.SpaServices and Microsoft.AspNetCore.NodeServices](https://github.com/dotnet/AspNetCore/issues/12890)
+
This repository was built from scratch following the steps described in the original blog post *[Server rendering Vue.js applications with ASP.NET Core](https://stu.ratcliffe.io/2017/07/20/vuejs-serverside-rendering-with-aspnet-core)* from Stu Ratcliffe. The aim of this repository is to adding more steps and comments from my experience following the steps that make it works as a supplement of the original blog post. I personally did not have any prior knowledge in VueJS nor modern web development frameworks. I were a C# developer and learn VueJS by my own from VueJS documentation and Stu Ratcliffe blog post. Hope this helps if you also read the same blog post and got stuck some way. :pray: :grinning:
-You can get the complete code repo made by Stu Ratcliffe from [[Here]](https://github.com/sturatcliffe/VueDotnetSSR)
+You can get the complete code repo made by **Stu Ratcliffe** from [[Here]](https://github.com/sturatcliffe/VueDotnetSSR)
+
+Once you get used to this repository, you may want to know how to do the same thing in Typescript.
+**@Kukks** has forked this repository and use Typescript instead.
+You can find his repository [[Here]](https://github.com/Kukks/vuejs-aspnetcore-ssr/tree/feature/langspecific)
## Install and run:
dotnet restore
@@ -97,26 +107,26 @@ To simulate timely API call form remote server, we add the following line in Hom
1. Add the following dependencies to package.json:
- devDependencies:
- - aspnet-webpack
+ - aspnet-webpack [Replaced by Microsoft.AspNetCore.SpaServices.Extensions]
- webpack-merge
- dependencies:x
- vue-server-renderer
- aspnet-prerenderer
-2. Split the code into two part:
+3. Split the code into two part:
1. `server.js` <- this will load by renderOnServer.js, which aspnet-prerendering will trigger Node to execute and return pre-rendered result back to renderOnServer.js and thus send to browser as initial state of app.
2. `client.js` <- once initial app state rendered and injected in the resulting index.cshtml, the script tag will load client.js and mount it to pre-rendered app tag.
-3. Create Node server code for ASP.NET Core to trigger the Node hosting service to execute
+4. Create Node server code for ASP.NET Core to trigger the Node hosting service to execute
- `rendererOnServer.js` <- responsible for loading the webpacked server.js for Node to render the initial app state.
-4. ASP.NET Core part
+5. ASP.NET Core part
- Edit `Views/Home/index.cshtml` app tag to use `aspnet-prerendering` attributes
-5. Webpack Configuration
+6. Webpack Configuration
- Edit `webpack.config.js`, make use of `webpack-merge` to split the original configuration into two sets.
@@ -184,4 +194,4 @@ Cheers. :smirk:
### Reference
*[Building Single Page Applications on ASP.NET Core with JavaScriptServices](https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/)*
-*[Use JavaScriptServices to Create Single Page Applications in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/client-side/spa-services)*
\ No newline at end of file
+*[Use JavaScriptServices to Create Single Page Applications in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/client-side/spa-services)*
diff --git a/package.json b/package.json
index 627cd77..bcd4df6 100644
--- a/package.json
+++ b/package.json
@@ -11,30 +11,30 @@
"private": true,
"dependencies": {},
"devDependencies": {
- "aspnet-webpack": "^3.0.0",
"aspnet-prerendering": "3.0.1",
- "vue": "^2.5.13",
- "vue-server-renderer": "^2.5.13",
- "vue-loader": "^15.2.4",
- "vue-template-compiler": "^2.5.13",
- "vue-router": "^3.0.1",
- "vuex": "^3.0.1",
+ "aspnet-webpack": "^3.0.0",
+ "axios": "^1.3.4",
"babel-core": "^6.26.3",
- "babel-loader": "^7.1.4",
+ "babel-loader": "^9.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
- "css-loader": "^0.28.10",
- "json-loader": "^0.5.7",
- "style-loader": "^0.21.0",
- "webpack": "^4.12.0",
- "webpack-cli": "^3.0.3",
- "webpack-hot-middleware": "^2.22.2",
- "webpack-dev-middleware": "^3.1.3",
- "webpack-merge": "^4.1.2",
- "axios": "^0.18.0",
"bootstrap-vue": "^2.0.0-rc.11",
- "lodash": "^4.17.10",
+ "css-loader": "^7.1.2",
+ "json-loader": "^0.5.7",
+ "lodash": "^4.17.11",
"nprogress": "^0.2.0",
- "serialize-javascript": "^1.5.0"
+ "serialize-javascript": "^6.0.0",
+ "style-loader": "^4.0.0",
+ "vue": "^2.6.10",
+ "vue-loader": "^17.0.0",
+ "vue-router": "^4.0.14",
+ "vue-server-renderer": "^2.6.10",
+ "vue-template-compiler": "^2.6.10",
+ "vuex": "^4.0.2",
+ "webpack": "^5.47.1",
+ "webpack-cli": "^5.1.4",
+ "webpack-dev-middleware": "^7.3.0",
+ "webpack-hot-middleware": "^2.24.4",
+ "webpack-merge": "^6.0.1"
}
}
diff --git a/vdn.csproj b/vdn.csproj
index b36fc56..e28da9b 100644
--- a/vdn.csproj
+++ b/vdn.csproj
@@ -5,7 +5,7 @@
-
+