Skip to content
This repository

Preserve the authored version of css, js, HTML. View Source has a posse. #820

Closed
paulirish opened this Issue · 8 comments

5 participants

Paul Irish Kevin Dangoor Nicolas Gallagher Mathias Bynens Ryan Seddon
Paul Irish
Owner

Was thinking about this today.. and seems that others are, as well...

Delivering the smallest payload to the user is definitely the best possible choice, yet we all learned from and love View Source. So what I'm thinking is we use a convention so the files are discoverable. Meanwhile this convention could be proposed so there is tooling support and view-source can grab the originals...

I'm thinking.. just a simple .full suffix on the filename. (before the extension)

  • style-1ad4f44e.cssstyle-1ad4f44e.full.css
  • style-1ad4f44e.min.cssstyle-1ad4f44e.full.css
  • index.htmlindex.full.html
  • script-a4f3b31a.jsscript-a4f3b31a.full.js

The min convention has come into its own, but it hits problems with minified HTML, as we dont change the filename in that case. Really we don't need to add a min into filenames at all, assuming a reasonable build process (plus it's more bytes, omg!).

If people like this, then we can do it here in H5BP and start moving to push it as a wider convention. (It could be baked into Uglify, YUI Compressor, Closure Compiler, and all those tools... and later on, browsers's view source functionality themselves)

Paul Irish
Owner

Though....

I suppose View Source is transitioning from "View Page Source" to using Chrome DevTools / Firebug / Dragonfly, etc. CDT and Firebug are both getting support for source-mapping soon which means they can debug GWT or Coffeescript.

http://www.netmagazine.com/news/mozilla-and-webkit-support-source-maps-111311

I suppose instead of a weak filename convention we could extend sourcemaps to CSS (everyone wants sass support in CDT) and HTML..

Kevin Dangoor

As much as I'm a CoffeeScript fan, minified files are actually what I think is the current #1 use case for source maps. They're explicitly designed to be language agnostic, so CSS and HTML source maps are definitely a possibility.

Kevin Dangoor

Scratch that... CSS and HTML source maps are a certainty :)

One more thing Nick Fitzgerald (fitzgen) was working with the Google Closure Compiler people the whole time he was working on source mapping for Firefox.

Nicolas Gallagher
Owner

I remember talking about this a couple of years ago with colleagues. Definitely like the idea of some solution. This might be a problem for dev tools to solve universally. However, that still won't let you see the file in the way that a developer originally authored it (e.g. comments, format, etc)...to structure and explain the code.

Mathias Bynens

Relevant write-up by @codepo8: http://www.wait-till-i.com/2010/08/23/view-source-will-teach-you-things-that-are-wrong/

View source gives you a view and not the source

Personally I’ve been using .src. (instead of .full.) for most of my unminified files. (I don’t usually minify HTML though.)

Good to hear source maps will solve this :)

Ryan Seddon

What about tying this into humans.txt somehow like a section on seeing full source?

Deleted user

The content you are editing has changed. Reload the page and try again.

Meh. I don't care enough to be so accommodating. Use Firebug or whatever and grab what you want. Run Tidy on the compressed source if you want everything.

Sending Request…

Attach images by dragging & dropping or selecting them. Octocat-spinner-32 Uploading your images… Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG. Yowza, that's a big file. Try again with an image file smaller than 10MB. This browser doesn't support image attachments. We recommend updating to the latest Internet Explorer, Google Chrome, or Firefox. Something went really wrong, and we can't process that image. Try again.

Paul Irish
Owner

Once sourcemapping starts landing in browsers, i think we shoudl talk to the humans.txt people about how that whole thing works.
And hopefully someone shows html source mapping in action. :D

Paul Irish paulirish closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.