Skip to content

Commit

Permalink
Add repo to migration list, see phetsims/chipper#875
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 27, 2020
1 parent 4d1fffd commit d5cc61f
Show file tree
Hide file tree
Showing 127 changed files with 11,770 additions and 11,492 deletions.
40 changes: 33 additions & 7 deletions area-model-common-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@

<script type="text/javascript">

window.phet = window.phet || {};
window.phet.chipper = window.phet.chipper || {};
window.phet.chipper.packageObject = {
"name": "area-model-common",
"version": "1.0.0-dev.3",
"license": "GPL-3.0",
"repository": { "type": "git", "url": "https://github.com/phetsims/area-model-common.git" },
"devDependencies": { "grunt": "~1.0.0" },
"phet": { "generatedUnitTests": true, "requirejsNamespace": "AREA_MODEL_COMMON", "phetLibs": [ "twixt", "vegas" ] },
"eslintConfig": { "extends": "../chipper/eslint/sim_eslintrc.js" }
};
window.phet.chipper.stringRepos = [ {
"repo": "area-model-common",
"requirejsNamespace": "AREA_MODEL_COMMON"
}, { "repo": "joist", "requirejsNamespace": "JOIST" }, {
"repo": "scenery-phet",
"requirejsNamespace": "SCENERY_PHET"
}, { "repo": "sun", "requirejsNamespace": "SUN" }, {
"repo": "tambo",
"requirejsNamespace": "TAMBO"
}, { "repo": "twixt", "requirejsNamespace": "TWIXT" }, { "repo": "vegas", "requirejsNamespace": "VEGAS" } ];

// Identify the brand (assume generated brand if not provided with query parameters)
const brandMatch = location.search.match( /brand=([^&]+)/ );
const brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
Expand All @@ -29,6 +51,7 @@
// Preloads, with more included for phet-io brand
let preloads = [
'../sherpa/lib/mdn-array-from-polyfill.js',
'../sherpa/lib/es6-promise-1e68dc.auto.min.js',
'../sherpa/lib/jquery-2.1.0.js',
'../sherpa/lib/lodash-4.17.4.js',
'../sherpa/lib/FileSaver-b8054a2.js',
Expand All @@ -54,25 +77,28 @@
] );
}

// TODO: es6 modules won't need a "main" param in this function
// Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
// See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
// load all of the scripts with this method, so they are treated the same (and placed in the correct execution
// order).
const loadURL = ( preloadURL, main ) => {
const loadURL = ( preloadURL, type = 'text/javascript' ) => {
const script = document.createElement( 'script' );
if ( typeof main === 'string' ) {
script.setAttribute( 'data-main', main );
}
script.type = 'text/javascript';
script.type = type;
script.src = preloadURL + queryAppend;
script.async = false;
document.head.appendChild( script );
};

// Kick off string loading immediately
loadURL( '../chipper/js/load-runtime-strings.js' );

// Queue all of the preloads to be loaded.
preloads.forEach( loadURL );
preloads.forEach( preload => loadURL( preload ) );

loadURL( '../sherpa/lib/require-2.3.6.js', 'js/area-model-common-test-config.js' );
// Module loading in compilation-free (development) mode will be kicked off once strings are loaded.
// This is done in load-runtime-strings.js
window.phet.chipper.loadModules = () => loadURL( 'js/area-model-common-tests.js', 'module' );
</script>
</body>
</html>
Loading

0 comments on commit d5cc61f

Please sign in to comment.