Selecting the right software tools, languages, and frameworks is crucial for any software development project, especially when you are on a tight budget. In this blog post, we’ll look into JavaScript specifically, which will be required to some degree with any website project. We’ll explore when to choose between vanilla JavaScript, using Custom Web Elements, and JavaScript frameworks for web development.
Vanilla JavaScript refers to plain JavaScript without the use of any libraries or frameworks. At the time of writing, there is even a joke website for it here. Using Vanilla JavaScript is a great choice for/when:
The last few projects I have worked on personally at BizStream have had more focus on back-end functionality, which we have built as a team with C#. Also, there has not been much complexity needed on the front-end, so we decided to forego a JavaScript framework and improve our vanilla chops instead. For these simpler sites, it has been a good decision.
Custom Web Elements (also known as Web Components) are a part of modern web development that allows you to create your own reusable HTML elements with encapsulated functionality and styling. They are an excellent choice when:
I am a big fan of Custom Elements. One of their greatest features is that they can be used in all evergreen browsers, and you can use vanilla JavaScript to build them. In the same projects I mentioned above, there were cases where vanilla JavaScript was more cumbersome and complex to write. In these cases, we wrote Custom Web Elements with vanilla JavaScript to help us write simpler and more maintainable code. These complex cases included features like Paging for search results, custom tab controls, and carousels.
Recently, the term “HTML Web Components” has been changing to refer to Custom Elements without utilizing the Shadow DOM. This is the way we have been using them at BizStream. This method also works extremely well when implementing custom Kentico Sections and Widgets that require JavaScript to function. There is a great article with other references about this emerging trend here.
JavaScript frameworks provide pre-built structures and libraries to simplify web development. They shine in the following situations:
There have been several projects here at BizStream where we have chosen to use a JavaScript framework. All of these cases involved highly complex interactions, usually spanning across multiple pages containing complex state management.
One more thing to mention are Meta-frameworks like Next.js, Gatsby.js, SvelteKit, and Nuxt.js. They provide an additional layer of abstraction and simplification in web development. These frameworks offer the following benefits:
Meta-frameworks can be a great choice when working with Kontent.ai or any headless CMS since they are not tied to a specific programming language or website architecture. So far at BizStream, we have used Kontent.ai with Gatsby.js and, more recently, Next.js.
There are other things to consider when choosing how to implement the front-end architecture of a website. If the site is eventually going to be maintained by the client, their environment has a heavy reliance on Microsoft IIS, and they mostly have C# developers, then building the site with ASP.NET should be considered before writing the site entirely in one of the meta-frameworks mentioned above. But, if they know JavaScript and/or Node development well, then writing with mostly JavaScript is probably the best.
Another thing to think about is the project budget and the learning curve of using a larger framework or meta-framework. If no one has experience with Next.js and the budget is tight, it might pose too high of a risk to implement the site with it. On the other hand, if the budget allows the investment, frameworks, and meta-frameworks can be a joy to learn and work in.
At the end of the day, choosing the right software tools, languages, and approaches depends on the specific requirements of your web development project. JavaScript offers a wide range of possibilities, from simple, lightweight solutions with vanilla JavaScript and Web Components to complex, feature-rich applications with the help of JavaScript frameworks and meta-frameworks. You might not always want to reach for a framework or meta-framework when starting a new project, but they should not be disregarded either. To make the best decision, really learn what the options are, carefully consider the project’s scale, complexity, and goals, and choose the approach that aligns with the development needs.
We love to make cool things with cool people. Have a project you’d like to collaborate on? Let’s chat!
Stay up to date on what BizStream is doing and keep in the loop on the latest in marketing & technology.