-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Stop people from patching babylon by building it #3204
Conversation
@@ -0,0 +1,2 @@ | |||
require("./_util").updateMain("index.js"); | |||
require("child_process").execSync(__dirname + "/../../../node_modules/.bin/browserify -s babylon -e " + __dirname + "/../lib/index.js -o " + __dirname + "/../index.js", { encoding: "utf8" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't need no stinkin node API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.join here ... because windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok mum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👶 🍼
Current coverage is
|
what is an example of it being patched? |
heh, ok. Can you add a comment somewhere explaining what's happening? |
Sure. I'll leave this up for a day or two as it's not super urgent if anyone else wants to leave feedback. This should also make slightly faster since we wont be doing as much disk IO. Depending on how good this is we could consider doing it to more packages. |
Can't we just be responsible users, allow this, but nudge those who do to provide sufficient warning that they are doing this, and that users should expect no support from babel from this use? |
What they're doing is irresponsible and the fact that it's possible does not reflect well on Babel. |
045bcdc
to
d125a77
Compare
I think it reflects badly on babel that this change, imo, breaks the open/closed principle, by completely closing down the parser to extension. Yes, this is a hack, yes, it is irresponsible, but it is done because there isn't a well defined mechanism to extend the parser, which is a commonly desired use case. |
This isn't something that is supported, this has been very explicit and clear. I'm sorry you feel that way. |
d125a77
to
6fe210d
Compare
@@ -0,0 +1,2 @@ | |||
require("./_util").updateMain("lib/index.js"); | |||
require("fs").unlinkSync(__dirname + "/../index.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.joinnnnnn
I know it's never been supported. However, I do hope that there could be something added to extend the parser in the future. Moreover, I don't completely understand why you think that this reflects badly on babel. Are there any pending bug reports resulting from people using these plugins? etc? |
Supporting users extending the parser would be a huge burden on the project if done improperly. And if we do want to do it someday, we would want to do so with careful consideration. We're well aware how popular the idea of extending the Babel parser is, which is exactly why we're shutting it down before anything popular gets built on it and we're forced to support it. Because the truth is people are not as responsible as you give them credit for, and at the end of the day they are only placing a burden on us. |
Stop people from patching babylon by building it
Locking this as this isn't an appropriate place for this discussion and this change wont be reverted. Feel free to jump on the Babel Slack if you'd like to voice your concerns. |
Stops people doing evil stuff that we don't want to support or endorse.