Skip to content

Conversation

@zpao
Copy link
Member

@zpao zpao commented Jul 9, 2014

Fixes #1725

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this sentence.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firefox has problems when the sourcemap source is a proper URL with a protocol and hostname, so just use the path.

I'm assuming you meant the next one.

Things seem to work fine if we just use filename.js instead of path/to/filename.js, but ...

So given http://hostname:port/path/to/filename.js, we have to strip it down to path/to/filename.js at least. We could strip it all the way to filename.js, which also works (and is what I originally tested). The potential downside (I didn't back this up with a test) is that there may be path/to/filename.js and otherpath/to/filename.js on the same page and I thought perhaps the devtools would get confused mapping them back from the sourcemap if we just used filename.js

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things seem to work fine if we just use filename.js instead of path/to/filename.js

This sounds to me like "I want to use just filename.js but I can't". I guess it seems obvious enough to me that having the path is better if it works – will anyone see .pathname.substr(1) and ask, "why isn't that just the filename?"? At any rate, maybe:

We could use just the filename, but hopefully using the full path will prevent potential issues where the same filename exists in multiple directories.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take your rephrase.

zpao added a commit that referenced this pull request Jul 9, 2014
Fix sourcemaps in JSXTransformer for Firefox
@zpao zpao merged commit 61d4954 into facebook:master Jul 9, 2014
@zpao zpao deleted the jsxtransformer-sourcemaps branch October 30, 2014 01:11
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.

Investigate Firefox Sourcemap issues

2 participants