Skip to content

Begin user interface implementation with app loading and URL fragment router#30

Merged
mbland merged 10 commits intomasterfrom
ui-init
May 14, 2017
Merged

Begin user interface implementation with app loading and URL fragment router#30
mbland merged 10 commits intomasterfrom
ui-init

Conversation

@mbland
Copy link
Owner

@mbland mbland commented May 14, 2017

This gets the app loader and the first implementation of the URL fragment router in place.

mbland added 10 commits May 14, 2017 19:17
This is following the pattern explained in "Serverless Single Page Apps"
by Ben Rady. The idea is that we'll use pure HTML items as templates
with a client-side router function to render and switch elements based
on hash identifiers.

Also uncomments the `document` argument to ensure that we're using the
proper scoping for `document`, even though we always intend to test the
actual browser `document`.
Though urlp.landingView takes no arguments, it's useful to spy on it to
ensure parsing happens as expected.
This will eventually be extracted into its own template item.
urlp.loadApp ensures the view is initialized after the page has finished
loading. Added a new test for urlp.showView to cover the case when
window.location.hash is the empty string.
This ensures the methods from the `urlp` namespace are properly
restored.
This ensures the router is called whenever the URL fragment changes.
Also updates .eslintignore to ensure that generated code isn't linted.
Also touches up a few tests to remove unnecessary variables.
Adding the new `describe()` blocks makes the test suite output more
organized and consistent. Also, `invokeLoadApp()` for the `loadApp`
suite more safely manages `window.onhashchange`.
Because it's properly "URL", not "Url".
@mbland mbland self-assigned this May 14, 2017
@coveralls
Copy link

coveralls commented May 14, 2017

Coverage Status

Coverage increased (+0.08%) to 98.195% when pulling 4a453b4 on ui-init into b62909d on master.

@mbland mbland merged commit dbc2804 into master May 14, 2017
@mbland mbland deleted the ui-init branch May 14, 2017 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants