Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Asciidoc files are only rendered once when using LiveReload #26

Closed
lask79 opened this issue Apr 6, 2015 · 27 comments
Closed

Asciidoc files are only rendered once when using LiveReload #26

lask79 opened this issue Apr 6, 2015 · 27 comments
Milestone

Comments

@lask79
Copy link

lask79 commented Apr 6, 2015

Hi,

I am having problems using the Asciidoctor Firefox addon in combination with LiveReload and the JBoss Tools LiveReload (http://tools.jboss.org/features/livereload.html).

When I

  • start the LiveReload server, send an *.adoc file to the browser,
  • create a connection in firefox with the LiveReload Addon,
  • activate the Asciidoctor Firefox Addon and
  • change the *.adoc file
    then only the first change is triggering the new rendering of the *.adoc files in Firefox. The second change will not be displayed.

When I disable the Asciidoctor Addon then every change is triggering an update of the raw text so the LiveReload connection itself seems to work.

Any idea?

@ggrossetie
Copy link
Member

Hi @lask79 and thanks for using the Firefox add-on.
This is a known issue and we already solved it on the Chrome extension (meaning the fix will be easy yay!).
If I remember correctly the issue was that the LiveReload is injecting a script in the HTML page but the extension replaces the whole content with the converted html.
We fix this issue by saving existing script in the page. If you are interested in live reload, the chrome extension have a built-in feature (no need to install LiveReload).

I will try to backport this fix and publish a new version to the Firefox add-on website.

@lask79
Copy link
Author

lask79 commented Apr 9, 2015

That would be great if you could fix this soon. Chrome is not allowed at our customer site and therefor not an option for us.

Regards
Lasse

@ggrossetie
Copy link
Member

@lask79 I pushed to master a new version to save scripts before updating the document body (and then restore them). Could you test if this fix the issue ?

@maxandersen
Copy link

How do I test this ? is it already live ? if yes, it seem to have been fixed. And yes I did see the same issue described here in the past thinking it was our livereload implementation that somehow was broken; good to see it is just limited to asciidoctor.js firefox add on. ;)

@ggrossetie
Copy link
Member

How do I test this ? is it already live ?

I don't think so 😄
How did you install the add-on ? from the asciidoctor.org website or from https://addons.mozilla.org ? And can you tell me the version you are running ?

@lask79
Copy link
Author

lask79 commented May 28, 2015

How can I test this when this is not released yet? I am using 0.3.0.

@ggrossetie
Copy link
Member

Actually 0.3.0 sounds good, are you still having the issue with 0.3.0 ?

If you are using Firefox 38+, you can build an xpi file with jpm: https://github.com/asciidoctor/asciidoctor-firefox-addon#local-build

Then you can simply drag and drop it on Firefox to install the Add-on.

If you are using Firefox < 38 you need to use the Firefox Add-on SDK: https://github.com/asciidoctor/asciidoctor-firefox-addon/blob/3020eaba83450b817c5ff6251ae3daffff1ea547/README.adoc#local-build

You also need to checkout efaa65c (because master is currently targeting Firefox 38+ and is only compatible with jpm)

If this sounds too complicated I can produce a preview version and attach it on GitHub ?

@maxandersen
Copy link

I built this and it unfortunately does not seem to fix the bug

chrome works.

@ggrossetie
Copy link
Member

@maxandersen Could you give me a description of your environment so I can try to reproduce this issue ?

@maxandersen
Copy link

Running latest firefox w/asciidoctor plugin and livereload plugin using JBoss Tools Livereload feature (import project, right click .adoc file and use Show In > Browse w/livereload) - I do not think this is specific to jboss tools livereload though.

Then in firefox enable livereload and then edit to save file. See the reload happen.
edit and save file again - no reload happens.

enable livereload - things work again, but just once.

For "pure" html livereload works just fine. Only affects asciidoc.

For me this implies that the livereload feature does work, but somehow asciidoctor.js "resets" the reload feature which is unfortunate.

@ggrossetie
Copy link
Member

@maxandersen thanks for the detailed procedure, I'm downloading JBoss Developer Studio 8.1.0.GA to reproduce, I will let you know

@maxandersen
Copy link

note, it also fails without jboss developer studio.

@ggrossetie
Copy link
Member

Should be OK with my last commit 53bc70d

@lask79
Copy link
Author

lask79 commented Jul 1, 2015

Now it works like a charm. Thanks for fixing.

@ggrossetie
Copy link
Member

Cool, I will published a new version to the AMO 😄

@mojavelinux
Copy link
Member

👍 Nice work!

@ggrossetie ggrossetie modified the milestone: 0.4.0 Jul 4, 2015
@ggrossetie
Copy link
Member

Resolved by 53bc70d

@maxandersen
Copy link

any ETA on this ? https://addons.mozilla.org/en-US/firefox/addon/asciidoctorjs-live-preview/ still says 0.3.2 ?

@ggrossetie
Copy link
Member

I'm waiting review on #33 and #34 before publishing the new version

@ggrossetie
Copy link
Member

@maxandersen I submitted v0.4.0 to AMO

@maxandersen
Copy link

cool, do you know how long it takes from submit to it showing up for now old 3.x is still there.

@ggrossetie
Copy link
Member

Last time was 2 weeks or so, I will let you know when I heard from them.

@maxandersen
Copy link

just to verify that 0.4.0 built from source works like a charm! thanks.

@mojavelinux
Copy link
Member

👍

@ggrossetie
Copy link
Member

@maxandersen I have a good news!

Your add-on, Asciidoctor.js Live Preview 0.4.0, has been fully reviewed by an editor and is now available for download in our gallery at https://addons.mozilla.org/addon/asciidoctorjs-live-preview/

3 months to review a minor update... well done!

@maxandersen
Copy link

awesome!

@mojavelinux
Copy link
Member

🍻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants