Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(joint-core): replace rollup buble with rollup babel #2741

Merged

Conversation

jamesgeorgewilliams
Copy link
Contributor

@jamesgeorgewilliams jamesgeorgewilliams commented Aug 20, 2024

Description

Replace rollup buble with rollup babel. Added comment about failing case.

Motivation and Context

This allows the user to write newer ES features in src code.

Notes:

  • karma and uglify dependencies were updated in order to run without errors for ES6 code.
  • utilHelpers.mjs update

As everything isn't transpiled to ES5 anymore, we had an error in the following tests:

QUnit.test('should compare sets', function(assert) {
const set1 = new Set();
const set2 = new Set();
set1.add(1);
set2.add(2);
assert.strictEqual(joint.util.isEqual(set1, set2), false);
set1.add(2);
set2.add(1);
assert.strictEqual(joint.util.isEqual(set1, set2), true);
set1.delete(1);
set1.add(1);
assert.strictEqual(joint.util.isEqual(set1, set2), true);
set2.delete(1);
assert.strictEqual(joint.util.isEqual(set1, set2), false);
set1.clear();
set2.clear();
});
QUnit.test('should compare sets with circular references', function(assert) {
const set1 = new Set;
const set2 = new Set;
set1.add(set1);
set2.add(set2);
assert.strictEqual(joint.util.isEqual(set1, set2), true);
set1.add(1);
set2.add(2);
assert.strictEqual(joint.util.isEqual(set1, set2), false);
});

The let causes a reference error in the following lines. This was working previously because it was transpiled to var. This change updates to an explicit use of var.

case mapTag:
let convert = mapToArray;
// Intentional fallthrough
// eslint-disable-next-line no-fallthrough
case setTag:
convert || (convert = setToArray);

Lodash is now using TS, but was using var in previous JS code.
https://github.com/lodash/lodash/blob/c6e281b878b315c7a10d90f9c2af4cdb112d9625/_equalByTag.js#L82

@kumilingus kumilingus merged commit ae95768 into clientIO:master Aug 26, 2024
3 checks passed
@jamesgeorgewilliams jamesgeorgewilliams deleted the remove-buble-add-babel branch August 27, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants