summaryrefslogtreecommitdiffstats
path: root/platform/javascript/SCsub
Commit message (Collapse)AuthorAgeFilesLines
* [Web] Rename JavaScript platform to Web.Fabio Alessandrelli2022-08-291-93/+0
| | | | Also rename export name from "HTML5" to "Web".
* [HTML5] Add GDNative+Threads build.Fabio Alessandrelli2022-06-141-2/+4
|
* [HTML5] Use absolute path for JS lib/pre/externs.Fabio Alessandrelli2021-11-261-3/+3
| | | | | | | | Ensure better compatibility when emcc which may run some tools from different paths (e.g. closure compiler). This fixes externs include issues with modern emcc using the closure compiler.
* [HTML5] Implement mouse/touch/key events in JS library.Fabio Alessandrelli2021-10-051-0/+1
| | | | | This makes us more independent from emscripten libraries, giving us more control on the application lifecycle.
* [HTML5] Add easy to use download API.Fabio Alessandrelli2021-05-211-2/+0
| | | | | New `JavaScript.download_buffer` method to create a prompt that let the user download a file.
* Merge pull request #48719 from Faless/js/4.x_interfacesRémi Verschelde2021-05-201-2/+2
|\ | | | | [HTML5] Implement Godot <-> JavaScript interface.
| * [HTML5] Implement Godot <-> JavaScript interface.Fabio Alessandrelli2021-05-201-2/+2
| |
* | [HTML5] Fix GDNative compilation with emcc 2.0.19+Fabio Alessandrelli2021-05-191-0/+1
|/ | | | | | Add `WARN_ON_UNDEFINED_SYMBOLS=0` for the main module (which defines `godot_js_main` as extern coming from the "side" module, i.e. the main Godot binary).
* [HTML5] Add PWA support to the editor page.Fabio Alessandrelli2021-03-081-37/+3
| | | | | | | | | | | | | | | | This allows to install it as an app, and provide offline support (after the first run). Practically, this boils down to adding a JSON file as a manifest, an offline page to be displayed when the cached files are not avaialble, and a JS file to cache resources and return them. The reason for the "first run requirements" is that some browsers, will emit an "install" by just visiting the page (to see if the JS code is compatibile), and we do not want to force casual visitors to just download the 10 MiB+ compressed editor WebAssembly file without pressing the start button. Special thanks to Hugo Locurcio (Calinou) for the initial work.
* [HTML5] Replace XMLHttpRequest with Fetch.Fabio Alessandrelli2021-03-061-1/+1
| | | | | | This has some advantages: - Streaming/chunked response support. - Broader headers support.
* Merge pull request #46446 from Faless/js/4.x_jsdocRémi Verschelde2021-02-261-1/+0
|\ | | | | [HTML5] Document Engine and EngineConfig (jsdoc).
| * [HTML5] Document Engine and EngineConfig (jsdoc).Fabio Alessandrelli2021-02-261-1/+0
| | | | | | | | | | This commit also removes the utils.js engine file, moving some of it's content to config.js and some to engine.js .
* | [HTML5] Make editor HTML build tag scons4-proof.Fabio Alessandrelli2021-02-261-1/+1
|/ | | | | | We used to have it like `$GODOT_VERSION` which caused inconsistencies between different scons versions when substituting it. It's now `@GODOT_VERSION@`, which is safe on both scons3 and scons4.
* [HTML5] Easier HTML templates, better deinit/cleanup.Fabio Alessandrelli2021-02-191-0/+1
|
* [HTML5] Better editor HTML, small refactor.Fabio Alessandrelli2021-01-251-4/+7
| | | | | Side and GDNative libraries are now added by engine.js , the dynlink pre js had been deleted.
* [HTML5] Reorganize build script.Fabio Alessandrelli2021-01-101-10/+7
| | | | | Simplify helper functions, fix env/sys_env confusion and depends for externs and pre-js.
* Add support for WebXRDavid Snopek2021-01-041-0/+10
|
* [HTML5] Add logo and favicon to editor html.Fabio Alessandrelli2020-12-091-0/+6
|
* [HTML5] Make GDNative support feature-based.Fabio Alessandrelli2020-12-051-0/+1
| | | | | This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
* [HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli2020-12-051-14/+47
| | | | Working with emscripten >= 2.0.10
* [HTML5] Libraries refactor for linting.Fabio Alessandrelli2020-11-211-11/+12
| | | | | | | | | | | | Initial work to make liniting easier. This includes: - Rename http_request.js to library_godot_http_request.js. - Rename externs.js to engine.externs.js. - New library_godot_runtime.js (GodotRuntime) wraps around emscripten functions. - Refactor of XMLHttpRequest handler in engine/preloader.js. - Few fixes to bugs spotted by early stage linting.
* [HTML5] AudioWorklet API implementation.Fabio Alessandrelli2020-11-101-1/+2
| | | | | | | | | | | | Rewrote AudioDriverJavaScript to support multiple processor nodes. The old (and deprecated) ScriptProcessorNode when threads are not available, and the new AudioWorklet API when threads are enabled. The new implementation uses two ring buffers and a shared state to communicated with the AudioWorklet thread. The audio.worklet.js JavaScript file is always added to the export template, but only really used (and downloaded) in the thread build.
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-14/+15
| | | | | | | | | The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
* [HTML5] Add JavaScriptToolsEditorPlugin.Fabio Alessandrelli2020-10-141-0/+1
| | | | | | | | | A new editor plugin, specific to HTML5, that provide some extra features needed to make the editor usable on that platform. For now, it adds a "Download project sources" option in the "Tool" menu, so the user can download the work done as a zip file (from the browser storage).
* Add JavaScript editor html file.Fabio Alessandrelli2020-10-141-1/+1
|
* [HTML5] Run Audio process in thread when availableFabio Alessandrelli2020-10-021-0/+1
| | | | | | | | | This should fix some of the audio stuttering issues when the HTML5 export is compiled with threads support. The API should be ported to AudioWorklet to (hopefully) be perfect. That though, cannot be backported to 3.2 due to extra restriction of AudioWorklet (which only runs in SecureContext, and needs a polyfill for Safari).
* Fix typos with codespellRémi Verschelde2020-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.17.1. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Fix Closure compiler build, python style.Fabio Alessandrelli2020-05-101-15/+12
| | | | Move copyToFS into utils.js library included with '--pre-js'.
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-4/+15
|
* [HTML5] Locale, input fix, context, exit.Fabio Alessandrelli2020-05-101-1/+0
| | | | | | | Add missing semicolumns in engine.js Add optional extra args to JS Engine.startGame Remove loader.js, explicit noExitRuntime. Also add onExit callback (undocumented in emscripten)
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-36/+32
| | | | | | | | | | | | | | | | | | | | | Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
* [HTML5] Refactor JS, threads support, closures.Fabio Alessandrelli2020-03-111-9/+32
| | | | | | | | | | - Refactored the Engine code, splitted across files. - Use MODULARIZE option to build emscripten code into it's own closure. - Enable lto support (saves ~2MiB in release). - Enable optional closure compiler pass for JS and generated code. - Enable optional pthreads support. - Can now build with tools=yes (not much to see yet). - Dropped some deprecated code for older toolchains.
* Move IDHandler JS module to platform from WebsockFabio Alessandrelli2019-04-121-0/+7
|
* Add responsive HTML5 export page with full-size canvas as new defaultLeon Krause2018-08-231-1/+1
|
* Small refactoring in HTML5 build scriptsLeon Krause2018-05-141-3/+3
| | | | Drop logic for non-existent 'profile' target
* Refactor JavaScript platform build scriptLeon Krause2018-03-261-26/+23
|
* Wrap Emscripten module into JS Engine singleton per SConsLeon Krause2018-01-131-6/+5
| | | | | Emscripten's meta DCE changes in 1.37.27(/28?) make it impossible to keep using --pre-js for this
* disable caching for targets using helper functionsRhody Lugo2017-11-281-1/+1
|
* Remove asm.js support from HTML5 platformLeon Krause2017-11-181-22/+6
| | | | | Since WebGL 2.0 is required, requiring WebAssembly support as well has little impact on compatibility.
* Implement HTTPClient in HTML5 platformLeon Krause2017-11-131-0/+7
| | | | | | | | | | | Limitations: - Subject to same-origin policy - No persistent connection (but simulated for compatibility) - No blocking mode - No StreamPeer access - No chunked responses - Cannot disable host verification
* Fix WebAudio and HTML5 buildLeon Krause2017-11-061-2/+1
|
* Use BoolVariable in platform-specific options.Elliott Sales de Andrade2017-09-251-1/+1
|
* HTML5 start-up overhaulLeon Krause2017-09-111-17/+16
| | | | | | | | | | | | | | | | - Implement promise-based JS interface for custom HTML page integration - Add download progress callback - Add progress bar and indeterminate spinner to default HTML page - Try downloading files multiple times when failing - Get rid of godotfs.js - Separate steps for engine initialization, game initialization and game start - Allow multiple games on one HTML page - Substitution placeholders only used in .html file - Placeholders renamed: $GODOT_BASE => $GODOT_BASENAME, $GODOT_TMEM -> $GODOT_TOTAL_MEMORY - Emscripten Module is now Engine.RuntimeEnvironment (no longer a global)
* Implement input focus behavior in HTML5L. Krause2017-07-221-1/+1
| | | | | | - Key and mouse events are only consumed if canvas is focused - NOTIFICATION_WM_MOUSE_ENTER, _MOUSE_EXIT, _FOCUS_IN and _FOCUS_OUT are emitted
* Fix zipping HTML5 templates when using implicit cacheL. Krause2017-07-171-17/+22
|
* Fix web export buildeska2017-03-101-4/+2
|
* Fix WebAssembly builds on Windowseska2017-02-211-1/+1
|
* Automatically zip web export templateseska2017-02-201-15/+26
| | | | Also fix web builds on Windows and clean up
* Relink web build when HTML shell changeseska2017-01-121-0/+1
| | | | | | | | Emscripten injects its loader script when linking, so force relinking whenever the HTML shell changes. Also remove useless FULL_ES2 flag, which should be a linker flag, but would impact performance too much.
* style: Fix PEP8 whitespace issues in Python filesRémi Verschelde2016-11-011-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with `autopep8 --select=E2,W2`, fixes: - E201 - Remove extraneous whitespace. - E202 - Remove extraneous whitespace. - E203 - Remove extraneous whitespace. - E211 - Remove extraneous whitespace. - E221 - Fix extraneous whitespace around keywords. - E222 - Fix extraneous whitespace around keywords. - E223 - Fix extraneous whitespace around keywords. - E224 - Remove extraneous whitespace around operator. - E225 - Fix missing whitespace around operator. - E226 - Fix missing whitespace around operator. - E227 - Fix missing whitespace around operator. - E228 - Fix missing whitespace around operator. - E231 - Add missing whitespace. - E231 - Fix various deprecated code (via lib2to3). - E241 - Fix extraneous whitespace around keywords. - E242 - Remove extraneous whitespace around operator. - E251 - Remove whitespace around parameter '=' sign. - E261 - Fix spacing after comment hash. - E262 - Fix spacing after comment hash. - E265 - Format block comments. - E271 - Fix extraneous whitespace around keywords. - E272 - Fix extraneous whitespace around keywords. - E273 - Fix extraneous whitespace around keywords. - E274 - Fix extraneous whitespace around keywords. - W291 - Remove trailing whitespace. - W293 - Remove trailing whitespace.