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

Remove nohost/StaticServer (dead code), always rewrite CSS files, fix remote script injection #625

Merged
merged 1 commit into from
Mar 30, 2017

Conversation

humphd
Copy link

@humphd humphd commented Mar 5, 2017

I'm slowly working up the courage to tackle #549 and add Service Worker support. As I do, I'm re-familiarizing myself with our live dev server infrastructure. Today, I noticed a few bugs, and this fixes things:

  • We don't actually use the nohost/StaticServer module at all, so I've removed it. Kind of hilarious I wrote it at all, since it's 100% dead code :)
  • I've refactored the LiveDev script injection to always use what's defined in the PostMessageTransport vs. the hack we had in the HTMLServer before. I think this might actually fix a few other scroll-position bugs that @flukeout mentioned in Thimble, specifically https://github.com/mozilla/thimble.mozilla.org/issues/1671
  • I've fixed a bug in our server.urlToPath() method to ignore non-Blob/relative path URLs. This was causing an exception when HTML docs included links to stylesheets on the web (i.e., we were looking for a related doc in the editor, but we don't have one because it's actually an http:// url).
  • I've fixed a bug in our initial filesystem cache logic where we were reading but not rewriting HTML and CSS files, and then serving them without also rewriting any internal links (e.g., images). A good way to see the bug was to have a CSS that used background-image: url(something.png); and when you first load it, the image won't show. You have to edit the CSS file to make it actually rewrite it, and purge the existing, incorrect cached URL from the Blob Cache.

@gideonthomas
Copy link

everything seems to be working fine. I do see this showing up now though:
screen shot 2017-03-29 at 4 50 19 pm
screen shot 2017-03-29 at 4 50 34 pm

@humphd
Copy link
Author

humphd commented Mar 29, 2017

@gideonthomas do you know what you were doing when that was caused, and/or what the project you're editing looks like (files/folders/types)?

@gideonthomas
Copy link

@humphd it's the default project and it seemed to happen when I switched files. So I'm guessing when the preview reloads?

@humphd
Copy link
Author

humphd commented Mar 30, 2017

@gideonthomas I can't reproduce that error. I think we should take this patch, and fix bugs we find as a result.

@humphd humphd merged commit afd2da6 into mozilla:master Mar 30, 2017
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.

2 participants