AspNetCoreClientLibManagement icon indicating copy to clipboard operation
AspNetCoreClientLibManagement copied to clipboard

Some thoughts...

Open Zettersten opened this issue 2 years ago • 0 comments

Overly generalized opinions incoming...

There are two main categories of .NET web-based client-side developers:

Static Reference Developers:

  • These developers typically reference resources either from a Content Delivery Network (CDN) such as jsDelivr, or from a path in the wwwroot directory.
  • Some developers may also use NPM or LibMan with a build process to publish resources to the wwwroot directory.

Dynamic NPM + Build Developers:

  • These developers install node packages and use a builder such as Rollup or Webpack.
  • They may also use language supersets such as SASS and TypeScript.

Pros of the Static Reference Developers:

  • Easy to implement and follows conventional practice.

Cons of the Static Reference Developers:

  • They must bake-in a bundling and minification process.
  • No tree-shaking is available, which means every package comes with additional unnecessary resources.
  • Direct reference to modern projects and packages that use ES6 (module syntax) is not supported.

Pros of the Dynamic NPM + Build Developers:

  • Bundling and minification is handled by the builders (Webpack or Rollup).
  • Tree-shaking is available, which ensures only required resources are produced.
  • The package.json file is the single source of truth, making it easy to manage versions.
  • Outputs are specified in language targets (BabelJS, etc.).

Cons of the Dynamic NPM + Build Developers:

  • Setup can be complex and require additional configurations for watch, builds, etc.
  • Builders like Webpack come with their own development server and hot-reload feature that may conflict with Visual Studio.

Zettersten avatar Feb 01 '23 20:02 Zettersten