Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

replace AMD with Browserify (fixes #48) #50

Merged
merged 1 commit into from
May 15, 2015

Conversation

cvan
Copy link
Contributor

@cvan cvan commented May 14, 2015

I ended up having to do Browserify modules because I couldn't load a browserify module or a script that exported to the global window, without doing gross file copying + Require.js shimming.

anyway, it was simple enough to switch to Browserify. so now we can require external Node packages and Browserify modules like a boss 🍰.

@cvan cvan self-assigned this May 14, 2015
var runtime = {};
runtime.utils = new Utils();
window.addEventListener('DOMContentLoaded', function () {
// Wait for the document to load so the constructors can
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just add a defer to the <script> tag instead, and leave out this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about moving to the foot, but yeah I'll defer.

@@ -3,7 +3,7 @@
<meta charset="UTF-8">
<title>Horizon</title>
<link rel="stylesheet" href="css/navigation.css">
<script data-main="js/browser" src="js/ext/require.js"></script>
<script defer src="js/main.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you want me to rename this, let me know - I don't mind either way

@cvan
Copy link
Contributor Author

cvan commented May 14, 2015

@KevinGrandon good to merge?

@KevinGrandon
Copy link
Contributor

@cvan - I tried it out and I couldn't get sourcemaps working for me. Do they work for you?

Seeing the following error:

Error loading source:
loadSourceError

@cvan
Copy link
Contributor Author

cvan commented May 14, 2015

@cvan - I tried it out and I couldn't get sourcemaps working for me. Do they work for you?

Seeing the following error:

Error loading source:
loadSourceError

browserify/browserify#681 (comment)
https://bugzilla.mozilla.org/show_bug.cgi?id=1090768

I didn't notice it because the mapping in the Console looked okay. but yeah the Sources are borked. in Chrome, the Sources are fine.

@cvan
Copy link
Contributor Author

cvan commented May 14, 2015

I'm going to try to remove the relative references, though I really wish we could keep those. or I'll just ask @fitzgen.

@cvan
Copy link
Contributor Author

cvan commented May 14, 2015

@KevinGrandon fixed by using https://github.com/thlorenz/mold-source-map to normalise the paths, but seems like a legit Firefox DevTools bug to me.

@cvan cvan force-pushed the browserify branch 2 times, most recently from 0971b1a to 9c9fa95 Compare May 15, 2015 01:07
@cvan
Copy link
Contributor Author

cvan commented May 15, 2015

I'm gonna merge this now, since it seems to work beautifully 🌾

cvan added a commit that referenced this pull request May 15, 2015
replace AMD with Browserify (fixes #48)
@cvan cvan merged commit 4312155 into MozillaReality:master May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants