stampit API
  • Introduction
  • Essentials
    • What is a Stamp
    • Installation
    • Specification
      • Merging algorithm
      • Object creation internals
    • FAQ
  • API
    • Quick start
    • Basics
    • Methods
    • Properties
    • Deep properties
    • Initializers
    • Static properties
    • Static deep properties
    • Configuration
    • Deep configuration
    • Composers
    • Property descriptors
    • Static property descriptors
    • Name
  • Ecosystem
    • Ecosystem Overview
    • @stamp/collision
    • @stamp/required
    • @stamp/privatize
    • @stamp/named (DEPRECATED)
    • @stamp/instanceof
Powered by GitBook
On this page
  • Q: What if composed stamps have same named property/method/etc?
  • Q: But what if there are names conflicts during stamp composition?
  • Q: Why stampit is ES5? Should it be ES6 or later?
  1. Essentials

FAQ

PreviousObject creation internalsNextQuick start

Last updated 5 years ago

Q: What if composed stamps have same named property/method/etc?

The last composed property/method/etc wins. In other words, you can overwrite everything when composing stamps.

Q: But what if there are names conflicts during stamp composition?

In our practice the names never collide. Because stamps tend to stay very small thanks to its absolute freedom.

But if you still need to avoid name collision or protect a method from overwriting then use utility stamp.

Q: Why stampit is ES5? Should it be ES6 or later?

  • The main advantage of ES6 is the syntax which enables easy . But:

    • There is nothing to treeshake in stampit or @stamp/it.

    • stampit is already 1.5KB gzipped.

  • Maintaining ES6->ES5 is quite hard in such a specific project.

  • Most projects still transpile from ESNext to ES5.

We will rethink this policy as soon as there is a need which cannot be solved with ES5.

@stamp/collision
import/export
treeshaking