ASP.NET Core Integration with modern web frameworks










1















I am looking for guidance with respect to the following technologies and how best to integrate/setup moving forward concerns...



We have a number of existing web applications using asp.net and asp.net core. We want to update and move them forward taking advantage of more current JavaScript frameworks vue/angular. At this current moment, we are going with vue as we feel it is the easiest jump considering our current knockout based framework. These questions/concerns are similar regardless of the particular javascript framework under consideration



Currently we are using the framework respective cli tools, build the project/solution then copy the ClientApp into the same named folder in vs.net (then update the startup.cs) to integrate with hmr technology.



  1. Considerations...is it best to jump into full spa type approaches and entirely just move away from page level coding? While this may be best for learning, we do need ways to migrate existing applications without entire rewrites. Can the 2 approaches live easily within the same solution (we are migrating to vue at this moment). Are there git repositories showing this combined approach?
    I believe the best answer is a combination. One solution where routes can use historic mvc routing to a controller/method and view while others can route to individual spa pages together. I have yet to find a repository that demonstrates this combination. Potentially there is a good reason why it is difficult to locate.



  2. With respect to vue.js we have modified the Startup.cs to rely on vue cli 3 vue-cli-service to server up our page



    app.UseSpa(spa => spa.Options.SourcePath = "ClientApp"; 
    if (env.IsDevelopment())

    //spa.UseReactDevelopmentServer(npmScript: "start");
    // run npm process with client app
    spa.UseVueCli(npmScript: "serve", port: 8080);
    // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead,
    // app should be already running before starting a .NET client:
    // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port
    );


I have also seen solutions where they have modified the Startup to use app.UseWebpackDevMiddleware directly and pointing at the cli-service/webpack.config.js



 app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions

HotModuleReplacement = true,
ConfigFile = Path.Combine(env.ContentRootPath, @"node_modules@vuecli-servicewebpack.config.js")
);


Both approaches here may work fine, but I question which one we should establish as a best approach. Inherently I feel it is probably best to stay with #1 as it most aligns with the vue cli documentation where using UseWebpackDevMiddleware may just add more confusion to the mix.










share|improve this question
























  • I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

    – Ryan E.
    Nov 12 '18 at 18:04











  • As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

    – Ryan E.
    Nov 12 '18 at 18:10






  • 1





    Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

    – David
    Nov 12 '18 at 18:27















1















I am looking for guidance with respect to the following technologies and how best to integrate/setup moving forward concerns...



We have a number of existing web applications using asp.net and asp.net core. We want to update and move them forward taking advantage of more current JavaScript frameworks vue/angular. At this current moment, we are going with vue as we feel it is the easiest jump considering our current knockout based framework. These questions/concerns are similar regardless of the particular javascript framework under consideration



Currently we are using the framework respective cli tools, build the project/solution then copy the ClientApp into the same named folder in vs.net (then update the startup.cs) to integrate with hmr technology.



  1. Considerations...is it best to jump into full spa type approaches and entirely just move away from page level coding? While this may be best for learning, we do need ways to migrate existing applications without entire rewrites. Can the 2 approaches live easily within the same solution (we are migrating to vue at this moment). Are there git repositories showing this combined approach?
    I believe the best answer is a combination. One solution where routes can use historic mvc routing to a controller/method and view while others can route to individual spa pages together. I have yet to find a repository that demonstrates this combination. Potentially there is a good reason why it is difficult to locate.



  2. With respect to vue.js we have modified the Startup.cs to rely on vue cli 3 vue-cli-service to server up our page



    app.UseSpa(spa => spa.Options.SourcePath = "ClientApp"; 
    if (env.IsDevelopment())

    //spa.UseReactDevelopmentServer(npmScript: "start");
    // run npm process with client app
    spa.UseVueCli(npmScript: "serve", port: 8080);
    // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead,
    // app should be already running before starting a .NET client:
    // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port
    );


I have also seen solutions where they have modified the Startup to use app.UseWebpackDevMiddleware directly and pointing at the cli-service/webpack.config.js



 app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions

HotModuleReplacement = true,
ConfigFile = Path.Combine(env.ContentRootPath, @"node_modules@vuecli-servicewebpack.config.js")
);


Both approaches here may work fine, but I question which one we should establish as a best approach. Inherently I feel it is probably best to stay with #1 as it most aligns with the vue cli documentation where using UseWebpackDevMiddleware may just add more confusion to the mix.










share|improve this question
























  • I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

    – Ryan E.
    Nov 12 '18 at 18:04











  • As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

    – Ryan E.
    Nov 12 '18 at 18:10






  • 1





    Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

    – David
    Nov 12 '18 at 18:27













1












1








1


1






I am looking for guidance with respect to the following technologies and how best to integrate/setup moving forward concerns...



We have a number of existing web applications using asp.net and asp.net core. We want to update and move them forward taking advantage of more current JavaScript frameworks vue/angular. At this current moment, we are going with vue as we feel it is the easiest jump considering our current knockout based framework. These questions/concerns are similar regardless of the particular javascript framework under consideration



Currently we are using the framework respective cli tools, build the project/solution then copy the ClientApp into the same named folder in vs.net (then update the startup.cs) to integrate with hmr technology.



  1. Considerations...is it best to jump into full spa type approaches and entirely just move away from page level coding? While this may be best for learning, we do need ways to migrate existing applications without entire rewrites. Can the 2 approaches live easily within the same solution (we are migrating to vue at this moment). Are there git repositories showing this combined approach?
    I believe the best answer is a combination. One solution where routes can use historic mvc routing to a controller/method and view while others can route to individual spa pages together. I have yet to find a repository that demonstrates this combination. Potentially there is a good reason why it is difficult to locate.



  2. With respect to vue.js we have modified the Startup.cs to rely on vue cli 3 vue-cli-service to server up our page



    app.UseSpa(spa => spa.Options.SourcePath = "ClientApp"; 
    if (env.IsDevelopment())

    //spa.UseReactDevelopmentServer(npmScript: "start");
    // run npm process with client app
    spa.UseVueCli(npmScript: "serve", port: 8080);
    // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead,
    // app should be already running before starting a .NET client:
    // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port
    );


I have also seen solutions where they have modified the Startup to use app.UseWebpackDevMiddleware directly and pointing at the cli-service/webpack.config.js



 app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions

HotModuleReplacement = true,
ConfigFile = Path.Combine(env.ContentRootPath, @"node_modules@vuecli-servicewebpack.config.js")
);


Both approaches here may work fine, but I question which one we should establish as a best approach. Inherently I feel it is probably best to stay with #1 as it most aligns with the vue cli documentation where using UseWebpackDevMiddleware may just add more confusion to the mix.










share|improve this question
















I am looking for guidance with respect to the following technologies and how best to integrate/setup moving forward concerns...



We have a number of existing web applications using asp.net and asp.net core. We want to update and move them forward taking advantage of more current JavaScript frameworks vue/angular. At this current moment, we are going with vue as we feel it is the easiest jump considering our current knockout based framework. These questions/concerns are similar regardless of the particular javascript framework under consideration



Currently we are using the framework respective cli tools, build the project/solution then copy the ClientApp into the same named folder in vs.net (then update the startup.cs) to integrate with hmr technology.



  1. Considerations...is it best to jump into full spa type approaches and entirely just move away from page level coding? While this may be best for learning, we do need ways to migrate existing applications without entire rewrites. Can the 2 approaches live easily within the same solution (we are migrating to vue at this moment). Are there git repositories showing this combined approach?
    I believe the best answer is a combination. One solution where routes can use historic mvc routing to a controller/method and view while others can route to individual spa pages together. I have yet to find a repository that demonstrates this combination. Potentially there is a good reason why it is difficult to locate.



  2. With respect to vue.js we have modified the Startup.cs to rely on vue cli 3 vue-cli-service to server up our page



    app.UseSpa(spa => spa.Options.SourcePath = "ClientApp"; 
    if (env.IsDevelopment())

    //spa.UseReactDevelopmentServer(npmScript: "start");
    // run npm process with client app
    spa.UseVueCli(npmScript: "serve", port: 8080);
    // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead,
    // app should be already running before starting a .NET client:
    // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port
    );


I have also seen solutions where they have modified the Startup to use app.UseWebpackDevMiddleware directly and pointing at the cli-service/webpack.config.js



 app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions

HotModuleReplacement = true,
ConfigFile = Path.Combine(env.ContentRootPath, @"node_modules@vuecli-servicewebpack.config.js")
);


Both approaches here may work fine, but I question which one we should establish as a best approach. Inherently I feel it is probably best to stay with #1 as it most aligns with the vue cli documentation where using UseWebpackDevMiddleware may just add more confusion to the mix.







angularjs vue.js asp-net-core-spa-services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 17:22







David

















asked Nov 12 '18 at 17:15









DavidDavid

1,51043261




1,51043261












  • I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

    – Ryan E.
    Nov 12 '18 at 18:04











  • As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

    – Ryan E.
    Nov 12 '18 at 18:10






  • 1





    Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

    – David
    Nov 12 '18 at 18:27

















  • I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

    – Ryan E.
    Nov 12 '18 at 18:04











  • As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

    – Ryan E.
    Nov 12 '18 at 18:10






  • 1





    Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

    – David
    Nov 12 '18 at 18:27
















I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

– Ryan E.
Nov 12 '18 at 18:04





I worked for a company that went through a similar transition. First I'll just say good luck. It's tough. I would say your hunch is correct. #1 of jumping full into SPA is probably the way to go. Mixing the two is difficult since they are fundamentally different (routing handled client side vs server side). Although should be possible with some hacks, I know we had an AngularJS app with some Razor pages.

– Ryan E.
Nov 12 '18 at 18:04













As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

– Ryan E.
Nov 12 '18 at 18:10





As for "we are going with vue as we feel it is the easiest jump considering our current knockout based framework". I'm biased because I worked with AngularJS for 3 years and Angular 2+ for a year now, and so far everything I have seen from Vue is not impressive. The Angular team learned many lessons since they started and they have really delivered an excellent framework with Angular 2+. I would be hesitant to base a production application on such a new framework.

– Ryan E.
Nov 12 '18 at 18:10




1




1





Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

– David
Nov 12 '18 at 18:27





Thank you for this feedback. I am trying to avoid framework vs framework post here..and much more of what is wise in terms of how much can I integrate existing mvc application with modern js frameworks. Webpack versions, asp.net core versions, different frameworks all make this more difficult to find good approaches/with current technologies..i.e. webpackdevmiddleware works with webpack < version 4 etc.

– David
Nov 12 '18 at 18:27












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267042%2fasp-net-core-integration-with-modern-web-frameworks%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267042%2fasp-net-core-integration-with-modern-web-frameworks%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ