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

Conflicting Var-Recorder and the Live-Programming plugin #372

Open
onsetsu opened this issue Jan 23, 2019 · 1 comment
Open

Conflicting Var-Recorder and the Live-Programming plugin #372

onsetsu opened this issue Jan 23, 2019 · 1 comment

Comments

@onsetsu
Copy link
Contributor

onsetsu commented Jan 23, 2019

Error

Printing the following code in a Workspace results in unexpected behavior:

var array = [1,2,3]
debugger
array = []
debugger
array

The above code, executed in one go, evaluates to [1, 2, 3]. However it should evaluate to an empty array.

Executing the code line-by-line results in the expected bahavior.

Possible Explanation

The issue may result from the interaction of two babel plugins, the Var-Recorder and the Live-Programming plugin, inside a workspace.

(function(System, SystemJS) {System.register([], function (_export, _context) {
  "use strict";

  return {
    setters: [],
    execute: function () {
      var __global_this__ = window.__pluginDoitThisRefs__["efafc263-5f9e-447b-aa34-68ee3ed50caf/"];
      var array = [1, 2, 3];
      _recorder_.undefined.array = array;
      debugger;
      _recorder_.undefined.array = [];
      debugger;
      const __result__ = array;

      _export("__result__", __result__);
    }
  };
});
})(System, System);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndvcmtzcGFjZWpzOmVmYWZjMjYzLTVmOWUtNDQ3Yi1hYTM0LTY4ZWUzZWQ1MGNhZi9saXZlbHkta2VybmVsLm9yZy9saXZlbHk0L2FleHByL3VubmFtZWRfbW9kdWxlXzQxNWEyZjFiXzhmYjhfNDhjZF9hNmFkXzdlYmQ5ZTgxZjhjMiJdLCJuYW1lcyI6WyJhcnJheSJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBLFVBQUlBLFFBQVEsQ0FBQyxDQUFELEVBQUcsQ0FBSCxFQUFLLENBQUwsQ0FBWjs7QUFDQTtBQUNBLG1DQUFRLEVBQVI7QUFDQTt5QkFDQUEsSyIsImZpbGUiOiJ1bm5hbWVkX21vZHVsZV80MTVhMmYxYl84ZmI4XzQ4Y2RfYTZhZF83ZWJkOWU4MWY4YzIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYXJyYXkgPSBbMSwyLDNdXG5kZWJ1Z2dlclxuYXJyYXkgPSBbXVxuZGVidWdnZXJcbmFycmF5XG4iXX0=

Executing both plugins leads the Live-Programming plugin to not use the rewritten value, but its original un-proxied reference.

Also notice the undefined module name resulting from evaluating the script inside a workspace. I did not yet checked for similar behavior inside a named js-module.

Possible Solutions

Rewriting both aspects in one go might remove this issue.
If not, the Live-Programming plugin should be applied only after the Var-Recorder.

Similar Issues

#257

@JensLincke
Copy link
Contributor

still an issue
image

@JensLincke JensLincke added this to TODO in Lively4 Sep 12, 2019
@JensLincke JensLincke moved this from TODO to Hard / Important in Lively4 Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Lively4
  
Hard / Important
Development

No branches or pull requests

2 participants