Skip to content

Build artifacts for npm with Babel #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shockey
Copy link

@shockey shockey commented May 8, 2018

Addresses (possibly fixes) #4.

This PR adds Babel as a devDependency, using it to build a JavaScript artifact for release that is compatible down to Node.js 4 and IE11 (not quite ES5, but this should be enough compatibility for almost anyone).

Here's what the output looks like, vs the original source: https://www.diffchecker.com/DBqpq8i4

@saikojosh
Copy link
Owner

Hey @shockey, I can't merge this in because all users shouldn't be forced to take a performance hit to support the lowest common denominator. If you can modify it so someone can import/require a transpiled ES5 version separately, then I'll merge. e.g. var es5 = require("object-assign-deep/es5"); or import { es5 as objectAssignDeep } from "object-assign-deep";.

@brandonrobertz
Copy link

Note that this fix wouldn't only be for Node v4. Having this issue on the frontend for Node v8 build. This would fix minification errors across many frontend builds.

@shockey
Copy link
Author

shockey commented May 11, 2018

@saikojosh, it appears that the transpired form of the module doesn't have any significant differences with the original source, when benchmarked in Chrome:

image

JSPerf here: https://jsperf.com/object-assign-deep-transpilation

The benchmark passes two objects with 5 levels of nested objects, randomly keyed.

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.

3 participants