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

[WIP] add Web-App Manifest (fixes #274) #317

Closed
wants to merge 2 commits into from
Closed

[WIP] add Web-App Manifest (fixes #274) #317

wants to merge 2 commits into from

Conversation

cvan
Copy link
Contributor

@cvan cvan commented Apr 26, 2018

(slightly dependent on issue #316)

src/hub.html Outdated
@@ -294,9 +318,9 @@
hand-controls2="right"
tracked-controls
teleport-controls="
cameraRig: #player-rig;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, my editor

Copy link
Contributor

@gfodor gfodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Two main things that need to be incorporated are just integration points with reticulum and cloudfront. If you want to chat about the moving parts directly (might be more efficient) lmk!

@@ -17,6 +19,28 @@
<% } else { %>
<script src="https://cdn.rawgit.com/brianpeiris/aframe/845825ae694449524c185c44a314d361eead4680/dist/aframe-master.js"></script>
<% } %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually inject these tags server-side, since the contents are dynamic (right now, includes the name of the room) see: Hubs-Foundation/reticulum#23

We can update the reticulum code for any missing tags you've included here. Eventually some of these (like the thumbnail) will be informed by the current state of the room, such as the environment choice and number of CCU.

Copy link
Contributor

@gfodor gfodor Apr 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that we plan on ripping out almost everything from this file and having it be rendered client side with react, at which point this will be just a basic stub and reticulum will have a proper templated server side view for the whole page (to inject these tags, point to the proper HEAD deployed JS/CSS asset, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thanks! I was wondering where; this makes more sense!

it's useful to have the HTML document's skeleton (and ideally critical-path assets, like inlined CSS and minimal JS to make the page interactive).

what about server-side rendering with React? just curious about the desire to move more to the client.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's involved to do that with Phoenix, my guess is that it is probably prohibitive since this is running on the BEAM VM. I agree that would be a good approach if we were running on a JS VM though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and the desire to move it all into the client is basically just to decouple our reticulum build/deploy process from the hubs project's build process. Once this is done there's a straight shot to being able to a) remove the coupling, so builds and deploys are faster and b) it cleans up the self-hosting story, since reticulum right now is coupled with the "burned in" asset URLs in the client code at package build time, so we can't just tell people to run our Habitat package to get things working.

This is being tracked here: #347

@@ -206,6 +206,18 @@ const config = {
to: "favicon.ico"
}
]),
new CopyWebpackPlugin([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to whitelist these in reticulum here so they will be served statically from origin: https://github.com/mozilla/reticulum/blob/master/lib/ret_web/endpoint.ex#L16

If we want these CDN'ed, we'll need to digest them and presumably add some absolute URLs somewhere to point the browser to them (I'm too unfamililar with the spec to know how to do this offhand but I'm guessing it's possible?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the URLs for any src value in the manifest (e.g., for icons and screenshots) can be local or external. local URLs are relative to the manifest URL (just FYI).

I'll follow up with this. I think I'll try this small webpack-pwa-manifest Webpack plugin, and see how that works out. thanks for the helpful comments!

@@ -4,9 +4,31 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally forgot to add these! Good thinking. (These don't require dynamic injection like the one listed above, obviously.)

"short_name": "Hubs",
"icons": [
{
"src": "https://assets-prod.reticulum.io/assets/images/icon.png",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this would be digested, so it will get busted out of CDN if we change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Since this is a slowly changing asset, and it might be quite complex to convince webpack to inject it properly here, I'm not opposed to us punting and just manually busting the CDN if it changes. Worth doing if its easy though.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most definitely. I'm going to try webpack-pwa-manifest, so I don't reinvent the wheel with this.

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

Successfully merging this pull request may close these issues.

2 participants