Skip to content

Commit 4d2c899

Browse files
committed
feat: move logging to esm modules
1 parent ef68bb1 commit 4d2c899

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

gulpfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ function dist_rollup() {
319319
// I will be picked up by rollup and bundled accordingly.
320320
'components/init': 'src/components/init.js',
321321
'js/main_cordova': 'src/js/main_cordova.js',
322-
'js/utils/common': 'src/js/utils/common.js'
322+
'js/utils/common': 'src/js/utils/common.js',
323+
'js/tabs/logging': 'src/js/tabs/logging.js'
323324
},
324325
plugins: [
325326
alias({

src/js/tabs/logging.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
'use strict';
1+
import { millitime } from '../utils/common.js';
22

3-
TABS.logging = {};
4-
TABS.logging.initialize = function (callback) {
3+
const logging = {};
4+
logging.initialize = function (callback) {
55

66
if (GUI.active_tab != 'logging') {
77
GUI.active_tab = 'logging';
@@ -319,6 +319,9 @@ TABS.logging.initialize = function (callback) {
319319
}
320320
};
321321

322-
TABS.logging.cleanup = function (callback) {
322+
logging.cleanup = function (callback) {
323323
if (callback) callback();
324324
};
325+
326+
// TODO: only for transition to modules, drop this eventually
327+
window.TABS.logging = logging;

src/js/utils/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export function generateVirtualApiVersions() {
7979
}
8080
}
8181

82+
// TODO: these are temp binding while transition to module happens
8283
window.microtime = microtime;
83-
window.millitime = millitime;
8484
window.degToRad = degToRad;
8585
window.bytesToSize = bytesToSize;
8686
window.checkChromeRuntimeError = checkChromeRuntimeError;

src/main.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
<script type="text/javascript" src="./js/tabs/led_strip.js"></script>
124124
<script type="text/javascript" src="./js/tabs/sensors.js"></script>
125125
<script type="text/javascript" src="./js/tabs/cli.js"></script>
126-
<script type="text/javascript" src="./js/tabs/logging.js"></script>
126+
<!-- TODO: might be removed when everythign is in modules -->
127+
<script type="module" src="./js/tabs/logging.js"></script>
127128
<script type="text/javascript" src="./js/tabs/onboard_logging.js"></script>
128129
<script type="text/javascript" src="./js/FirmwareCache.js"></script>
129130
<script type="text/javascript" src="./js/tabs/firmware_flasher.js"></script>

0 commit comments

Comments
 (0)