Step away from that Node.js

sara.el-saig

When you develop a full-stack web app, Node.js just seems like a fact of life. Inescapable, even if you use .NET for everything, and comes with its own whole infrastructure even though you just want to manage a few front-end libraries for your app. It doesn’t have to be like that.

Enter LibMan

Microsoft Library Manager lets you install and consume 3rd-party client-side libraries with ease. They aren’t kidding, it’s just a JSON file and an extra NuGet package import, and you get the desired files from jsDelivr or UNPKG at build time. You might recognize this is very similar to what our Lombiq Node.js Extensions offer, but there are some key differences:

  • It doesn’t expect node, npm or pnpm on your machine. The latter is especially a pain point because corepack, used to install PNPM, won’t be packaged with future versions of Node.js.

  • It only downloads the files you specify, which is usually just the contents of the dist directory in the package. No raw source or unnecessary dependencies that you won’t use anyway.

We’ve also introduced a handy source generator in Lombiq.HelpfulLibraries to help you keep the same package version numbers between LibMan and the Orchard Core resource manager.

Saying good-bye to Lombiq.NodeJs.Extensions

At this point we feel ready to deprecate Lombiq Node.js Extensions (NE for short). If your project depends on it, don’t worry. The current build will continue to work for a long time (at least until April 2028 when the LTS support of Node 24 ends), but we won’t maintain the project any more. But consider coming along with us, and see if this new approach works for you as well!

This library let us do a few specific things with Node.js, that were important back in the day but not so much any more:

  • Download front-end assets from NPM and copy into wwwroot: we have LibMan for that now.

  • Compile JavaScript into an older syntax: we stopped doing that a while back. With the end of Internet Explorer and the wide support of modern JS language features in other browsers this hasn’t been necessary in years. So NE was just copying the script files from Assets to wwwroot.

  • Compile Sass .scss files into CSS: while we remain fans of Sass, it’s an added layer of complexity that became less and less necessary as native CSS catches up. We took stock of how we use Sass in our projects this year and found that besides nesting (has been widely supported in CSS for almost 2 years now) we only really care about mixins. But even those can be worked around with utility classes if you have control over the HTML, so it wasn’t reason enough to keep sticking with Sass.

  • Linting JavaScript, Sass, and native CSS files: we have a replacement for that now, see below!

We have also deprecated Lombiq.VueJs (used for compiling Vue single-file components) and the Sass-using half of Lombiq.BaseTheme. The former has somewhat lost its relevance some time ago and we haven’t seen much use of it, while the latter has been superseded by our native CSS alternative: Lombiq.BaseTheme.Native.

It’s worth noting that NE relies on Lombiq.Npm.Targets under the hood, which we continue to support. If you only care about installing NPM packages and have some other Node.js dependency then feel free to continue using that one.

JavaScript and CSS Linting via GitHub Actions

We have added a new asset-lint workflow to our GitHub-Actions repository. Under the hood this still uses node and npm, but those are preinstalled on the GitHub runner images so there is not so much to worry about. Additionally, using them means you don’t have to wait for the .NET setup and build to get the linting results. Read about how to use the workflow in the documentation here.

If you want to lint on your local machine, that’s also a possibility. Then you need node and PowerShell (pwsh) installed. Scroll to the “How to Run Locally” section of the above linked documentation for instruction.

Conclusion

You scrolled to the end, didn’t you? ;) If not, thanks!

To sum it up, Lombiq.NodeJs.Extensions, Lombiq.VueJs and Lombiq.BaseTheme are now deprecated. They will continue to work for a long while, but don’t anticipate new versions. Instead, consider moving to Microsoft Library Manager for front-end library management, our asset-lint GitHub Actions workflow for JS and CSS code linting, and of course Lombiq.BaseTheme.Native for all your theme development needs. Check out our migration guide here.

Enjoy your builds now being a lot faster, and your development story being much simpler!