Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inline source maps#2484

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mhegazy merged 7 commits intomasterfrominlineSourceMaps
Apr 27, 2015
Merged

Inline source maps#2484

mhegazy merged 7 commits intomasterfrominlineSourceMaps
Apr 27, 2015

Conversation

@mhegazy
Copy link
Contributor

Support for inline source maps. As referenced in#2233, this change allows us to emit single file with source maps instead of having a separate file.

@mhegazy
Copy link
ContributorAuthor

@frankwallis you might find this helpful.

@frankwallis
Copy link
Contributor

thanks!

@mhegazy
Copy link
ContributorAuthor

Also pinging@teppeis and@basarat for typescript-simple that can use this change.

Choose a reason for hiding this comment

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

Maybe make this aDebug.fail

Choose a reason for hiding this comment

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

Uselet consistently

@CyrusNajmabadi
Copy link
Contributor

Is the algorithm provided basically saying:

  1. We have a string.
  2. We want to consider the UTF8 encoding of that string.
  3. We want to take that encoding and convert it to Base64?

If so, i would personally prefer breaking out the two parts of this process. The UTF8 encoding, and the Base64 conversion.

Note: MDN already covers a good way to do this:
https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/btoa#Unicode_Strings

functionutf8_to_b64(str){returnwindow.btoa(unescape(encodeURIComponent(str)));}orfunctionb64EncodeUnicode(str){returnbtoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,function(match,p1){returnString.fromCharCode('0x'+p1);}));}

Now, if we don't have access to these functions in Node or Chakra, we could still do the above steps, just individually. i.e. break up a string into utf8 bytes. Then convert those bytes to Base64. I think this would be far easier to understand (and verify).

@mhegazy
Copy link
ContributorAuthor

mm. let me try this out then. i remember there was a reason why i did not do that :)

@mhegazy
Copy link
ContributorAuthor

So btoa is not available on node, and escape is not available on chakra :), so there is not an easy way to use these. I did split them into two functions, and added unit tests as well.

I have also handled --inlineSourceMap to be a parallel to --sourceMap instead of a dependent.

The reason covertToBase64 is in utilities is to allow for targeted unit tests. I have limited compiler baselines to limt the noise in .js files as the map is actually included in the .js file.

Choose a reason for hiding this comment

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

:%s/correctelly/correctly/g

@vladima
Copy link
Contributor

LGTM

@vladima
Copy link
Contributor

Can you also updatetranspile function to useinlineSources\inlineSourceMaps?

mhegazy added a commit that referenced this pull requestApr 27, 2015
@mhegazymhegazy merged commit5673660 intomasterApr 27, 2015
@mhegazymhegazy deleted the inlineSourceMaps branchApril 27, 2015 17:47
@mhegazymhegazy mentioned this pull requestApr 27, 2015
@mhegazy
Copy link
ContributorAuthor

thanks@teppeis. fixed

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@mhegazy@frankwallis@CyrusNajmabadi@vladima@teppeis@DanielRosenwasser@sheetalkamat@msftclas

[8]ページ先頭

©2009-2025 Movatter.jp