-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add uglify build step #392
Conversation
Probably safe to merge, since presumably we trust uglify and browserify to not break our code... I'm curious. How are you running the browser tests without using |
No, I was using |
I see. Can't you just change Like this: diff --git a/test/browser.html b/test/browser.html
index 979c6d0..421e6c5 100644
--- a/test/browser.html
+++ b/test/browser.html
@@ -6,6 +6,7 @@
</head>
<body>
+<script src="../dist/highland.js"></script>
<script src="./bundle.js"></script>
<script>
if (!window.nodeunit) {
@@ -21,4 +22,4 @@ if (!window.nodeunit) {
<hr />
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/test.js b/test/test.js
index 7c977ab..e1fa946 100755
--- a/test/test.js
+++ b/test/test.js
@@ -6,8 +6,16 @@ var EventEmitter = require('events').EventEmitter,
concat = require('concat-stream'),
RSVP = require('rsvp'),
Promise = RSVP.Promise,
- transducers = require('transducers-js'),
+ transducers = require('transducers-js');
+
+var _;
+if (global.highland) {
+ _ = global.highland;
+} else {
_ = require('../lib/index');
+}
// Use setTimeout. The default is process.nextTick, which sinon doesn't
// handle. |
We can even exclude |
Yep, that's a much better way of doing it. You'll have to forgive me, I have pretty much zero front-end experience so this stuff doesn't come naturally to me. What is odd though is that if I make these changes, the backpressure tests for |
I tried this with
I never see a problem with // setImmediate implementation with browser and older node fallbacks
if (typeof setImmediate === 'undefined') {
if (typeof process === 'undefined' || !(process.nextTick)) {
_.setImmediate = function (fn) {
setTimeout(fn, 0);
};
}
else {
// use nextTick on old node versions
_.setImmediate = process.nextTick;
}
}
// check no process.stdout to detect browserify
else if (typeof process === 'undefined' || !(process.stdout)) {
// modern browser - but not a direct alias for IE10 compatibility
_.setImmediate = function (fn) {
setImmediate(fn);
};
}
else {
_.setImmediate = setImmediate;
}
My guess is that there's some weird interactions between sinon timers and having two different If I change |
Given that |
I think so. |
Cool. I have a branch with all the other changes so I'll add this in as well and raise a PR. |
As mentioned in #389 , I've added a minified version to the dist folder and made it part of the build process. I'd still prefer to see the unit tests working on the minified version of the code but it doesn't seem to be that easy to get working.