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

Migrate diff-sequences to Typescript #7820

Merged
merged 3 commits into from Feb 6, 2019

Conversation

@lorenzorapetti
Copy link
Contributor

lorenzorapetti commented Feb 6, 2019

Summary

Diff in built code:

diff --git a/packages/diff-sequences/build/index.js b/packages/diff-sequences/build/index.js
index a85f0a1ed..7c696426a 100644
--- a/packages/diff-sequences/build/index.js
+++ b/packages/diff-sequences/build/index.js
@@ -11,7 +11,6 @@ exports.default = void 0;
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
  *
- *
  */
 // This diff-sequences package implements the linear space variation in
 // An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers
@@ -603,13 +602,33 @@ const findSubsequences = (
     if (transposed && callbacks.length === 1) {
       // Lazily wrap callback functions to swap args if graph is transposed.
       const _callbacks$ = callbacks[0],
-        _foundSubsequence = _callbacks$.foundSubsequence,
-        _isCommon = _callbacks$.isCommon;
+        foundSubsequence = _callbacks$.foundSubsequence,
+        isCommon = _callbacks$.isCommon;
       callbacks[1] = {
-        foundSubsequence: (nCommon, bCommon, aCommon) => {
-          _foundSubsequence(nCommon, aCommon, bCommon);
-        },
-        isCommon: (bIndex, aIndex) => _isCommon(aIndex, bIndex)
+        foundSubsequence: (function(_foundSubsequence) {
+          function foundSubsequence(_x, _x2, _x3) {
+            return _foundSubsequence.apply(this, arguments);
+          }
+
+          foundSubsequence.toString = function() {
+            return _foundSubsequence.toString();
+          };
+
+          return foundSubsequence;
+        })((nCommon, bCommon, aCommon) => {
+          foundSubsequence(nCommon, aCommon, bCommon);
+        }),
+        isCommon: (function(_isCommon) {
+          function isCommon(_x4, _x5) {
+            return _isCommon.apply(this, arguments);
+          }
+
+          isCommon.toString = function() {
+            return _isCommon.toString();
+          };
+
+          return isCommon;
+        })((bIndex, aIndex) => isCommon(aIndex, bIndex))
       };
     }

Test plan

Green CI

@lorenzorapetti lorenzorapetti force-pushed the lorenzorapetti:diff-sequences-typescript branch from f6d27ad to 673d053 Feb 6, 2019
@SimenB SimenB requested a review from pedrottimark Feb 6, 2019
@SimenB SimenB added this to the TypeScript Migration milestone Feb 6, 2019
@SimenB
SimenB approved these changes Feb 6, 2019
Copy link
Collaborator

SimenB left a comment

Thank you!

@thymikee

This comment has been minimized.

Copy link
Collaborator

thymikee commented Feb 6, 2019

Interesting how complicated the build got compared to the baseline

@SimenB SimenB merged commit e8f5d62 into facebook:master Feb 6, 2019
10 of 12 checks passed
10 of 12 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
facebook.jest in progress
Details
ci/circleci: lint-and-typecheck Your tests passed on CircleCI!
Details
ci/circleci: test-browser Your tests passed on CircleCI!
Details
ci/circleci: test-jest-circus Your tests passed on CircleCI!
Details
ci/circleci: test-node-10 Your tests passed on CircleCI!
Details
ci/circleci: test-node-11 Your tests passed on CircleCI!
Details
ci/circleci: test-node-6 Your tests passed on CircleCI!
Details
ci/circleci: test-node-8 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@SimenB

This comment has been minimized.

Copy link
Collaborator

SimenB commented Feb 6, 2019

Yeah, seems like it wants to make sure this stays correct in the new version? Not sure why

@lorenzorapetti lorenzorapetti deleted the lorenzorapetti:diff-sequences-typescript branch Feb 6, 2019
SerhiiBilyk added a commit to SerhiiBilyk/jest that referenced this pull request Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.