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

feat: enables inline sourcemaps for packages for developer experience #593

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Jul 13, 2022

Description

After an issue raised with the Create React App experience, we would like to enable enhanced sourcemaps, since we aren't including the source code in our packages

Before:

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,wCAAsB;AACtB,yCAAuB;AACvB,0CAAwB;AAMxB,SAAgB,eAAe;IAC7B,MAAM,KAAK,GACT,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW;YAC7B,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;gBAC3B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK;YACjB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK;QACnB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAEtB,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAfD,0CAeC"}

After:

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,wCAAsB;AACtB,yCAAuB;AACvB,0CAAwB;AAMxB,SAAgB,eAAe;IAC7B,MAAM,KAAK,GACT,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW;YAC7B,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;gBAC3B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK;YACjB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK;QACnB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAEtB,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAfD,0CAeC","sourcesContent":["import { GlobalInternetComputer } from '../index';\nimport { Agent } from './api';\n\nexport * from './api';\nexport * from './http';\nexport * from './proxy';\n\ndeclare const window: GlobalInternetComputer;\ndeclare const global: GlobalInternetComputer;\ndeclare const self: GlobalInternetComputer;\n\nexport function getDefaultAgent(): Agent {\n  const agent =\n    typeof window === 'undefined'\n      ? typeof global === 'undefined'\n        ? typeof self === 'undefined'\n          ? undefined\n          : self.ic.agent\n        : global.ic.agent\n      : window.ic.agent;\n\n  if (!agent) {\n    throw new Error('No Agent could be found.');\n  }\n\n  return agent;\n}\n"]}

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner July 13, 2022 18:06
@krpeacock krpeacock enabled auto-merge (squash) July 13, 2022 18:30
@krpeacock krpeacock merged commit 32027b3 into main Jul 13, 2022
@krpeacock krpeacock deleted the inline-sourcemaps branch July 13, 2022 18:36
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.

2 participants