-
Notifications
You must be signed in to change notification settings - Fork 2.5k
allow browserify #1134
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
allow browserify #1134
Conversation
@t128 what is the point of browserifying node-mysql? |
bundle it into one js file eg: browserify/browserify#1277 (comment) this has a few advantages:
|
ok, it might make sense with node-webkit, but why bundle there when you can use native require? |
also see related #961 |
sorry, have not read your comment until the end. ~50mb to ~1mb seems like a lot, but I guess it's not because of one file but because you exclude unused files. This can be done via coverage-like instrumentation to mark files for exclusion before packaging |
yeah, sorry, i changed the comment. so, it will never happen, as only node.js is really supported? ps: uglify halved the size to 400kb :) |
I'm not completely against your PR, but forcing only static require is actually bad for performance: I often require conditionally features that not always used to make startup time better |
We would only even accept this PR if this library was usable in a browser, but as far as I know, you cannot use it in a browser because you cannot make raw sockets there. Could you perhaps show/tell us how you are using this module in a web browser? |
@dougwilson it's used in node-webkit and bundled for performance considerations, not because of lack of module system |
Field: require('./Field'), | ||
FieldPacket: require('./FieldPacket'), | ||
HandshakeInitializationPacket: require('./HandshakeInitializationPacket'), | ||
index: require('./index'), |
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.
Why are you requiring itself? You can remove this.
Oh, gotcha. I left a couple line notes of two things that need to be fixed. |
hmm, you'r right. i missed the [A-Z] |
We can probably remove |
move it to devDependencies ? |
dat error:
:( |
Hi,
you can bundle node packages with browserify. Unfortunately it only works with static requires. So i changed all require-all with static requires.