-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package JS API to be an ES6 module (#2733)
Both dh-core and dh-internal here have been changed, through the use of a custom GWT linker. Also updates html samples and web-client-ui to use the new module packaging. Note that the web-client-ui build is an alpha release, but will switch to a stable release soon. --------- Fixes #2735 Co-authored-by: Colin Alworth <colinalworth@deephaven.io>
- Loading branch information
Showing
28 changed files
with
250 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
web/client-api/src/main/java/io/deephaven/web/DeephavenJsApiLinkerTemplate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function bindTo(target, source) { | ||
var descriptors = Object.getOwnPropertyDescriptors(source); | ||
for (var key in descriptors) { | ||
if (!(key[0].toUpperCase() === key[0])) { | ||
var descriptor = descriptors[key]; | ||
if (typeof (descriptor.value) === 'function') { | ||
descriptor.value = descriptor.value.bind(source) | ||
} else if (typeof (descriptor.get) === 'function') { | ||
descriptor.get = descriptor.get.bind(source); | ||
} | ||
} | ||
} | ||
Object.defineProperties(target, descriptors); | ||
} | ||
|
||
var Scope = function () { | ||
}; | ||
Scope.prototype = self; | ||
var $doc, $entry, $moduleName, $moduleBase; | ||
var $wnd = new Scope(); | ||
bindTo($wnd, self); | ||
var dh = {} | ||
$wnd.dh = dh; | ||
import {dhinternal} from './dh-internal.js'; | ||
$wnd.dhinternal = dhinternal; | ||
var $gwt_version = "__GWT_VERSION__"; | ||
__JAVASCRIPT_RESULT__ | ||
gwtOnLoad(null, '__MODULE_NAME__', null); | ||
export default dh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.