Commit Graph

35 Commits

Author SHA1 Message Date
Pierre Ossman
890cff921d Remove legacy conversion of modules
We no longer support Internet Explorer so we can now require that
browsers support modules.

Some conversion to commonjs still remains for nodejs.
2020-10-15 18:53:51 +02:00
Niko Lehto
9a31083a8a Export constants in inflate.js for easier usage 2020-02-17 11:29:41 +01:00
Niko Lehto
f52e979082 Add deflator helper class for deflating data
Wraps pako's deflate for easier usage.
2020-02-17 11:29:29 +01:00
Pierre Ossman
0dd439a874 Upgrade to latest babel
There has been a lot of renaming and restructuring in babel, so we need
to modify our code to handle the latest version. We also need to adjust
the way we build our babel worker as babel itself no longer runs in older
browsers such as Internet Explorer.
2019-11-12 14:05:55 +01:00
Pierre Ossman
4222d72bfe Regenerate module loader after tool upgrades 2019-08-19 13:32:41 +02:00
Pierre Ossman
604edf07d2 Upgrade to latest rollup 2019-08-15 15:58:09 +02:00
Pierre Ossman
ff7882c44c Remove unused import from module loader 2019-08-15 15:58:09 +02:00
Pierre Ossman
ea4065f33a Explicitly list what we want in our NPM package
Switch over to explicitly listing what we want to include, rather
than listing what we don't want to include. There is too much risk
of getting random junk from your working copy otherwise. This should
also hopefully complain if something is missing.
2019-01-11 13:39:02 +01:00
Pierre Ossman
800abf1277 Fix proper triggering of module fallback
We might be in the "interactive" readyState, which means that
DOMContentLoaded has already fired and we'll hang.
2018-07-13 15:57:24 +02:00
Pierre Ossman
d131633471 Better currentScript fallback
The previous heuristic didn't work under all circumstances, so try
something more robust.
2018-07-13 15:57:24 +02:00
Pierre Ossman
ae2e1ff7bd Move sinon to karma framework
This frees us from manual imports, and makes things less magical
as those aren't ES modules even if the code suggest that the are.
2018-07-13 15:57:24 +02:00
Juanjo Diaz
cdb860ad84 Add transpilation for IE11 and skip linux tests 2018-05-24 00:26:34 +03:00
Juanjo Diaz
9e1bd410aa Remove jshint comments 2018-01-31 07:38:29 -08:00
Pierre Ossman
50c317768e Include .js for anonymous scripts
It is required for syntax highlighting in at least Firefox' debugger.
2017-10-18 15:08:33 +02:00
Samuel Mannehed
0aaf59c2f9 Upgrade and fix sinon.js
Converted version downloaded from sinonjs.org. Fixed version that
doesn't register itself on the global object. This forces all modules to
do a proper import.
2017-09-28 14:05:20 +02:00
Pierre Ossman
edb7879927 IE compatibility fix for babel workers
IE doesn't support document.currentScript, so we need to have a fallback.
2017-07-21 15:03:52 +02:00
Pierre Ossman
858ea4a774 Avoid use of 'let' and 'const'
They are not supported on older browsers, e.g. iOS 9.
2017-06-02 15:41:37 +02:00
Pierre Ossman
493ad1a24b Avoid nested function declarations
Not supported in older browsers, e.g. iOS 9.
2017-06-02 15:19:37 +02:00
Pierre Ossman
39193b2878 Merge branch 'record' of https://github.com/CendioOssman/noVNC 2017-06-01 10:29:19 +02:00
Pierre Ossman
1433360ad9 Use one entry per file in transpile cache
This avoids any risk of the cache key and contents getting out
of sync.
2017-05-22 14:01:44 +02:00
Pierre Ossman
55d5353f90 Remove #nocache system as it is unused 2017-05-22 13:48:59 +02:00
Pierre Ossman
aadcf47d6f Handle loading web workers in any path
The URL is interpreted relative the current page, not relative
the current script. So we need to have some extra code in order to
allow the module loader to be agnostic to its path.
2017-05-19 14:39:49 +02:00
Pierre Ossman
777df7c274 Don't fail on babel cache storage errors
It is just a cache after all, so failures are not fatal. Users will get longer
load times, but at least they'll get a page.
2017-05-16 14:07:03 +02:00
Soichi Hayashi
dd44a8ead8 Fixed the issue where novnc can't be relocated 2017-04-05 16:09:50 +02:00
Pierre Ossman
f7c620d34e Generate source map for ES module loader rollup
Makes it easier to debug things as you get the original source and
proper line numbers.
2017-03-27 16:30:08 +02:00
Pierre Ossman
36efb9783c Handle uncaught WebWorker exceptions 2017-03-27 16:29:38 +02:00
Pierre Ossman
5d00fd9bf0 Try to populate error location on Promise errors 2017-03-27 16:29:38 +02:00
Pierre Ossman
999b5da753 Only use unhandledrejection fallback when needed 2017-03-27 16:29:38 +02:00
Pierre Ossman
36653517a5 Use common code to handle Promise errors 2017-03-27 16:29:38 +02:00
Solly Ross
d6c17390f0 Make vnc_playback.html functional once more
This commit makes vnc_playback.html functional once more, and completely
refactors tests/playback.js to make it usable in other scenarios.

In order for vnc_playback.js to properly load playback files now, they
must `export` their variables.
2017-03-21 17:39:07 -04:00
Solly Ross
152c399513 Vendor in an IE11 polyfill for Promises
This commit introduces a polyfill to add support for Promises in IE11.
This means IE11 can be tested without first running
`utils/as_require.js`.
2017-03-21 17:39:07 -04:00
Solly Ross
adfc9d3f54 Move error handler into separate file
This commit moves the global error handler into a separate file,
so that it can catch module loading errors.

This also adds support for properly displaying error messages with
newlines in them (since the module loader may throw those)
2017-03-21 17:39:07 -04:00
Solly Ross
399fa2ee2d Optimize ES6 Module Loader Polyfill
This commit makes the ES6 module loader polyfill use Web Workers,
so that Babel doesn't block the browser from animating.  It also
uses localStorage to cache the compiled results, only recompiling
on source changes, so it makes loading faster while developing noVNC.

This includes a vendored copy of the ES6 module loader, modified as
described above.
2017-03-21 17:39:07 -04:00
Solly Ross
dfae3209eb Update tests to work with new structure
This updates the tests to work with the new structure, and removes the
old `utils/run_from_console.js` files in favor of just using Karma
directly.  The Karma debug page now displays the normal mocha HTML, so
we can use that instead of the HTML generation functionality of the old
test runner.

Note that PhantomJS does not work at the moment (PhantomJS 1.5 should
make it possible to test on PhantomJS again).
2017-03-21 17:39:07 -04:00
Solly Ross
fba220c6fc Vendor an ES6-modules-compatible Pako
This commit vendors a converted, stripped-down version of Pako which
uses ES6 modules instead of CommonJS modules.
2017-03-01 11:21:32 -05:00