Skip to content

Don't allow instance properties transformation on namespace#10372

Merged
existentialism merged 2 commits intobabel:masterfrom
rhyzx:patch-1
Sep 5, 2019
Merged

Don't allow instance properties transformation on namespace#10372
existentialism merged 2 commits intobabel:masterfrom
rhyzx:patch-1

Conversation

@rhyzx
Copy link
Copy Markdown
Contributor

@rhyzx rhyzx commented Aug 29, 2019

Q                       A
Fixed Issues? N/A
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Properties transformation on namespace is unnecessary and will break webpack's Tree-Shaking.

Input:

import * as op from 'rxjs/operators';
op.map(fn);

Before output:

import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
import * as op from 'rxjs/operators';

_mapInstanceProperty(op).call(op, fn);

After output:

import * as op from 'rxjs/operators';
op.map(fn);

@rhyzx rhyzx marked this pull request as ready for review August 29, 2019 07:51
@JLHwung JLHwung requested a review from zloirock August 30, 2019 15:11
@JLHwung JLHwung added the PR: Polish 💅 A type of pull request used for our changelog categories label Aug 30, 2019
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Aug 30, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11433/

@zloirock
Copy link
Copy Markdown
Member

Seems something like that also required for the usage plugin of preset-env.

@rhyzx
Copy link
Copy Markdown
Contributor Author

rhyzx commented Sep 1, 2019

@zloirock updated for usage

@existentialism existentialism merged commit 29734b9 into babel:master Sep 5, 2019
nicolo-ribaudo pushed a commit to babel/babel-polyfills that referenced this pull request Sep 18, 2019
@nicolo-ribaudo nicolo-ribaudo removed the request for review from zloirock September 18, 2019 17:10
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: preset-env PR: Polish 💅 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants