Skip to content

Conversation

@geoffp
Copy link
Contributor

@geoffp geoffp commented Feb 22, 2016

Addresses #252, #159

Summary of changes:
This blacklists the UI chrome to exempt it from browsersync's snippet injection, meaning that the only thing it's glommed onto is the iframe itself and the stuff inside it. This should hopefully eliminate most of the spooky behavior that comes from BS, and in my testing, makes CSS injection and auto-page-refresh (upon editing pattern HTML) work correctly under both grunt & gulp.

Bonus: this also moves the browsersync badge to the lower right and chills it out some -- a request from my team that I think would be welcome to others.

@bmuenzenmeyer
Copy link
Member

@geoff I owe you a beer for this when you come my way 😄 🍻

will give it a quick review before merge.

Thanks friend!

@geoffp
Copy link
Contributor Author

geoffp commented Feb 22, 2016

Ah yeah, earnin' the 🍻

I had to read the browsersync code to figure this out -- the docs were not at all clear even on what the right option key was to use, whether it wanted a string, or array of strings, what the given path was relative to, yada yada. I think it's supposed to be a public URL fragment starting with a slash.

bmuenzenmeyer pushed a commit that referenced this pull request Feb 23, 2016
@bmuenzenmeyer bmuenzenmeyer merged commit 7c5bb30 into dev Feb 23, 2016
@bmuenzenmeyer
Copy link
Member

@geoffp thanks for this!

@bmuenzenmeyer bmuenzenmeyer mentioned this pull request Feb 23, 2016
3 tasks
@bramsmulders
Copy link

Guys, one quick note i'd like to point out from the top of my head. You NEED the refresh of the patternlab ui when adding, renaming or removing a pattern otherwise there will be no updated pattern menu.

I thought of the solution mentioned above once, and i could not implement it in my own fork due to the problem outlined above.

EDIT: Added renaming to list of actions which needs to trigger the UI refresh

@geoffp
Copy link
Contributor Author

geoffp commented Feb 25, 2016

Yeah, that's true -- I don't think I've ever been able to get a file-watcher to detect new files. Maybe once, but it was fragile. In fact, I think I once saw a bug report in Node.js itself about that.

That might be worth looking into again.

@bmuenzenmeyer bmuenzenmeyer deleted the better-browsersync branch February 25, 2016 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants