Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Have a way to cause reloads for non-live server files #6600

Open
njx opened this issue Jan 20, 2014 · 5 comments
Open

Have a way to cause reloads for non-live server files #6600

njx opened this issue Jan 20, 2014 · 5 comments

Comments

@njx
Copy link
Contributor

njx commented Jan 20, 2014

If I'm understanding the code correctly, in Live Development we only trigger a reload when saving a non-live file if we think the browser requested it (e.g. a JS file). That won't trigger for server files that aren't actually requested by the browser. For example, if you edit a .erb view file in a Rails project, saving it won't trigger a reload.

I think we did this because there are various files you might edit that aren't related to the current page, and we don't have any way of distinguishing between the two cases. However, perhaps it would be worth having a way to specify certain file extensions as triggering a reload. It could still cause too many reloads, since you might (for example) edit a view file that's not relevant to the current page you're previewing. But it might be a useful option.

Another, lighter-weight solution might be to simply have a keyboard shortcut in Brackets that causes the attached live preview page to reload.

@njx
Copy link
Contributor Author

njx commented Jan 20, 2014

Probably "move to backlog".

@ghost ghost assigned dangoor Jan 28, 2014
@dangoor
Copy link
Contributor

dangoor commented Jan 28, 2014

There are some lightweight things we can do here, so I'm calling this low priority to me. I think we should do one or two lightweight things and then possibly add something to the backlog.

It shouldn't be hard to have a pref that lets the user configure files to automatically reload. Adding UI will take more work. Keyboard shortcut for reloading the live preview page is obviously easy.

@dangoor dangoor added this to the Brackets 1.0 milestone Mar 17, 2014
@dangoor
Copy link
Contributor

dangoor commented Mar 17, 2014

I had called this low priority, but I'm nominating it for 1.0 because I think we can likely do something cheap here and it will be a big win for people doing live development with all kinds of server side or languages outside the supported languages.

@peterflynn
Copy link
Member

Reviewed - keeping in 1.0.

New suggestion: let's just refresh any time a non-live file is saved, regardless of its extension. It seems uncommon that the user would have Live Preview open but then edit an unrelated file (and be bothered if we refreshed the page anyway). Better to have the desired refresh behavior on by default rather than buried in a pref. (But if we think there are potentially annoying cases, we could add a pref to prevent refresh when saving certain file types).

@redmunds
Copy link
Contributor

PR #8080 provides a way to manually reload from Brackets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants