Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[Scopes] Tracking issue for known original scope mapping tasks #5561

Closed
38 of 59 tasks
loganfsmyth opened this issue Feb 28, 2018 · 9 comments
Closed
38 of 59 tasks

[Scopes] Tracking issue for known original scope mapping tasks #5561

loganfsmyth opened this issue Feb 28, 2018 · 9 comments
Labels

Comments

@loganfsmyth
Copy link
Contributor

loganfsmyth commented Feb 28, 2018

Not necessarily all required, but a general tracking issue for known tasks around the original scope work

Bugs

Features

  • Explore how watch expressions among other things can leverage the original scope data
  • Enable Typescript parsing via Babylon
  • Rewrite expressions in the browser console using original scope maps
    • (1/3) PR
    • (2/3) make the console use the panel helper to map
    • (3/3) Add mochitests for mapped console behavior
  • DECIDED-AGAINST: Create sourcemaps for console rewritten expressions
  • DECIDED-AGAINST: Consider making the console autocomplete take original scopes into account
  • Consider adding support for "sections" in sourcemaps
  • Handle complex expression mappings better
    • We should execute module namespace getters to show the real value. Modules generally use getters for live values, rather than side-effects, so it should be within user expectations to trigger those
    • Some module imports are mapped to function calls instead of property accesses, but we cannot currently call these functions to get their values

Documentation

UI

  • Allow users to toggle between original and generated scopes inside the Scopes pane

Typescript / Angular

Vue

EmberJS

  • Ember requires developers to opt into Babel's source-maps, but even when they do they are often ignored: PR
  • Ember appears to a have custom import logic for its own core imports, rewriting them to reference the Ember global. These currently show as (unmapped) and we should see if that is fixable PR
  • Some mappings include multiple locations, and often the simple binary search in source-map finds one that isn't ideal. We should call getAllGeneratedPositions PR

Ecosystem

  • Backport this/arguments/import/inputSourceMap Babel 7 fixes to Babel 6 Babel PR
  • Expand testcases for other bundling/sourcemap generation tooling
    • Webpack
    • Rollup
    • Parcel
    • Explore how we handle minified code
  • Explore non-Babel implementations of imports to see if mappings need improvements
  • Create more testcases around Babel's binding mappings for various complex transformations
@jasonLaster
Copy link
Contributor

jasonLaster commented Mar 20, 2018

Useful GIF

original preview

@jasonLaster
Copy link
Contributor

jasonLaster commented Mar 28, 2018

this is not mapped in perf.html TabBar#mouseDownListener

STR:

  1. clone https://github.com/devtools-html/perf.html/
  2. yarn install, yarn start
  3. go to url
  4. Add a breakpoint in tabBar.js#mouseDownListener
  5. click a tab

@jasonLaster
Copy link
Contributor

jasonLaster commented Apr 19, 2018

STR:

  1. run debugger.html
  2. navigate to localhost:8000
  3. add a breakpoint in actions/tabs.js closeTab
  4. right click on a tab in the launchpad and select close tab

Screen Shot 2018-04-19 at 8.57.50 AM.png


Note: when i paused and resumed i landed in the same spot and saw the generated bindings...

Screen Shot 2018-04-19 at 9.00.12 AM.png

@jasonLaster
Copy link
Contributor

STR:

  1. go to https://dbg-class-prop-this.glitch.me/
  2. add a breakpoint in app.jsx

@jasonLaster
Copy link
Contributor

Found a new case with nightly today.

STR:

  1. open http://localhost:8000/?react_perf&firefox-tab=child1/tab1
  2. navigate to SecondaryPanes/Breakpoint.js
  3. add a breakpoint on 41
  4. add a breakpoint in the debuggee (todomvc)

the missed bindings are: getBreakpointLocation, getBreakpointText, this corresponds with the functions defined in the module scope

Screen Shot 2018-05-10 at 3.51.07 PM.png

@jasonLaster
Copy link
Contributor

@loganfsmyth and i looked into it and it looks like it is related to the fact that a function and class are inside of a function body scope

(function() { /* outer anonymous (variable level) */
  /* lexical scope */
  "use strict";

  function getBreakpointText() {
    console.log(2)
  }

  class Breakpoint {
  }

})()

https://gist.github.com/af8e91b7c322d25b1fc122d7d65ffa6f

@loganfsmyth
Copy link
Contributor Author

Closing in favor of #6400

@digitarald
Copy link
Contributor

digitarald commented May 29, 2018

@loganfsmyth what are the minimum versions for libraries/tools (babel, ember, etc) that you fixed during this work? I want to make sure to document the work, which would help developers ensure the best debuggable output.

So far I got:

@loganfsmyth
Copy link
Contributor Author

@digitarald babel-core@^6.23.3 and @babel/core@^7.0.0-beta.47 are the first versions of their major versions to include all the fixes we've implemented thus far. A few fixes landed earlier in 7.x, but beta.47 includes the most recent fixes we make, which were for Vue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants