From f77704f11cd07027fe935ccebb59b193f732a92d Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Wed, 11 Dec 2024 15:36:36 +0100 Subject: [PATCH] [FIX] runbot: export diff_match_patch Fixes the export of diff_match_patch, it previously used global export which is not supported anymore (at least not the way it was doing it before). --- runbot/static/src/js/fields/tracking_value.js | 3 ++- .../libs/diff_match_patch/diff_match_patch.js | 23 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/runbot/static/src/js/fields/tracking_value.js b/runbot/static/src/js/fields/tracking_value.js index 22f03cfa..b6403748 100644 --- a/runbot/static/src/js/fields/tracking_value.js +++ b/runbot/static/src/js/fields/tracking_value.js @@ -1,6 +1,7 @@ /** @odoo-module **/ import { patch } from "@web/core/utils/patch"; import { Message } from "@mail/core/common/message"; +import { diff_match_patch } from "@runbot/libs/diff_match_patch/diff_match_patch"; patch(Message.prototype, { setup() { @@ -76,4 +77,4 @@ patch(Message.prototype, { } return lines; }, -}); \ No newline at end of file +}); diff --git a/runbot/static/src/libs/diff_match_patch/diff_match_patch.js b/runbot/static/src/libs/diff_match_patch/diff_match_patch.js index e37eac47..0cce87f0 100644 --- a/runbot/static/src/libs/diff_match_patch/diff_match_patch.js +++ b/runbot/static/src/libs/diff_match_patch/diff_match_patch.js @@ -2226,11 +2226,18 @@ var diff_match_patch = function() { // In a browser, 'this' will be 'window'. // Users of node.js should 'require' the uncompressed version since Google's // JS compiler may break the following exports for non-browser environments. - /** @suppress {globalThis} */ - this['diff_match_patch'] = diff_match_patch; - /** @suppress {globalThis} */ - this['DIFF_DELETE'] = DIFF_DELETE; - /** @suppress {globalThis} */ - this['DIFF_INSERT'] = DIFF_INSERT; - /** @suppress {globalThis} */ - this['DIFF_EQUAL'] = DIFF_EQUAL; \ No newline at end of file + // /** @suppress {globalThis} */ + // this['diff_match_patch'] = diff_match_patch; + // /** @suppress {globalThis} */ + // this['DIFF_DELETE'] = DIFF_DELETE; + // /** @suppress {globalThis} */ + // this['DIFF_INSERT'] = DIFF_INSERT; + // /** @suppress {globalThis} */ + // this['DIFF_EQUAL'] = DIFF_EQUAL; + +export { + diff_match_patch, + DIFF_DELETE, + DIFF_INSERT, + DIFF_EQUAL +};