26. September 2015

Jets.js and repl'em

Jets.js (GitHub: NeXTs/Jets.js, License: MIT, npm: jets, bower: jets)

Jets.js is a search engine which utilizes CSS to present the results. The main idea is not to affect attributes of each tag in the list while filtering. Instead apply dynamic CSS rule in only <style> tag and browser will decide which item of list to show or hide. Since it’s just CSS - Jets.js may be applied to any tag, whether it’s a table or UL, OL, DIV…

On the developers page there is a speed test.

Because I was so amazed by how easy it was to setup I started a small codepen and had some fun with it.

repl’em

repl’em (GitHub: raine/replem, License: Unknown, npm: replem)

If you are a developer like me you shall recognize the pain of trying a lot of different modules to find which one suits your task. repl’em let’s you run a list of modules that use specify in a repl context.

It also supports custom repl’s such as coffee-script. To use these you must give them as an argument.

$ npm install --prefix ~/.replem coffee-script
$ replem --repl coffee-script/repl lodash

You can also get all module properties in the direct context. You do this by providing each module with a bang (!) argument.

$ replem ramda!
Installed into REPL context:
 - ramda@0.17.1 as ramda
> reduce === ramda.reduce
true

This tool will certainly make it easier to try out new modules for providing you with new posts everyday.

25. September 2015

Plop and Selectize

Plop (GitHub: amwmedia/plop, License: MIT, npm: plop)

Plop is a command line tool that helps you introduce uniformity to your team by generating new modules, files or even documentation pages. The problem it tries to solve is one that we all must have. You have a project which is nicely structured. Lets say this is our pages folder;

|-- Pages
    |-- HomePage
        |-- HomePage.jsx
        |-- config.json
        |-- styles.css

What we need to do is add a new page. Normally we would do is copy the HomePage folder and walk through the files and what is needed. This will cost you some time and slow you down.

Plop to the rescue

By defining how modules, pages or components should look before hand you could write a template for it. By using handlebars it lets you set the values you would normally change by hand.

Here is an example template file

class {{ properCase name }} extends React.Component {
  render(){
    return <div className='{{ name }}'>Newly generated Component {{ name }}</div>
  }
}

To fill up this template I will need a plopfile which would look like this

module.exports = function (plop) {
    plop.setGenerator('component', {
        description: 'Generate a React Component',
        prompts: [{
            type: 'input',
            name: 'name',
            message: 'What should it be called?',
            validate: function (value) {
                if ((/.+/).test(value)) { return true; }
                return 'name is required';
            }
        }],
        actions: [{
            type: 'add',
            path: 'src/Components/{{properCase name}}.jsx',
            templateFile: 'component.txt'
        }]
    });
}

Now you could call plop to select it from a list of generators or plop <generator> to call it directly.

What I love about this tool is the size of it. In contrast with Yeoman which is great for initialization of a codebase but after that you are still copying files, Plop is designed to work in throughout the life entire cycle of a project.

React Selectize

React Selectize (GitHub: furqanZafar/react-selectize, License: Apache 2.0, npm: react-selectize)

React Selectize is a stateless Select component for ReactJS, which provides a platform for a more developer friendly SimpleSelect & MultiSelect component.

Getting it to work was surprisingly simple. Here is my example

import React from 'react';
import ReactSelectize from 'react-selectize'
const SimpleSelect = React.createFactory(ReactSelectize.SimpleSelect);
const MultiSelect = React.createFactory(ReactSelectize.MultiSelect);

<SimpleSelect
    placeholder = "Select a food"
    onValueChange = {(value, callback) => {
        alert(value);
        callback();
    }}
    >
    <option value = "pizza">pizza</option>
    <option value = "kebab">kebab</option>
    <option value = "donut">donut</option>
</SimpleSelect>

<MultiSelect
    placeholder = "Select foods"
    options = ["pizza", "kebab", "donut"].map(function(food){
        return {label: food, value: food};
    });
    onValuesChange = {function(values, callback){
        alert(values);
        callback();
    }}
/>

What I love about this component is the ease of the setup and the flexibility and compactness of the API.

24. September 2015

The start of something new.

Since this is the first “blog post” I have ever written it will be a bit rough. In it, I will be explaining the reason I started this blog and the goal of it.

Who am I?

My name is Ramon Gebben. I’m 24 years young and I work as a front-end developer for a Dutch digital media company called TouchTribe. On a regular work day my work involves writing a lot of Javascript for web, server and hybrid applications.

DailyJS part two

After being a loyal subscriber to DailyJS for a long time, I was very disappointed to hear that Alex Young stopped with DailyJS. I started noticing an absence of a similar platform. As a front-end developer DailyJS helped me to keep up with updates from the community, such as new version from node/io.js, and to get informed about new libraries, frameworks and reviews of new build tools.

Sure, we all look at Hackers News, EchoJS et cetera, but the nice part of DailyJS was that it was filtered and tested. Most libraries look very cool at first sight, but when you try to test them agains “real world” problems, they fail. I want to be is the new filter. I spend a large part of my days searching for new libraries and frameworks, because it is wonderful what everybody is doing and everyday the bar is set a little higher. Normally I share the things I notice and experienced with the team I work with. Since this is very well received I thought why not take it further and give this a shot.

Daily updates

The goal of this page is giving other developers, that enjoy working with Javascript as much as I do, a daily updates about new libraries, frameworks et cetera. I will test each library that I mention and tell you about my experience. I will also try to filter out some of the “gotcha’s” to make your life easier.

I will try my best to post at least two libraries a day with a small summery of what it does and what it does great.

In the future I also would like see posts from developers whom in my opinion exceed in the field to give an expertise view on area and subjects that might be unclear to you and me.

Contribute

If you have an awesome library or you’re working on something, please let me know. In this message, enclose a Github link and maybe your motivation to start building your project.

Because I’m not an experienced writer I welcome all feedback on my writing style, word choice et cetera. Tweet to @DailyJavascript