-
Notifications
You must be signed in to change notification settings - Fork 16
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
Browserify #65
Browserify #65
Conversation
We'll need to change Travis' setup for this. |
e4fa758
to
64c30cc
Compare
Cool, look's great. I have a one comment on it. You are using browserfiy to bundle all source files together and delivery the build just via bower / git-url? No npm publish is involved in your publishing process, right? If so, this works really well in this case, because selleckt doesn't have any dependencies to other browserfiy friendly modules. Imagine selleckt would have two dependencies, a Because of that, a With browserify it's not possible to ship all kind of resources like images, fonts via the npm registry. It works quite good for css with cssify and atomify looks also interesting. But at the end all of these have their issues flexibility, documentation, maintenance. Yesterday I had a quick look to WebPack and it looks very promising. I need more time to figure out how useful WebPack is or not. |
Hi @stefanbuck Yes that's the case right now. I'm definitely open to us publishing to npm later on. Selleckt isn't meant to be bundled with CSS or fonts/images (that's left to the implementor) so I'm not sure we need to worry about the resources issues you mention. However, a PR demonstrating further improvements to this project would be very welcome indeed! |
Okay, it was more a general comment on the browserify approach. Not directly related to this project. |
97e8b38
to
e4f4a29
Compare
@@ -1,9 +0,0 @@ | |||
PORT=$1 |
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.
This is still in the README
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.
In general the README needs to be updated with information about how to see the demo page and how to run the tests
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.e. to debug tests in one browser (Chrome): karma start karma.conf.js --browsers=Chrome --single-run=false
d2c6795
to
b8755fb
Compare
I just realized this PR builds on top of #59 but does not replace it. I will try to review all commits after grahamscott@99549f1. That said I'd like to continue the conversation about MutationObserver in the first PR, as I still have doubts about this approach as I explained in my comment there |
throw new Error('Legacy Selleckt compatability requires the MutationObserver shim'); | ||
} | ||
|
||
SingleSelleckt.prototype.DELAY_TIMEOUT = window.MutationObserver._period * 2; |
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 is * 2
necessary?
I like how we split up Selleckt into multiple files, this is a great improvement. I also really like Karma 👍. |
- Added Karma as the test runner, which works nicely with browserify, as well as eliminates the need for a local test/index.html and associated mocha.js/css - Use a bundler so that the shim for legacy browsers is packaged separately - Added scripts so that a karma can run locally as well as via Saucelabs (for CI and also to test legacy browsers) - use grunt for managing the build/jshint
Achieved by using conditional comments.
This test measures the popover and gets different results in different browsers, so I've added a 2px tolerance to stop failures that would be acceptable from breaking the build
Travis will now run PRs in Firefox, but master builds will run the main suite in Chrome, Firefox, Safari and IE11 (on Saucelabs) followed by the same suite shimmed with LegacySelleckt for IE8/9/10 (also on Saucelabs)
- SingleSelleckt and MultiSelleckt now use _.defaults for consistency - template parsing is now called template caching and is not side-effecty
e6c10e2
to
6481300
Compare
To target a single browser run: | ||
|
||
```javascript | ||
karma start karma.conf.js --browsers=Chrome --single-run=false |
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.
Might be worth adding that this requires a npm install -g karma-cli
Unfortunately bower packages are not "published" (so there's no pre-publish step à la npm) and they do not have a How about we create a selleckt-build repo or even a branch which contains only the builds and the manifests and gets updated every time a change is pushed to master? A travis build could do either. |
Could we just update the The bower config should also be updated to only expose the dist/ folder.. |
Alternatively, a postinstall script on frontend might not be too bad.. |
this would mean all versions between tags would have outdated builds... which I'm not 100% a fan of (think of trying to find a bug with bisect) |
The tests dont use the files in |
Sorry I wasn't clear - I was talking about tests in projects that use selleckt |
For reference there seems to be a bug that's occasionally breaking the build (possibly related to browserify/factor-bundle#59). Let's keep the builds in |
So that we don't introduce nasty conditionals and reliance on the MutationObserver shim in the adding/removing items code, I've decided to make some major refactorings.
Key changes: