-
Notifications
You must be signed in to change notification settings - Fork 23
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
Changes the opt-out character from _ to # #151
Conversation
This change is needed since we might have collisions with internal modules in Node otherwise.
2cfdcc9
to
ab38e69
Compare
Great fix! I'm not very into what characters to use or not in the require realm, so |
👍 Like @lizell I do not really have any strong opinions on what character is best for this. I don't know how safe |
When selecting the character for the opt-out we want to make sure it does not match the following.
We unfortunately missed that the third point could contain underscore, hence this bug. So given this conditions we need to use something that is:
This leaves us with some alternatives and the only other requirement that we are after is that it is easy to type and remember. Alternatives include characters like |
So maybe |
If the character choice is the only thing holding this PR back, I'm happy with any! ;) |
I vote for fish. If that's a no go, I vote for |
The only problem I have with require(':react');
require('#react'); With that logic however we do not need to use only a single character but could go for multiple ones like |
The change
This change is needed since we might have collisions with internal modules in Node otherwise, as seen here.
An example where this is a problem is in
browserify-zlib
that has the following code:Roc will in some instances process this code through its resolver and the following branch will be true.
This means that the code will now try to require
stream_transform
instead of the correct_stream_transform
. This will then result in an error since this module does not exist.This change means that opting out now is done in the following way.
Question
Is the
#
a good character to use for opt-out? Is there a better alternative that we can use?