Skip to content
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 support for contextDependencies #242

Merged
merged 3 commits into from
Nov 19, 2016

Conversation

aaronjensen
Copy link
Member

@aaronjensen aaronjensen commented Nov 18, 2016

After much digging I happened across another solution to the hot reloading issue. This one seems to work pretty well (it still doesn't support HardSourceWebpackPlugin, but I'd say that's their bug).

This is similar to what sass-loader added: webpack-contrib/sass-loader#6

@sapegin
Copy link
Member

sapegin commented Nov 19, 2016

Nice! I‘d even set default value for that based on components (would solve problem for most of the users) but I can merge it as is.

Common directory for all components (after glob expansion).

@aaronjensen
Copy link
Member Author

How would you recommend getting an absolute path from a glob?

@sapegin
Copy link
Member

sapegin commented Nov 19, 2016

Check the library I’ve linked in the comment. So for lib/components/**/*.js it would be exactly what you give as an example in docs. It works with a list of files, not with glob itself, so it’s not fragile magic which is very good ;-)

We use common-dir to find the directory that parents all components.
@@ -1,5 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ There are so many changes in this file because I added common-dir and yarn'd with 0.17.4. I'm guessing this was originally generated with 0.16.*. I don't know what they changed in yarn, but it made significant changes in my project's yarn.lock as well when we upgraded.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t worry, it’s better than shrinkwrap anyway ;-)

@aaronjensen
Copy link
Member Author

Ah, I didn't see that link the first time I read the comment. There really is a package for everything 😄 Thanks for finding that.

I updated the pull. I combined all section components + top level components to find the common dir. Let me know if there's anything you'd like me to change.

@sapegin sapegin merged commit f49ae5c into styleguidist:master Nov 19, 2016
@sapegin
Copy link
Member

sapegin commented Nov 19, 2016

Looks very good now! Merged ;-)

@aaronjensen aaronjensen deleted the add-context-dependencies branch November 19, 2016 17:39
sapegin added a commit that referenced this pull request Nov 22, 2016
## New feature

Now style guide should hot reload when you add new components.

New config option , by default will watch common root folder for all your components.

(#242 by @aaronjensen)

## Bug fixes and other improvements

* Don’t show sidebar if there are no components found (#247 by @n1313)
* Add mobile styles to improve display on narrow screens (#244 by @n1313)
* Add extra HTML markup to make previews easier to find with CSS selectors (#238, #243 by @n1313)
sapegin added a commit that referenced this pull request Nov 22, 2016
For some reason (most probably after transition to a GitHub
organization) Travis CI stopped to check pull requests.
sapegin added a commit that referenced this pull request Nov 22, 2016
## New feature

Now style guide should hot reload when you add new components.

New config option , by default will watch common root folder for all your components.

(#242 by @aaronjensen)

## Bug fixes and other improvements

* Don’t show sidebar if there are no components found (#247 by @n1313)
* Add mobile styles to improve display on narrow screens (#244 by @n1313)
* Add extra HTML markup to make previews easier to find with CSS selectors (#238, #243 by @n1313)
sapegin pushed a commit that referenced this pull request Jan 3, 2017
New config option contextDependencies, by default will watch common
root folder for all your components.

Original PR #242 by @aaronjensen
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.

None yet

2 participants