DomoApps / starter-kit

This is an advanced Domo App project starter (boilerplate).
MIT License
20 stars 9 forks source link

DAS-4335: fix(switcher): add template with viewport meta tag #46

Closed bmbarker90 closed 8 years ago

bmbarker90 commented 8 years ago

include template for switcher's index.html to include a viewport meta tag. The viewport meta tag is

needed for enquire.js to properly work and switch to the correct project

bmbarker90 commented 8 years ago

@sldavidson @jpumford

bmbarker90 commented 8 years ago

Yep it does

andrewjensen commented 8 years ago

@bmbarker90 Just want to make sure I get the idea - HtmlWebpackPlugin already has a default template that it creates, but this just defines a custom one with that viewport option, right?

What was the problem we were having with the viewport tag missing here? The user will only see this (blank white) template for a split second before the real responsive or desktop app loads.

bmbarker90 commented 8 years ago

@andrewjensen Correct, the default template for HtmlWebpackPlugin doesn't include a viewport definition and doesn't look like it provides a way to define one in its config.

We need to viewport tag there so that accurate screen sizes are reported. Safari will report in dips instead of px if it is not declared, so switcher.js does not match the correct screen size. We were noticing that it was matching desktop on iPhone

andrewjensen commented 8 years ago

@bmbarker90 right, but the whole job of switcher.js and its template is to decide which page to redirect to. So why do we need to add the viewport to switcher's template? Is it because the incorrect viewport size persists even after the blank page redirects to the app?

bmbarker90 commented 8 years ago

@andrewjensen if we don't have the correct viewport size, enquire.js will match the wrong ruleset. So for example in the current state of things, switcher.js redirects to desktop on iPhone instead of responsive like it should.

jpumford commented 8 years ago

+1