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

fix: point sourceMappingURL to correct sourcemaps in build artifacts #1459

Merged
merged 2 commits into from
Sep 3, 2021

Conversation

jawadsh123
Copy link
Contributor

Fixes #1154

looks like all our sourceMaps have been referring to non-existing module.ts and module.js.map since the esbuild migration
Thanks to @many20 for his analysis here

diff in dist after this change

Common subdirectories: dist-1/entities and dist-2/entities
Common subdirectories: dist-1/query and dist-2/query
diff '--exclude=*.map' dist-1/redux-toolkit.cjs.development.js dist-2/redux-toolkit.cjs.development.js
1374c1374
< //# sourceMappingURL=module.js.map
\ No newline at end of file
---
> //# sourceMappingURL=redux-toolkit.cjs.development.js.map
\ No newline at end of file
diff '--exclude=*.map' dist-1/redux-toolkit.esm.js dist-2/redux-toolkit.esm.js
1315c1315
< //# sourceMappingURL=module.js.map
\ No newline at end of file
---
> //# sourceMappingURL=redux-toolkit.esm.js.map
\ No newline at end of file
diff '--exclude=*.map' dist-1/redux-toolkit.modern.development.js dist-2/redux-toolkit.modern.development.js
1148c1148
< //# sourceMappingURL=module.js.map
\ No newline at end of file
---
> //# sourceMappingURL=redux-toolkit.modern.development.js.map
\ No newline at end of file
diff '--exclude=*.map' dist-1/redux-toolkit.modern.js dist-2/redux-toolkit.modern.js
1148c1148
< //# sourceMappingURL=module.js.map
\ No newline at end of file
---
> //# sourceMappingURL=redux-toolkit.modern.js.map
\ No newline at end of file

@netlify
Copy link

netlify bot commented Aug 31, 2021

✔️ Deploy Preview for redux-starter-kit-docs ready!

🔨 Explore the source changes: f09c978

🔍 Inspect the deploy log: https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6131e46b0835a90007f7ebe2

😎 Browse the preview: https://deploy-preview-1459--redux-starter-kit-docs.netlify.app

@phryneas
Copy link
Member

I also solved this over in eb06822 (#1277) (unmerged, part of #1277) and it seems that it needs a few more changes. Can you confirm that?

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 31, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f09c978:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration

@jawadsh123
Copy link
Contributor Author

ohh yes, totally missed the minified bundles 🤦
should I update this PR or we close this and wait for the other one to merge?

@phryneas
Copy link
Member

Hm. Good question. I'd say add the other changes over here, in that case we have the option of another patch release if it should come to that.

@jawadsh123
Copy link
Contributor Author

jawadsh123 commented Sep 7, 2021

@phryneas was away for a bit, thanks for pulling those changes here 🙇

just a heads up, a conflict got merged with this, two different fileName

const result = ts.transpileModule(removeInlineSourceMap(origin), {
fileName: chunk.path.replace(/.js$/, '.ts'),
compilerOptions: {
sourceMap: true,
module:
format !== 'cjs' ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS,
target: esVersion,
},
fileName: chunk.path
})

@phryneas
Copy link
Member

phryneas commented Sep 8, 2021

Great observation, thanks! I fixed it directly on master.

@phryneas phryneas added this to the 1.6.2 milestone Sep 17, 2021
bors bot pushed a commit to ttbud/ttbud that referenced this pull request Oct 6, 2021
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@reduxjs/toolkit](https://redux-toolkit.js.org) ([source](https://togithub.com/reduxjs/redux-toolkit)) | [`1.6.1` -> `1.6.2`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/1.6.1/1.6.2) | [![age](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/compatibility-slim/1.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/confidence-slim/1.6.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>reduxjs/redux-toolkit</summary>

### [`v1.6.2`](https://togithub.com/reduxjs/redux-toolkit/releases/v1.6.2)

[Compare Source](https://togithub.com/reduxjs/redux-toolkit/compare/v1.6.1...v1.6.2)

This release fixes several small issues with RTK Query, as well as a regression in the `createAsyncThunk` types and an issue with sourcemap URLs.

#### Changelog

##### RTK Query Fixes

The `isLoading` flag should only ever be `true` on the first run of a hook, but would sometimes briefly flip to `true` on later calls. That should now stay the correct value.

`fetchBaseQuery` should now work properly when used in conjunction with `node-fetch`.

The `BaseQueryApi` object now correctly includes the `extra` argument that was provided when configuring the thunk middleware, if any.

##### Other Fixes

Sourcemap URLs should now be correct, especially for the CommonJS build artifacts.

`createAsyncThunk`'s types have been updated to correctly infer return values when working with enums.

Lots of assorted docs tweaks and updates!

#### What's Changed

-   Add extra to BaseQueryApi by [@&#8203;ricksanchez](https://togithub.com/ricksanchez) in [reduxjs/redux-toolkit#1378
-   fix: point sourceMappingURL to correct sourcemaps in build artifacts by [@&#8203;jawadsh123](https://togithub.com/jawadsh123) in [reduxjs/redux-toolkit#1459
-   fix: `createAsyncThunk` union return values fall back to allowing only single member by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1449
-   fix `fetchBaseQuery` for usage with `node-fetch` by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1473
-   fix "isLoading briefly flips back to `true`" [#&#8203;1519](https://togithub.com/reduxjs/redux-toolkit/issues/1519) by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1520

**Full Changelog**: reduxjs/redux-toolkit@v1.6.1...v1.6.2

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/ttbud/ttbud).
bors bot pushed a commit to ttbud/ttbud that referenced this pull request Oct 6, 2021
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@reduxjs/toolkit](https://redux-toolkit.js.org) ([source](https://togithub.com/reduxjs/redux-toolkit)) | [`1.6.1` -> `1.6.2`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/1.6.1/1.6.2) | [![age](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/compatibility-slim/1.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.6.2/confidence-slim/1.6.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>reduxjs/redux-toolkit</summary>

### [`v1.6.2`](https://togithub.com/reduxjs/redux-toolkit/releases/v1.6.2)

[Compare Source](https://togithub.com/reduxjs/redux-toolkit/compare/v1.6.1...v1.6.2)

This release fixes several small issues with RTK Query, as well as a regression in the `createAsyncThunk` types and an issue with sourcemap URLs.

#### Changelog

##### RTK Query Fixes

The `isLoading` flag should only ever be `true` on the first run of a hook, but would sometimes briefly flip to `true` on later calls. That should now stay the correct value.

`fetchBaseQuery` should now work properly when used in conjunction with `node-fetch`.

The `BaseQueryApi` object now correctly includes the `extra` argument that was provided when configuring the thunk middleware, if any.

##### Other Fixes

Sourcemap URLs should now be correct, especially for the CommonJS build artifacts.

`createAsyncThunk`'s types have been updated to correctly infer return values when working with enums.

Lots of assorted docs tweaks and updates!

#### What's Changed

-   Add extra to BaseQueryApi by [@&#8203;ricksanchez](https://togithub.com/ricksanchez) in [reduxjs/redux-toolkit#1378
-   fix: point sourceMappingURL to correct sourcemaps in build artifacts by [@&#8203;jawadsh123](https://togithub.com/jawadsh123) in [reduxjs/redux-toolkit#1459
-   fix: `createAsyncThunk` union return values fall back to allowing only single member by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1449
-   fix `fetchBaseQuery` for usage with `node-fetch` by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1473
-   fix "isLoading briefly flips back to `true`" [#&#8203;1519](https://togithub.com/reduxjs/redux-toolkit/issues/1519) by [@&#8203;phryneas](https://togithub.com/phryneas) in [reduxjs/redux-toolkit#1520

**Full Changelog**: reduxjs/redux-toolkit@v1.6.1...v1.6.2

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/ttbud/ttbud).
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.

Failed to parse source map (v1.6.0)
2 participants