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

paulirish opened this Issue Oct 22, 2011 · 8 comments


None yet

5 participants


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)



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.

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

dangoor commented Oct 23, 2011

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.

dangoor commented Oct 23, 2011

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.

necolas commented Oct 23, 2011

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) structure and explain the code.


Relevant write-up by @codepo8:

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 :)


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

ghost commented Oct 26, 2011

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.


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

@paulirish paulirish closed this Oct 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment