summaryrefslogtreecommitdiff
path: root/platform/javascript
AgeCommit message (Collapse)Author
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-29Fix missed renamings from empty() to is_empty()Rémi Verschelde
Those were missed in #44401 or added by later PRs.
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-16Make tool menu plugins use Callables for callbackkobewi
2020-12-12Merge pull request #44315 from madmiraal/fix-handles-baseexceptionRémi Verschelde
Don't handle BaseException in build scripts
2020-12-12Don't handle BaseException in build scriptsMarcel Admiraal
2020-12-10HTML5: Code style cleanup for export codeRémi Verschelde
2020-12-09[HTML5] Fix errors when Mic is not allowed.Fabio Alessandrelli
2020-12-09[HTML5] Improve platform buildsystem.Fabio Alessandrelli
Check emcc version requirements when building GDNative. Add more build options (sanitizers, initial memory).
2020-12-09[HTML5] Add logo and favicon to editor html.Fabio Alessandrelli
2020-12-09Merge pull request #44161 from Faless/fix/fa_buffered_removeRémi Verschelde
Remove unused FileAccessBuffered
2020-12-06Remove now unused FileAccessBuffered.Fabio Alessandrelli
2020-12-06[HTML5] Use regular unix FileAccess implementation.Fabio Alessandrelli
2020-12-05[HTML5] Make GDNative support feature-based.Fabio Alessandrelli
This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
2020-12-05[HTML5] Allow selecting the export type.Fabio Alessandrelli
Available types: - Regular - GDNative (support dynamic linking and thus GDNative WASM files) - Threads (uses WebAssembly Threads)
2020-12-05[HTML5] EditorRunNative works with GDNative.Fabio Alessandrelli
This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
2020-12-05[HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli
Working with emscripten >= 2.0.10
2020-12-04[HTML5] Add function signatures to JS libraries.Fabio Alessandrelli
2020-11-30[HTML5] Fix broken layout on load in HiDPI screensFabio Alessandrelli
This was caused by the devicePixelRatio being applied twice, once by the HTML code, once by the OS code. More specifically, OS.get_window_size() would return the canvas element size, while OS.set_window_size() would set the element size to the specified value times the devicePixelRatio. Calling OS.set_window_size(OS.get_window_size()) would reapply the devicePixelRatio every time. This commit changes the behaviour so that OS.set_window_size() do not apply the devicePixelRatio to the canvas element size, by it divides the CSS size instead.
2020-11-30[HTML5] Remove file flags from writeFile in setup.Fabio Alessandrelli
Flags where deprecated and partly in removed in emscripten 2.0.9.
2020-11-26[Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg
HarfBuzz, Graphite).
2020-11-23[HTML5] Run eslint --fix.Fabio Alessandrelli
Should I write a poem about this whole new world? ;)
2020-11-23[HTML5] Enforce JavaScript style with eslint.Fabio Alessandrelli
Applies to javascript files inside the platform library folder, the exposed Engine code, and any javascript files in modules. Files ending with ".externs.js" will be ignored, you can create a ".eslintignore" file to specify extra files to be ignored.
2020-11-21[HTML5] Libraries refactor for linting.Fabio Alessandrelli
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.
2020-11-20Export: Reorder options for consistency across platformsRémi Verschelde
2020-11-19SCons: Remove unnecessary $LINK overridesRémi Verschelde
As of SCons 4.0.1, the default value for $LINK is $SMARTLINK, which itself is a function that will use $CXX as linker for C++: https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L327-L328 https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L54-L76 So we don't need to manually specify the same value as $CXX for $LINK.
2020-11-17Add missing javascript semi-colons.Marcel Admiraal
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke
2020-11-10[HTML5] AudioWorklet API implementation.Fabio Alessandrelli
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.
2020-11-10[HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli
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).
2020-11-10[HTML5] Update syntax for lto.Fabio Alessandrelli
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-11-06[HTML5] Fix audio buffer size and latency hint.Fabio Alessandrelli
The size of the audio buffer was incorrectly doubled when creating the script processor. latencyHint is expressed in seconds, not milliseconds. Additionally, on some browsers it actually affect the performance and stability of the audio driver. For this reason it has been completely disabled (interactive) and a not has been left for future reference.
2020-10-18Refactor MethodBind to use variadic templatesreduz
Removed make_binders and the old style generated binders.
2020-10-14[HTML5] Add JavaScriptToolsEditorPlugin.Fabio Alessandrelli
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).
2020-10-14Add JavaScript editor html file.Fabio Alessandrelli
2020-10-14[HTML5] Close IDBFS database on exit.Fabio Alessandrelli
This should be made available in emscripten in a decent way. Possibly after unmount, to free the database lock and allow performing operations on it from javascript after the Emscripten Runtime has exited.
2020-10-14[HTML5] Expose request_quit via Engine class.Fabio Alessandrelli
So it can be called when closure compiler is enabled.
2020-10-14Increase HTML5 THREADPOOL size.Fabio Alessandrelli
This fixes a "random" deadlock when quitting the editor. I still haven't figure out the root cause, but having a bigger seems to greatly mitigate the issue. The new pool size (pre-allocated threads) is now 8.
2020-10-04[HTML5] Scons now expects "emcc" to be in PATH.Fabio Alessandrelli
No longer parse emscripten/emsdk config to detect emcc/node paths. Use WhereIs to find "emcc" and "node", look for "node_modules" in "emcc" path.
2020-10-02[HTML5] Run Audio process in thread when availableFabio Alessandrelli
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).
2020-10-02Add extra suffix for HTML5 thread builds.Fabio Alessandrelli
2020-10-02Add COOP/COEP headers to HTML5 "run" server.Fabio Alessandrelli
This allow the page to be considered a SecureContext if the address is localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions) enable extra features needed for the HTML5 threaded export.
2020-09-23JS synchronous start, better persistent FS sync.Fabio Alessandrelli
The engine now expects to emscripten FS to be setup and sync-ed before main is called. This is exposed via `Module["initFS"]` which also allows to setup multiple persistence paths (internal use only for now). Additionally, FS syncing is done **once** for every loop if at least one file in a persistent path was open for writing and closed, and if the FS is not syncing already. This should potentially fix issues reported by users where "autosave" would not work on the web (never calling `syncfs` because of too many writes).
2020-09-23Make canvas resize optional in HTML5.Fabio Alessandrelli
2020-09-23Better HiDPI support in HTML5.Fabio Alessandrelli
2020-09-23Window event listener do not use capture.Fabio Alessandrelli
2020-09-23Small refactor to JavaScript handlers.Fabio Alessandrelli
Crated helper class in native/utils.js. Simplify code in OS/DisplayServer.
2020-09-23Expose request_quit method to JS in HTML5 export.Fabio Alessandrelli
2020-09-18[HTML5] Add override keyword, cleanup methods.Fabio Alessandrelli