★ wanayoo — archive 1999 https://github.com/firefox-devtools/debugger/issues/3583Nouvelle recherche | Portail wanayoo
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

[CallStack] Frames filenames include `?:` #3583

Closed
jasonLaster opened this issue Aug 7, 2017 · 13 comments
Closed

[CallStack] Frames filenames include `?:` #3583

jasonLaster opened this issue Aug 7, 2017 · 13 comments

Comments

@jasonLaster
Copy link
Contributor

@jasonLaster jasonLaster commented Aug 7, 2017 •

It would be nice to exclude the special characters like ? or : that generally have special meaning after the file extension.

redux.png

diff --git a/src/components/SecondaryPanes/Frames/Frame.js b/src/components/SecondaryPanes/Frames/Frame.js
index cf03086..598f08e 100644
--- a/src/components/SecondaryPanes/Frames/Frame.js
+++ b/src/components/SecondaryPanes/Frames/Frame.js
@@ -4,6 +4,8 @@ import classNames from "classnames";
 import Svg from "../../shared/Svg";

 import { formatDisplayName } from "../../../utils/frame";
+
+// => here
 import { getFilename } from "../../../utils/source";
 import FrameMenu from "./FrameMenu";

diff --git a/src/utils/tests/source.js b/src/utils/tests/source.js
index e68bef0..59c1de1 100644
--- a/src/utils/tests/source.js
+++ b/src/utils/tests/source.js
@@ -1,6 +1,7 @@
 import { getFilename, getMode, getSourceLineCount } from "../source.js";

 describe("sources", () => {
+  // we've got tests
   describe("getFilename", () => {
     it("should give us a default of (index)", () => {
       expect(
       ```
@sharathnarayanph
Copy link
Contributor

@sharathnarayanph sharathnarayanph commented Aug 11, 2017

I'd like to take this up.

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Aug 11, 2017

Sorry, I believe Anna is on it

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Sep 27, 2017

we can't reproduce it

@jasonLaster jasonLaster reopened this Sep 27, 2017
@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Sep 27, 2017

Here's an STR:

  1. go to https://www.piskelapp.com/
  2. navigate to piskel-animated-preview.js
  3. add a breakpoint on line 39 in startAnimationTimer
@Fischer-L
Copy link
Contributor

@Fischer-L Fischer-L commented Sep 27, 2017

Saw the issue. Would like to take this bug.

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Sep 27, 2017

@Fischer-L it's yours!

@Fischer-L
Copy link
Contributor

@Fischer-L Fischer-L commented Sep 28, 2017

For the "?" found in #3583 (comment), it turns out that that is what exactly the source map provides. Log the returned sources for search by searchResult in SourceSearch.js [1], could get the source item of "piskel-animated-preview.js?20170502"[2]. In fact, that filename is given by the website on purpose (seems that is timestamp) [3]. However, in the left source list, it seems stripping out the "?20170502" [4].

@jasonLaster
For developers of that website, seeing "?20170502" in the search results or breakpoint probably would make more sense to them. As for the source list case, not really a problem, maybe acceptable (Chrome respects the website, displaying "?20170502" in all cases).
I would suggest this is not really an issue. How do you think?

[1] https://github.com/devtools-html/debugger.html/blob/b581b67336508b80a0af75eea8f2fc0503c84a4c/src/components/ProjectSearch/SourceSearch.js#L23

[2] { value: "/static/js/piskel-animated-preview.js?20170502", title: "piskel-animated-preview.js?20170502", subtitle: "/static/js/piskel-animated-preview.js?20170502", id: "server1.conn12.child2/source29" }

[3]
screen shot 2017-09-28 at 10 10 15 pm

[4]
screen shot 2017-09-28 at 10 12 21 pm

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Sep 28, 2017

Thanks @Fischer-L. Lets see how the Tree strips away the ?.... and apply that to Tabs, search results, and the call stack.

My guess is that it's in here:

https://github.com/abhinav-koppula/debugger.html/blob/issue-4043/src/utils/sources-tree/getURL.js#L27-L31

we'll likely want to re-use the same helper function in all the places...

@Fischer-L
Copy link
Contributor

@Fischer-L Fischer-L commented Oct 1, 2017

I am not sure we should really strip off the strings behind "?". The string behind "?" is query string which is also a part of URL. Theoretically we could have "account.js?student" and "account.js?teacher", which have different content. Another thing about this is that if I put a timestamp behind my script filename for some purpose, I would feel a bit uncertain when debugging without seeing the timestamp.

p.s looks like there are some people appending query string to js files for some reason: [1][2]
[1] https://stackoverflow.com/questions/41487313/create-script-tag-with-query-string
[2] https://stackoverflow.com/questions/4716612/how-do-i-get-query-string-value-from-script-path

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Oct 2, 2017

@Fischer-L that's a good point, in practice I've found that it is helpful to shorten the URL in horizontally limited areas and provide the context in other ways, like on hover w/ the tab.

In this case, I think it would be nice to strip it out because for the most part, the important detail is the filename. We can then work on providing the information in other ways

@jasonLaster
Copy link
Contributor Author

@jasonLaster jasonLaster commented Oct 27, 2017 •

ping @Fischer-L

@Fischer-L
Copy link
Contributor

@Fischer-L Fischer-L commented Oct 29, 2017

in practice I've found that it is helpful to shorten the URL in horizontally limited areas and provide the context in other ways, like on hover w/ the tab.

@jasonLaster right, in the call stack panel the space is limited and function name probably is the main focus during stepping between codes. Will update.

@Fischer-L
Copy link
Contributor

@Fischer-L Fischer-L commented Oct 30, 2017

@jasonLaster Please see PR #4535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants