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

Statically generate index.html files for each route when using history API #87

Closed
agubler opened this issue Nov 7, 2018 · 0 comments
Closed
Labels
enhancement next Issue/Pull Request for the next major version

Comments

@agubler
Copy link
Member

agubler commented Nov 7, 2018

Enhancement

Currently build time rendering supports applications that use hash routing. This runs the application bundles and writes the html and critical css for each route to the applications index.html. For hash routing we support multiple routes by injecting a small script into the index.html that appends the correct html segment depending on the route.

However build time rendering does not currently support applications using the history API for routing (StateHistory provided by @dojo/framework/routing). Build time rendering needs to be enhanced such that we generate a separate index.html in the directory that reflects the route in the build output:

  1. The static HTML for the route is written to the index.html.
  2. Critical CSS required to load the route is added to a style in the index.html.
  3. Relative src references in the HTML are amended to ensure that resources are loaded correctly.
  4. Relative url references in the CSS are amended to ensure that resources are loaded correctly.
  5. The src of the scripts/css are amended with a relative prefix so they can be loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement next Issue/Pull Request for the next major version
Projects
None yet
Development

No branches or pull requests

1 participant