An Opinionated Approach to KnockoutJS Components

In the prior post, I mentioned my organization began to use KnockoutJS within an application we have developed for one of our clients. You can get a little more background on the project by reading my prior post.

When I first started creating components with KnockoutJS, there wasn’t any specific pattern established for handling state, properties, computed values, subscribed listeners, and event bindings. In hind-site, it began creating challenges when maintaining code as each developer had a different way to organize their code.

I took some time about 18 months ago and began to define a pattern that could be used when developing components and view models within the application. The hope was to improve the quality of the code produced and to help when maintaining the code in the future. Having unified patterns can help teams in several ways, from reviewing requirements to final code reviews. It can produce a common vocabulary and starting point for adding or updating the functionality of the application, and can help on-board new developers to the project.
Continue reading “An Opinionated Approach to KnockoutJS Components”

RequireJS to WebPack

There are several articles on the web that discuss converting a site developed using RequireJS to WebPack. However, in several of these articles, there are assumptions in place that didn’t fit my scenario and had no instructions on how to handle a few of the modules in use within a project that my company needed to convert. These articles were a great place to start, but then found myself really getting to see some of the power available to you when using WebPack with an ASP.Net 4.6.2 MVC application that utilizes ASP.Net core 2.2 as well.

Continue reading “RequireJS to WebPack”

JSRender, SPServices and User Profiles

In a recent project I needed a way to quickly grab user profile information and include it in the context of a custom application for SharePoint. I decided that I wanted to make use of templating to render the HTML for the user profile, so this lead me to look up the various jQuery templating plug-ins. I was a bit disappointed to see that the Microsoft stubs have been abandoned as a lot of my initial searches returned examples using this plug-in.

However, I discovered a new templating engine that seems to be showing a lot of promise called JSRender. This provided some very simple semantics to create a reusable template. When coupled with SPServices and a little bit of creative code parsing, you can quickly declare reusable templates for client side scripts in SharePoint.
Continue reading “JSRender, SPServices and User Profiles”

Using the SharePoint 2010 Client Object Model to return user information

In a recent project, I needed a way to quickly get some additional details about a user from the user information list. The project is making use of search and in the core results the only item being returned is the display name of the author. Since I needed to get some more details on the user, I needed a quick way to lookup the user by display name from the user information list.

Continue reading “Using the SharePoint 2010 Client Object Model to return user information”

jQuery Mobile and SharePoint

As an experiment, I decided to explore the use of jQuery mobile with SharePoint. My goal is to simply expose company news for as many mobile devices as possible in a single location. Like many organizations, our consulting firm delivers news internally via our intranet portal (based on SharePoint) and through public press releases available for anyone in the world.

Continue reading “jQuery Mobile and SharePoint”