Dojo Widget Lifecycle

Dojo ToolkitWidgets are the basis on which a vast majority of the Dojo Toolkit is based on. If you’re not familiar with Dojo, I would suggest just checking it out then coming back to this post. It’s probably overkill in what it provides for most web apps, but if you’re looking for all-in-one solution, Dojo brings quite a bit to the table.

As I’ve mentioned before, I’ve done a good amount of work with the ESRI JavaScript API to create maps in the browser. They’ve built the API on top of Dojo so knowing how to create and manage custom widgets was key.

I wanted to make this post as a starting point going forward since I want to share some widgets I’ve written and worked with. Continue reading

Top Reads January 2015

Now that we are into the New Year, I’m starting back up my ‘Top Reads’ posts. I’m going to continue with giving some context on the things I share rather than just providing a link. Let me know which method you would prefer.

Here are the top reads of articles, libraries, and websites that I found cool or useful for the past month. Enjoy! Continue reading

Crash Course in the Node Debugger

Stop using  console.log in your Node.js code!

If you’re like me, you did JavaScript development in context of the browser before moving over to the server. Using the  console object for debugging is perfectly acceptable. What most new Node developers not realize, is that Node comes with its own debugger that is extremely helpful but not that straightforward to use.

What I hope to do is to give a crash course in using the debugger that will make using the debugger easier and enable you to stop having to use log statements everywhere. Continue reading

Beginner Node.js – Part 4: Architecture Tips

We’ve reached the second half of this beginner Node.js series. YayHopefully at this point, you’re becoming more comfortable with Node, NPM, and pulling in packages. This post starts to get into the meat and potatoes of writing apps using nothing but JavaScript. I’m not going to tell you how you should write apps, but give you some tips and common troubles of architecting an app.

I want to start discussing creating a project and some tips on architecture to make development easier and headaches to a minimum. As I mentioned in the previous post,  npm init is what starts a  package.json for you. That’s the backbone of your project in the sense. It manages dependencies, any extra development dependencies, and metadata about your project that could be used by various other services. Continue reading

Retain Console History using Angular’s $log

I’ve started wrap up on a substantial, Angular project that is now being used in production by customers. Overall, the app is working beautifully and errors are limited. I am recording errors to a server side database and I’ve noticed there’s been ‘digest already in progress‘ errors on one of the views. Although I’ve taken steps to try and get around those issues, I haven’t been able to pinpoint how the user is causing those errors.

I began trying to devise a way to track a user as they interact with the application, then use this information to help debug the errors. After poking around the internet, I wanted to use Angular’s  $log (docs) module to not only write messages to the console, but retain those messages. Then, write them to the server when an error occurs. I figured out that this behavior can be easily added without having to touch the window’s  console object by decorating the  $log module. Continue reading