Posts tagged "React"

Devoxx 2017

Last updated

Almost two months ago I visited Devoxx 2017. It’s about time to write some notes on the stuff I learnt there!

Event Storming & DDD workshop

The week started off with a full afternoon workshop led by Stijn Vanpoucke. The workshop consisted of small pieces of theory, alternated with exercises using post-it’s and markers.

A few of the theoretic pieces:

  • An event is something that has happened in the past. It is usually phrased in past tense. It should be understandable for business users.
  • A command is an user-initiated action. It explains the origin and sometimes the reason for the action.
  • An entity is an individual thing. It has a unique identity. Often, entities are mutable.
  • A value object is an non-unique value. It is often immutable. Its equality is based on it’s attributes. It should be able to validate itself. They can be combined.
  • An aggregate is a combination of entities and value objects. They are structured in a hierarchy. Its root is always an entity. Aggregates contain business rules. Note that a bigger aggregate is not always better! To circumvent this, aggregates can use soft links based on the unique identity of other entities.
  • The bounded context describes the context from which you look at it. Take a pen as example; what a pen is depends on the context from which you look at it. To stress the fact that it has boundaries, it is called a bounded context. Bounded contexts support the idea of having “one team, one (business) language”. The bigger the bounded context is, the bigger the language, whether artificial or natural. Finally, multiple domains can have different words for the same concept. A sales department might speak of products while inventory management might name the same concept article.

Kotlin for Java programmers

This year had a lot of talks about Kotlin scheduled. To visit them all would take too much time, so I decided to follow just one by Venkat Subramaniam. I figured it would give me about the same amount of content…

Read more... →

No bind or arrow functions in in JSX Props - Why? How?

Last updated

Recently, I found myself running tslint on a small React application written in TypeScript. The combination itself is worth writing another blog post about, but today we’re covering just one of the rules that tslint has; in fact, it is defined in the “tslint-react” rule set. It is also included in the eslint-plugin-react, because it is not related to TypeScript per se.

What’s it about?

In its ES6 version, the rule says: “No .bind() or Arrow Functions in JSX Props (react/jsx-no-bind).” The TypeScript version has two rules, one is called “jsx-no-bind” and the other one “jsx-no-lambda”; their intent is the same as the ES6 one. When you first notice the rule, you might wonder “why is that an issue?”. If you call bind(), or if you define an arrow function, this will create a brand new function every time you run that code. When you’re using that inside a render() method or a so-called stateless functional component, it will create a new function every time you render that component. That violates the one strict rule from React that says

Read more... →