Skip to content

refactor(object-spread): use spread instead of assign#194

Merged
johnnyreilly merged 2 commits intoTypeStrong:masterfrom
liangchunn:refactor/object-spread
Dec 24, 2018
Merged

refactor(object-spread): use spread instead of assign#194
johnnyreilly merged 2 commits intoTypeStrong:masterfrom
liangchunn:refactor/object-spread

Conversation

@liangchunn
Copy link
Copy Markdown
Contributor

Just following up from #166 and #169:

Since we've already dropped support for Node 6 in #166, object spread properties can now be safely used. (As briefly discussed here)

In .eslintrc.json, "experimentalObjectRestSpread": true and "ecmaVersion": 6 should be kept, since Node 8 supports 99% of ES2015 features, and object-spread is just a ES2018 feature, but is fully supported in Node 8 and above. (Also mentioned in #169, here)


Note: This PR does not introduce any functionality changes

@johnnyreilly
Copy link
Copy Markdown
Member

Nice - either way; we transpile typescript down to es2015 so the object-spread can happily be used since (I believe) it gets transpiled into Object.assign anyway. But yeah - completely happy with these changes. Do you want update the version number in package.json / add an entry to CHANGELOG.md and I'll merge this. This can go out as alpha.1 I guess.

@liangchunn
Copy link
Copy Markdown
Contributor Author

we transpile typescript down to es2015 so the object-spread can happily be used since (I believe) it gets transpiled into Object.assign anyway.

Yep! This only impacts test files, and just making them look nicer. Either way we could push this as alpha, or not at all. (Up to you, I don't really mind 😄)

@johnnyreilly johnnyreilly merged commit 51981e7 into TypeStrong:master Dec 24, 2018
@johnnyreilly
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants