Tech Blog Menu

Tech Blog

How to prevent frequent JavaScript mistakes

Written By
Lucien Bénié

When writing JavaScript, I spend a lot of time fixing simple mistakes. Unlike compiled languages you are more likely to make mistakes. It is easy for syntax errors to sneak into your code without realizing it until you actually try and run your code.

How many times have I got an undefined variable because I refactored some code and forgot to rename that variable.

Even though it has been more than 5 years since I wrote my first Hello World. The feeling remains the same – Why did I make this mistake again ?

Read more...

Adding support for 'require' in Nashorn

Written By
Martin Laporte

Some parts of Coveo’s query pipeline are extensible using JavaScript. We initially used DynJS, but since it’s now unmaintained, we had to switch to a new JS engine, namely Nashorn that comes out-of-the-box starting with Java 8. Nashorn works pretty well, but it’s missing built-in support for the require function that is used with CommonJS modules.

Read more...

Isomorphic TypeScript, fetch, promises, ava and coverage

Written By
Pierre-Alexandre

Writing an API client in JavaScript is a lot of work, you have to write one for Node.js and one for the browser. I found out a way to have both on the same codebase with the same API, all that with only changes to the build scripts. It’s called isomorphic code, and doing it with modern TypeScript isn’t easy, but it’s achievable.

Read more...

Indexing Only Relevant Parts of Sitecore Rendered Content

Written By
Jean-François L'Heureux

For website search, relevancy of the search results should be a priority. When indexing a Sitecore item with Coveo for Sitecore, you want as much information as possible to be indexed. That’s why you probably use the HtmlContentInBodyWithRequestsProcessor to index the Sitecore rendered HTML of the item. However, you don’t want to index global sections of the HTML like the header, footer, navigation, ads and sidebars.

A few solutions were available to do so. This post details a simple solution that involves only a Sitecore processor and minor edits to layouts, sublayouts or views.

Read more...

Microservices and exception handling in Java with Feign and reflection

Written By
Jacques-Etienne Beaudet

Update 2016/12/10: It’s now on Maven central! I’ve added some precisions below but I have left the post mostly intact for historical purposes.

Update 2016/07/08: The project is now available on GitHub! I plan on making it more generic before publishing it to Maven, I’ll update this post soon with the new details.

Exception handling across microservices can be tedious, let’s see how the Java reflection API can help us ease the pain!

Read more...

Typescript Dependency Injection and Decorators

Written By
Germain Bergeron

In July 2015, Microsoft announced the release of Typescript 1.5, introducing decorators, based on the ES7 decorator proposal. I had to test it!

Read more...

Template-ish method pattern using java 8

Written By
Jonathan Rochette

In the Usage Analytics service, there is a layer that validates if a user is allowed to perform the requested action. This should not be a surprise for anybody as all applications have some kind of security or permission check somewhere. Since the UA service is built in a layer architecture, that’s the job of the permission layer. The code is pretty boilerplate and very similar for all the different calls. It follows this logic :

  • Extract user identity and account from token
  • Check if the user has the required permissions
    • If he does, call the service layer
    • If he doesn’t, throw an exception

Read more...

Blitz - The story behind this year’s challenge

Written By
William Fortin, Guillaume Simard

This year was the sixth edition of Coveo Blitz, our classic programming contest for students. The original purpose of the event is to find great, passionate developers and show them how fun, passionate, and driven our team is. We had the idea to step out of our comfort zone this year and focus on what we’ve learned in the last editions.

Read more...

Opening a Sitecore Dialog from a Bookmarklet

Written By
Jean-François L'Heureux

When developing dialogs, wizards and applications in Sitecore, a developer would have to open them many times per day. When the action to open them requires more than one click, a lot of time will be lost.

Wouldn’t it be nice if one could open a dialog from the browser console command line or a bookmark?

Read more...

Using React JSX with TypeScript

Written By
William Fortin

In the last months, we experienced with React and we enjoyed it a lot. As you may know, all Coveo’s web applications are built using TypeScript, so with the release of TypeScript 1.6 announcing support for React JSX syntax, we were stoked!

Read more...

< Older Newer >