yeojz / metalsmith-react-templates

A metalsmith plugin to render files using React / Preact / JSX based templates.
MIT License
92 stars 17 forks source link

Added isStatic option #9

Closed woodyrew closed 9 years ago

woodyrew commented 9 years ago

I've included nonStatic for backwards compatibility.

I've not bumped the version number, do you want me to do that?

The backward compatibility is a bit messy but:

var staticConst = (void 0 !== options.isStatic) ? options.isStatic : true;
  if (void 0 !== options.nonStatic) {
    staticConst = !options.nonStatic;
    console.warn('option: isStatic should be used instead of nonStatic.');
  }
  const isStatic = staticConst;

can be changed to:

const isStatic = (void 0 !== options.isStatic) ? options.isStatic : true;

when you don't want to support nonStatic any more.

yeojz commented 9 years ago

@woodyrew Thanks. Looks good.

It's alright.. I'm planning to do a double release. 1.1.0 with backwards compatibility and 2.0.0 removing the deprecation.