NV / chrome-devtools-autosave

Auto-saving CSS and JavaScript changes from the Chrome Developer Tools
MIT License
1.04k stars 89 forks source link

Allow targeting of specific Stylesheet for new styles #32

Closed drewcovi closed 12 years ago

drewcovi commented 12 years ago

Alright, so hear me out on this little stop in crazy town

For collaborators, it would be great to allow two people to work on the same site using this plugin. The best way to avoid clobbering eachother would be to use two stylesheets (and merge them at a later date).

However currently we're just searching for the last stylesheet, it would be pretty fantastic if we could pick a specific stylesheet for new styles in the Options, so user A and user B could then work independently.

The default behavior would still default to the last discovered stylesheet.

NV commented 12 years ago

LiveReload solves this problem.

Here is how it works:

  1. You edit some.css via DevTools Autosave
  2. It saves changes to some.css
  3. LiveReload detects a file change
  4. LiveReload sends to all connected users a signal to reload some.css from the server.

Give it a try and tell me what you think.

drewcovi commented 12 years ago

hmmm would that work if we all connect via sftp? or only in a local shared environment? the caveats of different connection technologies is such a pain.

drewcovi commented 12 years ago

and does that thing diff changes? or if User A is working on a version and saves it will it clobber user B?

NV commented 12 years ago

I just tried using Livereload with SFTP; It worked well.

I connected to SFTP server using Transmit.app. SFTP server as a disk using Transmit.app. Transmit.app mount the server as a disk in /Volumes/my_server_name/my_server_path I added /Volumes/my_server_name/my_server_path to LiveReload monitored folders.

drewcovi commented 12 years ago

wait, does autosave save an entire stylesheet? or does it open the stylesheet and update that line of code?

NV commented 12 years ago

Autosave sends entire file, diffs are in the feature list #13.

or if User A is working on a version and saves it will it clobber user B?

No. Every change immediately saves (by Autosave) and syncs (by LiveReload) so there is nothing to clobber.

Anyway, your feature request seems valid to me. I’ll make an API for that.

drewcovi commented 12 years ago

hmm okay, and btw i seriously love this idea.

so that means that while someone is about to commit a style (still updating properties), the stylesheet itself can be updated, and rules will obviously shift line numbers?

I'd think this could cause issues of duplicates unless somehow chrome does a quick diff to identify the new location of a given rule.