HTML file should be clean (for Pyjamas Desktop) => inject Pyjamas "magic" at compile time #25

Open
pyjsorg opened this Issue Apr 27, 2012 · 2 comments

Projects

None yet

1 participant

@pyjsorg
Collaborator
pyjsorg commented Apr 27, 2012

The HTML file for a pyjs application contains several tags that are only necessary for the pure Javascript version of the resulting application.

We should keep the HTML file clean from things that are not needed by Pyjamas Desktop (bootstrap Javascript file, history iframe, module meta tag). These tags should be injected into the HTML file by pyjsbuild at compile time.

This topic has been discussed in: https://groups.google.com/d/msg/pyjamas-dev/nH-FREwqwWo/asMPWGDGnkIJ

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=698 (March 07, 2012 02:40:08)

@pyjsorg
Collaborator
pyjsorg commented Apr 27, 2012

From peter.bi...@gmail.com on March 07, 2012 02:41:19:
I've adapted the HTML file generation in browser.py in order to make
the tag obsolete and allow for leaving out everything
unneeded for pyjd: This is achieved through pyjsbuild injecting

1.) the bootstrap script tag + the history iframe right before the
closing tag
2.) (or replacing) the pygwt:module meta tag right before the
closing tag

It is now possible to (let the developer) provide a handmade plain
HTML file with no Pyjamas magic in it at all. Pyjamas Desktop doesn't
need "magic", so the HTML file can be clean, small, simple. All the
magic (meta tag, bootstrap script, history iframe) is injected by
Pyjamas (pyjsbuild) at compile time.

I've also adapted the 'helloworld' and 'helloworldsplash' examples to
reflect (show off, if s/o notices) the new feature.

NOTE: the changes may affect existing projects as (at least) a second
bootstrap script tag + history iframe will be added to the existing
HTML file in <my_app>/public. This is easily fixed by removing the -
now unnecessary - lines from the HTML.

@pyjsorg
Collaborator
pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on March 10, 2012 20:40:59:
superb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment