GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Inline source maps by mhegazy · Pull Request #2484 · microsoft/TypeScript

Conversation

@mhegazy

@mhegazy Mohamed Hegazy (mhegazy) commented Mar 24, 2015

Copy link
Copy Markdown
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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Mar 24, 2015
@mhegazy

Mohamed Hegazy (mhegazy) commented Mar 24, 2015

Copy link
Copy Markdown
Contributor Author

Frank Wallis (@frankwallis) you might find this helpful.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frankwallis

Frank Wallis (frankwallis) commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhegazy

Mohamed Hegazy (mhegazy) commented Mar 25, 2015

Copy link
Copy Markdown
Contributor Author

Also pinging Teppei Sato (@teppeis) and Basarat Ali Syed (@basarat) for typescript-simple that can use this change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser
DanielRosenwasser reviewed Mar 25, 2015
View reviewed changes
Comment thread src/compiler/emitter.ts Outdated

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Mar 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe make this a Debug.fail

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@basarat Basarat Ali Syed (basarat) mentioned this pull request Mar 25, 2015
Update inlineSourceMaps to use code directly from ts compiler teppeis/typescript-simple#12
Closed
DanielRosenwasser
DanielRosenwasser reviewed Mar 25, 2015
View reviewed changes
Comment thread src/compiler/emitter.ts Outdated

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Mar 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Use let consistently

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@CyrusNajmabadi

Cyrus Najmabadi (CyrusNajmabadi) commented Mar 25, 2015

Copy link
Copy Markdown
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

function utf8_to_b64( str ) {
  return window.btoa(unescape(encodeURIComponent( str )));
}
or
function b64EncodeUnicode(str) {
    return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
        return String.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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhegazy

Mohamed Hegazy (mhegazy) commented Mar 25, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@teppeis Teppei Sato (teppeis) mentioned this pull request Apr 3, 2015
Support for TypeScript v1.5 teppeis/typescript-simple#4
Merged
4 of 6 tasks
Mohamed Hegazy (mhegazy) added 2 commits April 7, 2015 22:54
@mhegazy
Add convertToBase64 method
73e22ed
@mhegazy
Add inlineSourceMap option
a998abb
@mhegazy
Mohamed Hegazy (mhegazy) force-pushed the inlineSourceMaps branch from fda9974 to a998abb Compare April 8, 2015 17:57
@mhegazy

Mohamed Hegazy (mhegazy) commented Apr 8, 2015

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mohamed Hegazy (mhegazy) added 2 commits April 9, 2015 16:55
@mhegazy
Check for inlineSoruceMaps first
cacf34a
@mhegazy
Merge branch 'master' into inlineSourceMaps
f27cc70
@teppeis Teppei Sato (teppeis) mentioned this pull request Apr 16, 2015
fix(reference) support reference import lookup teppeis/typescript-simple#19
Merged
Mohamed Hegazy (mhegazy) added 2 commits April 19, 2015 13:33
@mhegazy
Merge branch 'master' into inlineSourceMaps
c940b16
@mhegazy
Add --inlineSources option
658bba9
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Apr 23, 2015
Some missing source maps variants and options in TypeScript compiler #2887
Closed
DanielRosenwasser
DanielRosenwasser reviewed Apr 23, 2015
View reviewed changes
Comment thread tests/cases/unittests/convertToBase64.ts

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Apr 23, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

:%s/correctelly/correctly/g

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vladima

Vladimir Matveev (vladima) commented Apr 25, 2015

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vladima

Vladimir Matveev (vladima) commented Apr 25, 2015

Copy link
Copy Markdown
Contributor

Can you also update transpile function to use inlineSources\inlineSourceMaps?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhegazy
Merge branch 'master' into inlineSourceMaps
32409f9
Mohamed Hegazy (mhegazy) added a commit that referenced this pull request Apr 27, 2015
@mhegazy
Merge pull request #2484 from Microsoft/inlineSourceMaps
5673660
Inline source maps
@mhegazy
Mohamed Hegazy (mhegazy) merged commit 5673660 into master Apr 27, 2015
@mhegazy
Mohamed Hegazy (mhegazy) deleted the inlineSourceMaps branch April 27, 2015 17:47
@mhegazy Mohamed Hegazy (mhegazy) mentioned this pull request Apr 27, 2015
JSPM support #2233
Closed
@teppeis

Teppei Sato (teppeis) commented Apr 29, 2015

Copy link
Copy Markdown

Mohamed Hegazy (@mhegazy) duplicated lines in wiki https://github.com/Microsoft/TypeScript/wiki/Roadmap/_compare/bfc82f102a462b485ed5fbebf04a457eb76987a7...307473332000299d8fe56b70460deca31b5e1f03#diff-0fa168c44ae96a89e7ba2d227c7c545cR44

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhegazy

Mohamed Hegazy (mhegazy) commented Apr 29, 2015

Copy link
Copy Markdown
Contributor Author

thanks Teppei Sato (@teppeis). fixed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced May 5, 2015
Expose new compiler flags in the .targets file #3034
Closed
Update tsconfig.json schema on SchemaStore for new commandline options for TypeScript 1.5 #3046
Closed
@erichillah Eric Hillah (erichillah) mentioned this pull request Sep 15, 2015
Add support for typescript 1.5 --inlineSourceMap and --inlineSources TypeStrong/tsify#75
Closed
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@mhegazy @frankwallis @CyrusNajmabadi @vladima @teppeis @DanielRosenwasser @sheetalkamat @msftclas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.