ArtskydJ / noddity-render-dom

Render Noddity posts to the DOM
1 stars 2 forks source link

Pages should still load/render even if there is a Ractive parse error #23

Open TehShrike opened 8 years ago

TehShrike commented 8 years ago

If you render some markdown like this:

# Sup dawg

{{}
howdy

Ractive throws this error, visible in the console:

ractive.js:3628 Uncaught ParseError: Expected closing delimiter '}}' after reference at line 4 character 6:
<p>{{}
     ^----

This error message should be displayed in the DOM, as the post content. Probably inside a <pre> tag.

Right now it shows up only in the console, and breaks Noddity from running. The url gets updated, but the content never changes, which is pretty bad UX.

saibotsivad commented 8 years ago

Oh yeah, that's a pretty bad deal.

saibotsivad commented 8 years ago

What's particularly troubling about this, as it relates to Noddity, is that if you have a template which has some syntax error, it appears that this template will not be reloaded (and thereby fixed for the client) until the cache expires (which IIRC you said was ~1 week).

So I think that a proper solution would figure out a way to invalidate the cache for that file, in some way that it will attempt to re-download it sooner than the cache expiration (e.g. try again every few seconds? minutes? backoff algorithm?).

TehShrike commented 8 years ago

Yeah, I think that's an accurate read on the situation. It's rendered non-serious for "post"s because those are reloaded when you visit their page, but for top-level templates or embedded templates, it would be devestating.

I'll write up another issue for this. It will need to involve noddity-butler

TehShrike commented 8 years ago

Created a new issue #24 in this repo, depending on https://github.com/TehShrike/noddity-butler/issues/7.

This particular issue is still a separate thing that needs to be worked (and is a very good stopgap measure I think), but those other issues represent a real problem that should still be solved.