buble merge requestshttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests2017-09-23T20:21:25Zhttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/122Allow value-less dash-cased props2017-09-23T20:21:25Zusername-removed-95990Allow value-less dash-cased propsCurrently you can't pass down dash-cased properties without a value.
See error case [here in REPL](https://buble.surge.sh/#%3Cdiv%20data-foo%20%2F%3E).
```js
// current
{ 'data-foo' }
// w/ update
{ 'data-foo': true }
```
## Changes...Currently you can't pass down dash-cased properties without a value.
See error case [here in REPL](https://buble.surge.sh/#%3Cdiv%20data-foo%20%2F%3E).
```js
// current
{ 'data-foo' }
// w/ update
{ 'data-foo': true }
```
## Changes
- Add `true` to output if contains dashed and non-value
- Refactor if/else into named functions
- data-attribute -> any dash-cased prop
- Add testhttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/121Make class accessors (static or not) configurable, per spec.2017-09-23T20:36:42Zusername-removed-281802Make class accessors (static or not) configurable, per spec.This fixes #210.
But the tests don't pass because of some problem with a dependency not exporting a symbol, and I am also not able to run it to test it myself because the dependency problem.
@Rich-Harris It'd be great if you could ...This fixes #210.
But the tests don't pass because of some problem with a dependency not exporting a symbol, and I am also not able to run it to test it myself because the dependency problem.
@Rich-Harris It'd be great if you could take a look. Not sure what to do about the dependency issue.
Thanks!
- Joehttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/120IMPORTANT fix: `build:browser` fails because of regression in `vlq@0.2.2`2017-09-23T20:23:01Zusername-removed-1297041IMPORTANT fix: `build:browser` fails because of regression in `vlq@0.2.2`There may exist a more elegant fix for this issue, through fixing some of the upstream dependencies, etc. but this fixes the immediate issue locally.
@Rich-Harris will need to untangle the web of upstream modules exposing and loading ...There may exist a more elegant fix for this issue, through fixing some of the upstream dependencies, etc. but this fixes the immediate issue locally.
@Rich-Harris will need to untangle the web of upstream modules exposing and loading varying versions of `pkg.main`, `pkg.module`, `pkg.jsnext`, etc.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/119Support for JSX pragma comment syntax2017-09-23T20:35:55Zusername-removed-1297041Support for JSX pragma comment syntaxFixes #195Fixes #195https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/118Pawn shop2017-07-28T01:46:47Zusername-removed-1120584Pawn shopI'm Rick Harrison, and this is my pawn shop. I work here with my old man and my son, Big Hoss. Everything in here has a story and a price. One thing I've learned after 21 years - you never know what is gonna come through that door.I'm Rick Harrison, and this is my pawn shop. I work here with my old man and my son, Big Hoss. Everything in here has a story and a price. One thing I've learned after 21 years - you never know what is gonna come through that door.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/117handle JSX with no space between attributes2017-09-23T20:41:32Zusername-removed-568470handle JSX with no space between attributesFixes #178Fixes #178https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/116Use Array.prototype.slice to process rest parameters2017-01-06T01:56:49Zusername-removed-928363Use Array.prototype.slice to process rest parametersThis is slightly less code, and seems to be the more commonly suggested technique. This is all ES3 stuff, so there shouldn't be any compatibility issue.This is slightly less code, and seems to be the more commonly suggested technique. This is all ES3 stuff, so there shouldn't be any compatibility issue.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/115path module at node v7 required path arguments to be strings2017-09-23T20:23:55Zusername-removed-907190path module at node v7 required path arguments to be stringshttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/114fix tests for complex destructuring defaults2016-12-19T21:20:38Zusername-removed-568470fix tests for complex destructuring defaultsNote: This is *not* a bug fix.
The *tests* are being altered to use the paren workaround for the known bug in complex destructuring defaults, which was the original intention in the commit 2208dbecdb459796b9a560463f37d2e247261a88.Note: This is *not* a bug fix.
The *tests* are being altered to use the paren workaround for the known bug in complex destructuring defaults, which was the original intention in the commit 2208dbecdb459796b9a560463f37d2e247261a88.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/113Honor named-function-expr in Object literals2016-12-16T09:57:35Zusername-removed-751768Honor named-function-expr in Object literalshttps://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/112simplify destructuring assignment statements2016-12-16T10:00:11Zusername-removed-568470simplify destructuring assignment statementsbuble@0.15.1 emits the following for destructuring assignment statements:
```
$ echo '[x]=[1,2];' | buble
var assign;
(assign = [1,2], x = assign[0], assign);
```
With this patch it will not emit the unnecessary trailing "`, assign...buble@0.15.1 emits the following for destructuring assignment statements:
```
$ echo '[x]=[1,2];' | buble
var assign;
(assign = [1,2], x = assign[0], assign);
```
With this patch it will not emit the unnecessary trailing "`, assign`":
```
$ echo '[x]=[1,2];' | bin/buble
var assign;
(assign = [1,2], x = assign[0]);
```
Note: this patch will not alter the behavior of destructuring assignment expressions:
```
$ echo 'console.log([x]=[1,2]);' | bin/buble
var assign;
console.log((assign = [1,2], x = assign[0], assign));
```
Notice the rvalue "`, assign`" is still emitted in this case.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/111fix Object.assign regression in JSXOpeningElement2016-12-14T17:29:03Zusername-removed-568470fix Object.assign regression in JSXOpeningElementFixes #163
Before fix:
```
$ echo '<MyThing two={"This Fails"} {...props}></MyThing>;' | bin/buble --objectAssign
React.createElement( MyThing, undefined({}, { two: "This Fails" }, props));
```
After fix:
```
$ echo '<MyThi...Fixes #163
Before fix:
```
$ echo '<MyThing two={"This Fails"} {...props}></MyThing>;' | bin/buble --objectAssign
React.createElement( MyThing, undefined({}, { two: "This Fails" }, props));
```
After fix:
```
$ echo '<MyThing two={"This no longer Fails"} {...props}></MyThing>;' | bin/buble --objectAssign
React.createElement( MyThing, Object.assign({}, { two: "This no longer Fails" }, props));
```https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/110Use namedFunctionExpressions for constructors2016-12-14T17:29:29Zusername-removed-751768Use namedFunctionExpressions for constructorsAlso adds tests.Also adds tests.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/109WIP: Support iterables in dangerous for-of loops2017-05-23T05:12:35Zusername-removed-634209WIP: Support iterables in dangerous for-of loopsRight now for-of loops are translated directly into typical for loops over the input's length. That's "dangerous" because it doesn't follow the spec, but works for Arrays.
This proposes adding (partial, dangerous) support for iterable...Right now for-of loops are translated directly into typical for loops over the input's length. That's "dangerous" because it doesn't follow the spec, but works for Arrays.
This proposes adding (partial, dangerous) support for iterables to for-of loops without altering the existing fast path dangerous-for-of behavior for Arrays and other looped content which has a `length` property.
This is still a "dangerous" transform!
- It still uses length when available instead of iterators
- If an environment does not define Symbol (native or polyfill), it falls back to length
- If a break or throw occurs in a loop over an iterator, the iterator is not properly "closed", which can impact code that uses `finally {}` blocks in generators.
In order to do this, for-of loops are translated into a slightly longer form.
For example, given the input:
```js
for ( let member of array ) {
doSomething( member );
}
```
The new transform will produce:
```js
for ( var list = array, iter = list.length === void 0 && typeof Symbol === 'function' && list[Symbol.iterator], i = iter ? iter.call(list) : -1; iter ? !(iter = i.next()).done : ++i < list.length; ) {
var member = iter ? iter.value : list[i];
doSomething( member );
}
```
Here's the same output with annotated expressions:
```js
// Same for loop structure is kept
for (
// Evaluate for-of's RHS (same as before)
var list = array,
// If the list does not have a length (preserve "dangerous" Array behavior)
iter = list.length === void 0 &&
// And this environment understands Symbol
typeof Symbol === 'function' &&
// Then get the list's defined iterator
// Will be undefined if Symbol.iterator is undefined
// Will be undefined if list does not define an iterator
// Will throw if list is null/undefined (spec compliant)
list[Symbol.iterator],
// If an iterator function was found
i = iter
// Then produce an iterator
? iter.call(list)
// Otherwise init an index integer
: -1
; // End init, begin test
// If an iterator is in use
iter
// Get the next iterator-result, returning true if it is not done
? !(iter = i.next()).done
// Otherwise, increment the index and return true if it's less than the list length
: ++i < list.length
; // End test, no update
) {
// If an iterator is in use
var member = iter
// Get the current value
? iter.value
// Otherwise, get the index from the list
: list[i];
doSomething( member );
}
```https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/108fix corruption of whitespace in string literals in class methods2016-12-13T15:49:09Zusername-removed-568470fix corruption of whitespace in string literals in class methodsFixes #159Fixes #159https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/107fix annotated errors for stdin input2016-12-13T15:12:48Zusername-removed-568470fix annotated errors for stdin inputFixes #155Fixes #155https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/106Safari/WebKit bug workaround: rename parameter if matches method name2016-12-13T15:19:53Zusername-removed-568470Safari/WebKit bug workaround: rename parameter if matches method nameFixes #154 as well as:
* Renames parameters matching names of standalone FunctionExpressions.
* Fixes unnecessary renaming of parameters of transpiled class methods.Fixes #154 as well as:
* Renames parameters matching names of standalone FunctionExpressions.
* Fixes unnecessary renaming of parameters of transpiled class methods.https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/105use local ./register.js for mocha tests rather than node_modules/buble/regist...2016-12-13T15:23:23Zusername-removed-568470use local ./register.js for mocha tests rather than node_modules/buble/register.jsFixes #153 Fixes #153 https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/104add buble version and options to register.js cache hash2016-12-14T19:23:20Zusername-removed-568470add buble version and options to register.js cache hashFixes #152Fixes #152https://staging.gitlab.com/Rich-Harris/buble/-/merge_requests/103Register options2016-12-13T16:57:42Zusername-removed-861968Register optionsSplit as a separate merge request from !102.
I needed a way to be able to pass `--no modules` when using the register script as a mocha compiler (https://github.com/rollup/rollup/issues/657#issuecomment-220786674).
The two environmen...Split as a separate merge request from !102.
I needed a way to be able to pass `--no modules` when using the register script as a mocha compiler (https://github.com/rollup/rollup/issues/657#issuecomment-220786674).
The two environment variables (`BUBLE_OPTION_YES` and `BUBLE_OPTION_NO`) are the equivalents of the `--no` and `--yes` command line switches.