Param.macro Versions Save

Partial application syntax and lambda parameters for JavaScript, inspired by Scala's `_` & Kotlin's `it`

v3.2.1

4 years ago
BUG FIXES
  • handle assignment expressions properly below top level (#21) (7bf4645), closes #20

v3.2.0

5 years ago
FEATURES
  • improve error messages with code frames (2d8bf53)
BUG FIXES
  • it should not wrap regular template literals (33a0a9e)

v3.1.0

5 years ago
FEATURES
  • support assignment expressions similarly to declarations (41a8159)
BUG FIXES
  • pipeline: placeholders consider pipeline a tail path when on LHS (af1934d)
PERFORMANCE
  • use a set instead of an array (da59106)

v3.0.0

5 years ago

This release improves the expected results of the macro. There is a breaking change but if you weren't using it within tagged template expressions, you're probably in the clear!

BREAKING CHANGES
  • The output has changed when placeholders are used within tagged template expressions. foo`${it}` will now replace the it in place rather than wrap the entire tagged template expression.
FEATURES
  • it: stop traversal at template expressions (9d69f9f), closes #12
BUG FIXES
  • pipeline: improve interop with pipe operator (8dc1895), closes #13

v2.1.0

5 years ago

And now for a totally backward compatible but no less ground-breaking release :tada:.

A third export is now available called lift that allows for more flexible placeholder usage, making it possible to define inline functions with more than one argument.

See the new section in the readme for more information.

PLAYGROUND

The online playground now supports shareable permalinks! The URL in your address bar is automatically updated as you type or when you use a code block from the readme — just copy it and share it to send examples like this one:

Example of the new lift modifier

FEATURES
  • add lift() modifier to support binary+ functions (f92542c)

v2.0.0

6 years ago
PLAYGROUND

The online playground received a pretty major upgrade:

  • contains all new features of param.macro
  • supports all current features of Babel (pipeline operator, optional catch binding, etc — see here for more)
  • it's now smaller & more efficient since minification's been restored
FEATURES
  • include tail paths, support spread, default params (8a47350)
BREAKING CHANGES

spread placeholders

Input:

import { _ } from 'param.macro'
const log = console.log(..._)

Output (before):

const log = (_arg) => {
  return console.log(..._arg);
};

Output (after):

const log = (..._arg) => {
  return console.log(..._arg);
};

tail paths

Input:

import { _ } from 'param.macro' 
const fn = String(_).toUpperCase() === 'HELLO'

Output (before):

const fn = (_arg => {
  return String(_arg)
}).toUpperCase() === 'HELLO'

Output (after):

const fn = _arg => {
  return String(_arg).toUpperCase() === 'HELLO'
}

v1.1.4

6 years ago
BUG FIXES
  • restore babel 6 compatibility (f0232f9)

v1.1.3

6 years ago
BUG FIXES
  • placeholders: improve argument hoist logic (dfffd97)

v1.1.2

6 years ago

Small patch to add the standalone plugin file to the npm package (it wasn't included in the published version previously).

BUG FIXES

v1.1.1

6 years ago

All changes are live in the online playground

BUG FIXES
  • placeholders: compile assigned expressions correctly (c2eb7e2)