* feat: add context menu support and migrate easy options
* feat: pass events to context menu options
* chore: migrate final comment context menu option
* feat: add exports for comment context menu items
* chore: PR comments
* chore: delete mocha tests for angle field
* feat! : delete angle field
* chore(tests): delete colour tests from generator tests and golden files
* chore: delete colour blocks and associated generators
* chore: remove colour blocks from playgrounds
* chore: delete mocha tests for colour fields
* chore: fix incorrect comment
* chore: delete colour field from core
* chore: delete multiline input tests from generators tests and golden files
* chore: delete multiline text block and associated generators
* chore: remove multiline text block from playgrounds
* chore: delete mocha tests for multiline input field
* chore: delete multiline input field from core
* refactor(build): Simplify implementation of posixPath
* fix(closure): Make safe to import in node.js
Make the implementation declareModlueId safe to import and
execute in node.js, which does not provide a window global.
(N.B. because this is an ESM and therefore automatically
strict, using window?.goog?.declareModuleId doesn't work
because window being undefined is an early error.)
* feat(tests): Introduce chunk loading shims
- Add a buildShims task to build_tasks.js that, for each chunk,
creates a correspondingly-named build/<chunk>.mjs that will
either (in uncompressed mode) import and reexport that chunk's
entry point module (e.g. core/blockly.js) or (in compressed
mode) load dist/<chunk>_compressed.js using a <script> tag
and then export the corresponding properties on the chunk's
exports object.
- Provide helper methods used by these shims in
tests/scripts/loading.mjs, including code to detect whether
to load in compressed or uncompressed mode.
- Add a quote() function to scripts/helpers.js, used by
buildShims. This is copied from tests/bootstrap_helper.js,
which will be removed in a later commit.
* refactor(tests): Update playground.html to use new loading shims
* refactor(tests): Update advanced_playground.html to use new loading shims
* refactor(tests): Update multi_playground.html to use new loading shims
* chore(tests): Delete playgrounds/shared_procedures.html
Shared procedure support was moved to a plugin and this should
have been removed from core along with it.
* docs(tests): Typo corrections.
* chore(tests): Add ".loader" infix to shim filenames.
Per suggestion on PR #7380, have buildShims name the shims
${chunk.name}.loader.mjs instead of just `${chunk.name}.mjs`.
Refactor bootstrap.js and bootstrap_helper.js to be able to deal
with generator chunks. In particular for each chunk, specify:
- The goog.module ID to goog.require() in uncompressed mode.
- The script filename to load in compressed mode.
- Where the chunk's UMD wrapper will save the export object when
loaded as a script.
- What global variable the chunk's export object should be saved in
(if desired).
- Any individual named exports to destructure to global variables.
This allows the bootstrap scripts to be slightly simpler while
also being more flexible.
* refactor(xml): Move textToDom to core/utils/xml.ts
This function being in core/xml.ts was the cause for the last
remaining circular import in core/ (between variables.ts and
xml.ts).
Moving it to utils/xml.ts makes sense anyway, since there is
nothing Blockly-specific about this function.
Fixes#6817.
* fix(closure): Reenable goog.declareModuleId multiple-call check
Reenable an assertion which check to make sure that
goog.declareModuleId is not called more than once in a module
(and which also catches circular imports amongst ES modules, which
are not detected by closure-make-deps).
* chore(tests,demos): Augo-migrate use of textToDom
Testing the migration file entry by auto-migrating all uses of
Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.
* chore(blocks): Manually migrate remaining use of textToDom
Update the one remaining call to textToDom (in blocks/lists.ts)
to the function's new location - also removing the last use of
the Blockly.Xml / core/xml.ts) module from this file.
* docs(xml): Remove unneeded @alias per comments on PR #6818
* fix(imports): Remove unused import
* feat(build): Make build tasks invoke their prerequisites
- Divide gulp targets into three kinds: main sequence,
manually invokable, and script-only. The first two categories
automatically invoke their prerequisites.
- Give (most of) the affected gulp targets shorter and more memorable
names that could become their npm script names in future.
* feat(build): Make package tasks invoke their prerequisites
Have the package task invoke the cleanBuildDir (as well as
cleanPackageDir) and build tasks. Remove the checkBuildDir
task as it is now redundant since a fresh build is done every
time.
* feat(build): Make git tasks invoke their prerequisites
* feat(build): Make cleanup, license [sic] tasks invoke their prerequisites
Turns out they don't have any, so this commit just classifies
their gulp targets according to the established scheme.
* feat(build): Make appengine tasks invoke their prerequisites
In this case prepareDeployDir will eventually depend on package
but does not for now.
* feat(build): Have npm scripts run npm ci first where applicable
Have any npm script that have external effects (e.g. publishing an
npm package, pushing a new version to appengine, or updating GitHub
Pages) start by running npm ci to ensure that all dependencies are
up-to-date with respect to package-lock.json.
(This is done by npm and not a gulp script because gulp itself
might need updating. So might npm, but that is less likely to
make any difference to what gets published/pushed.)
* chore(build): have tests use package target
Have the tests just run the package target (with debug flags)
since that runs the the build target automatically.
* feat(tests): Write Closure Compiler output directly to dist/
Since they are already UMD-wrapped, have Closure Compiler write
output chunks directly to RELEASE_DIR, i.e. dist/.
* chore(tests): Use freshly-build files in compressed mode.
Use the freshly-built build/*_compresssed.js files when bootstrapping
in compressed mode, rather than using the checked-in files in the
repository root.
This helps ensure that compressed and uncompressed mode will be
testing (as closely as possible) the same code.
Obsoletes #6218 (though the issues discussed there have not actually
yet been addressed in this branch).
* chore(build): Write intermediate langfiles to build/msg
Write the results of create_messages.py to build/msg instead of
build/msg/js.
* fix(build): Use build/msg/en.js instead of msg/messages.js in tests
This has no direct effect but fixes a long-standing misdesign
where we are testing against the input to, rather than the output
of, the language file processing pipeline.
* feat(demos): Use freshly-built files
Use the freshly-built dist/*_compresssed.js and build/msg/* files
rather than using the checked-in files in the repository root.
This helps ensure that these demos are using the most recent
version of Blockly (even in the develop branch).
* fix(build): Update appengine deployment to include built files
Modify the prepareDemos task as follows:
- Use the git index instead of HEAD, so that most local changes
will be applied (without copying whatever .gitignored cruft
might be in the local directory).
- Run clean and build and then copy build/msg and
dist/*_compressed.js* to the deploy directory.
This fixes the problem created by the previous commit, wherein the
demos relied on built files that were not being deployed to
appengine.
* fix(build): Update GitHub Pages deployment to include built files
Modify the updateGithubPages task to run clean and build and
then git add build/msg dist/*_compressed.js*, so that they will
be included in the deployed pages.
This fixes the problem created by the previous^2 commit,
wherein the demos relied on built files that were not being
deployed to GitHub Pages.
* chore(build): Remove build products from repository
Remove *_compressed.js* and msg/js/* from the blockly repository.
Also remove the now-obsolete checkinBuilt gulp task.
* chore(build): Apply relevant changes to test_tasks.js
Apply changes made to run_all_tests.sh and check_metadata.sh to
the corresponding parts of their JS replacements in
test_tasks.js.
* chore(build): Make updates suggested in PR #6475
- Remove `clean:builddir` and `clean:releasedir` - `clean`
is sufficient.
- Remove duplicate `require` from `appengine_tasks.js`.
* feat(build): Use shorter npm script names
Since scripts that run build tasks now automatically run their
prerequisite tasks, the previous naming scheme of task `build`
running all the `build:subtask`s no longe really makes very
much sense.
Additionally, following a chat discussion, there seems to be a
rough consensus to use "messages" to refer to the .json input
files, and "langfiles" to the generated .js output files.
Consequently, simplify npm script names by renaming as follows:
- "generate:langfiles" -> "messages"
- "build:langfiles" -> "langfiles"
- "build:js" -> "tsc"
- "build:deps" -> "deps"
- "build:compiled" -> "minify"
- "build:compressed": delete this synonym for "build:compiled",
("minify" was chosen as agnostic to Closure Compiler vs. WebPack.)
* chores(build): Add deprecation notice for old scripts
To reduce potential confusion/frustration, restore the previous
npm scripts but have them display a deprecation notice instead
(note that npm prints the script contents before running it, so
echo is not needed).
* docs(build): Add comments distinguishing 'messages' from 'langfiles'
* fix(build): Minor corrections to build_tasks.js
- Use TSC_OUTPUT_DIR to find goog/goog.js when suppressing warnings.
- Remove unnecessary trailing semicolons.
* refactor(blocks): Remove declareLegacyNamespace
Remove the call to goog.module.declareLegacyNamespace from
Blockly.libraryBlocks. This entails:
- Changes to the UMD wrapper to be able to find the exports object.
- Changes to tests/bootstrap_helper.js to save the exports object
in the libraryBlocks global variable.
- As a precaution, renaming the tests/compile/test_blocks.js module
so that goog.provide does not touch Blockly or
Blockly.libraryBlocks, which may not exist / be writable.
* feat(build): Add support named exports from chunks
We need to convert the generators to named exports. For backwards
compatibility we still want e.g. Blockly.JavaScript to point at
the generator object when the chunk is loaded using a script tag.
Modify chunkWrapper to honour a .reexportOnly property in the
chunks table and generate suitable additional code in the UMD
wrapper.
* refactor(generators): Migrate JavaScript generator to named export
- Export the JavaScript generator object as javascriptGenerator
from the Blockly.JavaScript module(generators/javascript.js).
- Modify the Blockly.JavaScript.all module
(generators/javascript/all.js) to reexport the exports from
Blockly.JavaScript.
- Update chunk configuration so the generator object remains
available as Blockly.JavaScript when loading
javascript_compressed.js via a <script> tag.
(N.B. it is otherwise necessary to destructure the require
/ import.)
- Modify bootstrap_helper.js to store that export as
window.javascriptGenerator for use in test code.
- Modify test code to use javascriptGenerator instead of
Blockly.JavaScript.
- Modify .eslintrc.json so that javascriptGenerator is allowed
as a global in test/. (Also restrict use of Blockly global
to test/.)
N.B. that demo code in demos/code/code.js uses <script> tag
loading and so will continue to access Blockly.JavaScript.
* refactor(generators): Migrate Lua generator to named export
* refactor(generators): Migrate PHP generator to named export
* refactor(generators): Migrate Python generator to named export
* refactor(generators): Remove declareLegacyNamespace calls
Remove the goog.module.declareLegacyNamespace calls from the
generators.
This turns out to have the unexpected side-effect of causing the
compiler to rename the core/blockly.js exports object from
$.Blockly to just Blockly in blockly_compressed.js - presumably
because it no longer needs to be accessed in any subsequent chunk
because they no longer add properties to it. This requires
some changes (mainly simplification) to the chunkWrapper function
in build_tasks.js.
* refactor(core): Remove declareLegacyNamespace from blockly.js
So easy to do _now_: just need to:
- Make sure the UMD wrapper for the first chunk knows where the
exports object is.
- Use that same value to set the Blockly.VERSION @define.
- Have bootstrap_helper.js set window.Blockly to the exports
object.
- Fix tests/compile/test_blocks.js to not assume a Blockly
global variable, by converting it to a goog.module so we
can use a named require.
* refactor(tests): Move and rename prepare.js, blockly.mjs
Since prepare.js and blockly.mjs are going to be needed for running
all tests in uncompiled mode (not just the playgrounds), move them
tests/. Further, rename prepare.js to bootstrap.js to better reflect
its purpose.
* feat(tests): Introduce BLOCKLY_BOOTSTRAP_OPTIONS
Provide a mechanism for web pages that use bootstrap.js to control
what is loaded and how.
* fix(tests): Use the blockly repository path for all script src= URLs
Previously the (non-advanced) playground was only correctly loadging
on localhost because you can put an arbitrary number of "../"s in front
of a relative URL and it just takes you to the root directory.
* fix(tests): Don't use template literals in bootstrap.js
This is necessary (but not necessarily sufficient) to be able to
load the file in IE 11.
* fix(tests): Throw error if attempting to bootstrap in node.js
* feat(tests): Make bootstrap.js more configurable.
* Terminology change: use "compressed" and "uncompressed" to describe
what Closure Compiler calls "compiled" and "uncompiled", to reduce
confusion with the compilation that will be done by tsc.
* Get the list of modules to bootstrap (in compressed mode), or
scripts to load (in compressed mode) from BLOCKLY_BOOTSTRAP_OPTIONS,
to allow calling scripts to to specify exactly what to load.
* feat(tests): Use a proper quote function
We need to generate string literals. Best to use a quote function
instead of concatenating on quote marks withou escaping. Copy a
well-tested one from Code City.
* feat(tests): Support an additionalScripts option
This is a list of scripts to load (in order) once the required modules
have been bootstrapped.
We do this using goog.addDependency to make the first script depend
on the required modules, then each subsequent script depend on the
previous one, and then finally goog.bootstrapping the last such script.
* refactor(tests): Remove special handling of msg/messages.js
* refactor(tests): Use additionalScripts for all script loading
Use additionalScripts option for all script loading in
playground.html and advanced_playground.html.
* refactor(tests): Use bootstrap instead of uncompressed in Mocha tests
Use tests/bootstrap.js instead of blockly_uncompressed.js to load
blockly in uncompressed mode in the Mocha tests.
This entails adding a new item, despFiles, to BLOCKLY_BOOTSTRAP_OPTIONS,
to allow tests/deps.mocha.js to be loaded at the appropriate point.
Mention of blockly_uncompressed.js is removed from
tests/mocah/.mocharc.js; it's not clear to me what effect the "file:"
directive in this file might have previously had and I was not able to
find documentation for it on mochajs.org, but in any case removing it
appears to have had no ill effect.
* refactor(tests): Use bootstrap instead of uncompressed in generator tests
This entails adding an additional check in bootstrap so as to load
uncompressed when loading from a file: URL, since these are not
localhost URLs - though in fact the generator tests run equally well
in compressed mode, albeit against (for now) the previously-check-in
build products rather than the live code.
* refactor(test): Use bootstrap.js in multi_playground.html
This removes the last use of load_all.js, so remove it.
* chore(tests): Delete blockly_uncompressed.js
Its function has now been entirely subsumed by tests/bootstrap.js,
so remove it and update any remaining mentions of it.
Also fix formatting and positions of some comments in playground.html.
* fix(tests): Rewrite bootstrap sequencing code
An earlier commit modified the generated <script> to use
goog.addDependency to trick the debug module loader into loading
.additionalScripts (via goog.bootstrap), but it turns out there is
a small problem: scripts like msg/messages.js have undeclared
dependencies on the Blockly module, and without a call to
goog.require('Blockly') in them they can end up being run before
the Blockly module is fully loaded.
(This problem only occurs when there are ES Modules, rather than
merely goog.modules, in the mix.)
Fix this by adding a script, bootstrap_helper.js, to be loaded
options.requires and any options.additionalScripts that makes an
explicit call to goog.require for each of option.requires.
Also refactor the code so that instead of generating a loop which
calls goog.addDependency, we generate the addDependency calls
directly. This makes debugging a bit easer as we can use the browser's
dev tools to inspect the generated calls in the DOM tree.
* fix(tests): Prevent spurious transpilation warnings
For some reason when the debug module loader encounters ES modules
it starts to complain about being unable to transpile some ES202x
features in other (non-ESM) modules, even though it doesn't normally
try to transpile those.
Since uncompressed-mode testing is almost exclusively on modern
browsers we don't care about transpiling these features, so suppress
the warnings instead.
* refactor(tests): Rename blockly.mjs to bootstrap_done.mjs; simplify
Since blockly.mjs is no longer returning just the exports object
from core/blockly.js (see PR #5995), it might be better named after
its actual purpose: to wait for bootstrapping to be done.
Remove all the code that was used to pass the blockly.js exports
object along from the bootstrap callback to the blockly.mjs export,
since there's no reason to go to a lot of trouble to set a local
variable named Blockly to the same value as a global variable named
Blockly.
(Something like this may be needed again in future, but certainly in
a different form.)
* chore(tests): Use freshly-build files in compressed mode.
Use the freshly-built build/*_compresssed.js files when bootstrapping
in compressed mode, rather than using the checked-in files in the
repository root.
This helps ensure that compressed and uncompressed mode will be
testing (as closely as possible) the same code.
* chore(tests): Rename BlocklyLoader to blocklyLoader; record compressed
- Rename the BlocklyLoader global to blocklyLoader (since it is not
a class constructor).
- Create it regardless of whether we are bootstrapping in
uncompressed or loading compressed via <script> tags.
- Record which we are doing as .compressed, and use this property
to choose playground background colour.
* chore(tests): Resolve comments for PR #6214
Mostly documentation changes, but notably renaming blocklyLoader to
bootstrapInfo.
* Revert "chore(tests): Use freshly-build files in compressed mode."
This reverts commit de8d356838.
* chore(deps): Update closure/goog/base.js, add goog.js
* Update base.js from the latest version (20220104.0.0).
* Also copy over goog.js, which provides access to asuitable subset
of goog.* via an importable module).
* refactor(tests): Have playground.html load Blockly as a module
N.B.:
* We still need a preparation step, in order to load base.js and
deps.js via <script> tags in uncompiled mode; in compiled mode
it will instead load all the *_compressed.js files via <script>
tags.
Acess to the Blockly object is via:
import Blockly from './playgrounds/blockly.mjs';
(N.B: no "* as", since blockly.mjs has only a default export.)
* There remain two serious defects when running in uncompiled mode:
* It does not attempt to load msg/messages.js, causing startup to
fail.
* Module loading only works if there are no ES Modules; if there
are, something goes wrong with base.js's attempt to sequence
module loads causing goog.modules that import ES modules to get
a null exports object for that import. X-(
* fix(tests): Have playground.html load messages.js before generators
This fixes the issue caused by missing messages when loading
the generators.
* fix(tests): Move bootsrap calls to prepare.js
Move the calls to goog.bootstrap from blockly.mjs to prepare.mjs.
This is needed to work around a bug in the Cosure Library debug
loader (https://github.com/google/closure-library/issues/1152).
This gets a bit ugly because most of the code has to go in a
<script> (because it needs goog.bootstrap, which was loaded by
an earlier <script> tag).
* fix(documentation): Minor comment corrections for PR #5931
* chore(build): Add "all" modules for blocks & generators
These modules (Blockly.blocks.all and Blockly.<Generator>.all) will
be the entry points for the corresponding chunks.
They also make it easier to pull in all the modules in each package
(e.g. for playground and tests).
It is necessary to set the Closure Compiler dependency_mode to
SORT_ONLY as otherwise it tries to compile the "all" modules before
their dependencies, which fails.
The only impact on the _compressed.js files is the addition of a short
string to the very end of each file, e.g.:
var module$exports$Blockly$JavaScript$all={};
* chore(deps): Add devDependency on closure-calculate-chunks
* feat(build): First pass at chunked complation
Add a new buildCompiled gulp target (npm run build:compiled) that
uses closure-calculate-chunks to do chunked compliation of core/,
blocks/ and generators/ all in a single pass.
This work is incomplete: the resulting *_compressed.js files don't
(yet) have UMD wrappers.
* chore(build): Generate chunk wrappers
A first pass; this does not have support for a namespace object yet.
* refactor(build): Use chunked compilation by default
Remove old "compressed" gulp tasks in favour of new "compiled" task.
* chore(build): Remove cruft from buildCompiled
Remove unneeded `done` parameter and commented-out options that had
been cargo-culted from the old build pipeline.
* fix(build): Fix test failures caused by new build pipeline
- Exclude closure/goog/base.js from compiler input; use
externs/goog-externs.js instead.
- Have the build:debug and build:strict targets only build the first
chunk (blockly_compressed.js).
- Fix namespace entries for blocks and generators.
* fix(build): Fix build failures on node v12
closure-calculate-chunks requires node.js v14 or later.
When running on node.js v14 or later have getChunkOptions save
the output of closure-calculate-chunks to
scripts/gulpfiles/chunks.json. When running on older versions of
node.js have it use this checked-in, cached output instead of
attempting to run closure-calculate-chunks.
* chore(build): enable --rename_prefix_namespace
This will allow modules in blocks/ and generators/ to use
goog.require to obtain the exports object of goog.modules from
core/.
* fix(build): Always build all chunks
The previous commit enabled --rename_prefix_namespace option to
Closure Compiler, and this causes the buildCompressed target to
work fine when run without --debug or --strict, but adding either
of those flags (as for example when `npm test` runs
`npm run build:debug`) causes an issue:
- Because of many compiler errors in blocks/ and generators/,
a previous commit added a hack to only build the first chunk
when doing debug/strict builds.
- When asked to build only one chunk, Closure Compiler ignores the
--rename_prefix_namespace flag, because it 'correctly' infers
that there are no later chunks that will need to access global
variables from the first chunk.
- This causes a test failure, because `npm test` first runs
`npm run build`, which generates a valid blockly_compressed.js,
but this is then overrwritten by an invalid one when it next runs
`npm run build:debug`.
(The invalid one is missing all `$.` prefixes on 'global' variables,
including on Blockly, so the wrapper's last two lines -
"$.Blockly.internal_ = $;" and "return $.Blockly" - fail.)
The fix is to add appropriate @suppress annotations to blocks/*.js and
generators/**/*.js and then remove the first-chunk-only hack.
* refactor(build): Just build once
Since the previous commit caused `npm run build:debug` to do
everything that `... build:compressed` does - and to produce
byte-for-byte identical output - it doesn't make sense to run
both when testing. To that end:
- Replace the build:debug and build:strict package scripts that
did `gulp buildCompressed --...` with new scripts build-debug
and build-strict that do `gulp build --...` instead.
(The target names are changed so as to extend our existing naming
convention as follows: a target named "foo:bar" does some sub-part
of the job done by target "foo", but a target named "foo-bar" does
all the work of the target "foo" with some extra options.)
- build:debug:log and build:strict:log are similarly replaced with
build-debug-log and build-strict-log.
- Modify run_all_tests.js to just do `npm run build-debug` instead of
doing both `npm run build` and `npm run build:debug`.
- Also remove the 'build:blocks' script that should have been removed
when the buildBlocks gulp task was deleted previously.
* refactor(build): Compile with base_minimal.js instead of base.js
Introduce a (very!) cut-down version of closure/goog/base.js named
base_minimal.js that is used as input to the compiler as an
alternative to using externs/goog-externs.js (which will be deleted
once the buildAdvancedCompilationTest target has been updated).
This will allow use of goog.setTestOnly since it will now exist in
compiled mode, and allows the changes made in 5b112db to filter
base.js out of the files for the first chunk to be reverted.
(It also obliges a change to the compiled-mode check in blockly.js.)
* fix(build): Fix buildAdvanceCompilationTest
- In build_tasks.js:
- Replace the old compile() function with a new one factored out of
buildCompiled().
- Update buildAdvancedCompilationTest to use the new compile()
and other helpers created in the meantime.
- Remove no-longer-used maybeAddClosureLibrary().
- Remove externs/{block,generator,goog}-externs.js, which are no longer
used by any compile pipeline.
- Update core/blockly.js to fix issue with detection of compiled mode
when using ADVANCED_OPTIMISATIONS.
- Update only other use of globalThis, in core/utils/xml.js, to
consistently treat it as a dictionary object.
- Update instructions in tests/compile/index.html.
This commit is sort-of-a-prerequisite to #5602; test:compile:advanced
was previously working but the generated `main_compresed.js` would
throw errors upon loading.
* chore: rename module Blockly.blocks.Lists to ....lists
All the other Blockly.blocks modules have lower-case names. This
one being named with an upper-case initial appears to have been a
typo on my part.
This module name is not mentioned anywhere else in the source code
(though it will be soon!) so no other files need to be edited.
Further, it does not appear anywhere in the last release (which
before PR #5696) so it is not necessary to add an entry in
renamings.js for this change.
* chore(build): Rationalise deps.js, deps.mocha.js
* Include blocks/*.js (Blockly.blocks.*) in tests/deps.js, since
these modules are used in the playground. (They are goog.provide
modules loaded via <script> tags, so their absence from deps.js
does not cause errors - but it will when they are migrated to
goog.module and must be loaded via goog.require.)
* Filter the entries in deps.mocha.js so that it includes only the
additional mocha test modules (i.e. those not mentioned in deps.js
already).
* refactor: Load blocks and generators using goog.require
* Add parameter for recording undo.
This sets up the most common default behavior, but also makes it clear
to people that it is happening, because it might not be expected.
* Add grouping of events
* Add text width caching
* Add disabling workspace resizing
* Add performance optimizations
* Respect nulls from blocks.save
* Cleanup from rebase
* PR Comments
* Cleanup from rebase
Unlike goog.provide packages, goog.module modules are loaded using
XMLHttpRequest in uncompiled mode. Because browsers treat file: URLs
as each being a separate, unique origin, this means that CORS rules
prevent goog.module modules being loaded from a file URL.
To work around this, use the http-server npm to serve the repository
root directory on localhost:8080.
Provide a script so that you can type `npm start` to start the local
http server and automatically open a browser window pointing at
tests/playground.html.
Modify the setBackgroundColour function in the playgrounds to provide
the usual lilac background on locahost URLs and a sickly green one
if using a file: URL, all of which will soon stop working.
(The background doesn't actually appear to be visible in the advanced
playground.)
* Use local node_modules files instead of unkpkg for advanced playground, get test blocks in the basic playground from npm
* Also move theme-modern
* Update package-lock