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(build): use *.d.mts for esm ('import' condition only) #1387

Merged
merged 3 commits into from Oct 31, 2022
Merged

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Oct 26, 2022

close #1381

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 26, 2022

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 6ff97b7:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration
Next.js Configuration

@dai-shi
Copy link
Member Author

dai-shi commented Oct 26, 2022

I wish if tsc has an option to produce esm compatible .d.mts files. 🤔

@github-actions
Copy link

github-actions bot commented Oct 26, 2022

Size Change: 0 B

Total Size: 28.4 kB

ℹ️ View Unchanged
Filename Size
dist/context.js 605 B
dist/esm/context.js 422 B
dist/esm/index.js 414 B
dist/esm/middleware.js 2.73 kB
dist/esm/middleware/immer.js 210 B
dist/esm/shallow.js 272 B
dist/esm/vanilla.js 401 B
dist/index.js 565 B
dist/middleware.js 3.19 kB
dist/middleware/immer.js 328 B
dist/shallow.js 280 B
dist/system/context.development.js 549 B
dist/system/context.production.js 365 B
dist/system/index.development.js 590 B
dist/system/index.production.js 391 B
dist/system/middleware.development.js 2.82 kB
dist/system/middleware.production.js 1.75 kB
dist/system/middleware/immer.development.js 292 B
dist/system/middleware/immer.production.js 187 B
dist/system/shallow.development.js 338 B
dist/system/shallow.production.js 253 B
dist/system/vanilla.development.js 468 B
dist/system/vanilla.production.js 290 B
dist/umd/context.development.js 734 B
dist/umd/context.production.js 533 B
dist/umd/index.development.js 718 B
dist/umd/index.production.js 526 B
dist/umd/middleware.development.js 3.31 kB
dist/umd/middleware.production.js 2.03 kB
dist/umd/middleware/immer.development.js 472 B
dist/umd/middleware/immer.production.js 337 B
dist/umd/shallow.development.js 401 B
dist/umd/shallow.production.js 308 B
dist/umd/vanilla.development.js 553 B
dist/umd/vanilla.production.js 349 B
dist/vanilla.js 434 B

compressed-size-action

@dai-shi
Copy link
Member Author

dai-shi commented Oct 26, 2022

Thanks to @Sec-ant, this should be good to go. (waiting for a confirmation with middleware.)

@Sec-ant
Copy link

Sec-ant commented Oct 26, 2022

Thanks to @Sec-ant, this should be good to go. (waiting for a confirmation with middleware.)

I tried React, subscribeWithSelector, persist and devtools and find no problems. Thank you for such quick fix. I'm impressed by your work! @dai-shi

@dai-shi
Copy link
Member Author

dai-shi commented Oct 26, 2022

@Sec-ant Thanks for your help too! We'll merge this and release it a bit later.
Meanwhile, feel free to use codesandbox build if you can.

@dai-shi dai-shi merged commit 296bb4b into main Oct 31, 2022
@dai-shi dai-shi deleted the fix/issue-1381 branch October 31, 2022 12:39
kodiakhq bot pushed a commit to mheob/ef-calc that referenced this pull request Nov 13, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^18.11.8` -> `^18.11.9`](https://renovatebot.com/diffs/npm/@types%2fnode/18.11.8/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/18.11.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/18.11.8)](https://docs.renovatebot.com/merge-confidence/) |
| [@types/react](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^18.0.24` -> `^18.0.25`](https://renovatebot.com/diffs/npm/@types%2freact/18.0.24/18.0.25) | [![age](https://badges.renovateapi.com/packages/npm/@types%2freact/18.0.25/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2freact/18.0.25/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2freact/18.0.25/compatibility-slim/18.0.24)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2freact/18.0.25/confidence-slim/18.0.24)](https://docs.renovatebot.com/merge-confidence/) |
| [eslint](https://eslint.org) ([source](https://togithub.com/eslint/eslint)) | [`^8.26.0` -> `^8.27.0`](https://renovatebot.com/diffs/npm/eslint/8.26.0/8.27.0) | [![age](https://badges.renovateapi.com/packages/npm/eslint/8.27.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/eslint/8.27.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/eslint/8.27.0/compatibility-slim/8.26.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/eslint/8.27.0/confidence-slim/8.26.0)](https://docs.renovatebot.com/merge-confidence/) |
| [vite](https://togithub.com/vitejs/vite/tree/main/#readme) ([source](https://togithub.com/vitejs/vite)) | [`^3.2.1` -> `^3.2.3`](https://renovatebot.com/diffs/npm/vite/3.2.1/3.2.3) | [![age](https://badges.renovateapi.com/packages/npm/vite/3.2.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/vite/3.2.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/vite/3.2.3/compatibility-slim/3.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/vite/3.2.3/confidence-slim/3.2.1)](https://docs.renovatebot.com/merge-confidence/) |
| [zustand](https://togithub.com/pmndrs/zustand) | [`^4.1.3` -> `^4.1.4`](https://renovatebot.com/diffs/npm/zustand/4.1.3/4.1.4) | [![age](https://badges.renovateapi.com/packages/npm/zustand/4.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/zustand/4.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/zustand/4.1.4/compatibility-slim/4.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/zustand/4.1.4/confidence-slim/4.1.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>eslint/eslint</summary>

### [`v8.27.0`](https://togithub.com/eslint/eslint/releases/tag/v8.27.0)

[Compare Source](https://togithub.com/eslint/eslint/compare/v8.26.0...v8.27.0)

#### Features

-   [`f14587c`](https://togithub.com/eslint/eslint/commit/f14587c42bb0fe6ec89529aede045a488083d6ee) feat: new `no-new-native-nonconstructor` rule ([#&#8203;16368](https://togithub.com/eslint/eslint/issues/16368)) (Sosuke Suzuki)
-   [`978799b`](https://togithub.com/eslint/eslint/commit/978799bd5c76fecf4ce8f17d89ad6c9f436c3228) feat: add new rule `no-empty-static-block` ([#&#8203;16325](https://togithub.com/eslint/eslint/issues/16325)) (Sosuke Suzuki)
-   [`69216ee`](https://togithub.com/eslint/eslint/commit/69216ee69c7172e847b64e0e934b5121a34d0ea3) feat: no-empty suggest to add comment in empty BlockStatement ([#&#8203;16470](https://togithub.com/eslint/eslint/issues/16470)) (Nitin Kumar)
-   [`319f0a5`](https://togithub.com/eslint/eslint/commit/319f0a5491598825bbd528c6d1fc12771056a74c) feat: use `context.languageOptions.ecmaVersion` in core rules ([#&#8203;16458](https://togithub.com/eslint/eslint/issues/16458)) (Milos Djermanovic)

#### Bug Fixes

-   [`c3ce521`](https://togithub.com/eslint/eslint/commit/c3ce5212f672d95dde3465d7d3c4bf99ff665f8b) fix: Ensure unmatched glob patterns throw an error ([#&#8203;16462](https://togithub.com/eslint/eslint/issues/16462)) (Nicholas C. Zakas)
-   [`886a038`](https://togithub.com/eslint/eslint/commit/886a0386897f96d2da95eba8c52bd893fcbf7e86) fix: handle files with unspecified path in `getRulesMetaForResults` ([#&#8203;16437](https://togithub.com/eslint/eslint/issues/16437)) (Francesco Trotta)

#### Documentation

-   [`ce93b42`](https://togithub.com/eslint/eslint/commit/ce93b429bf917640473dd7e26b49bba993c68ce4) docs: Stylelint property-no-unknown ([#&#8203;16497](https://togithub.com/eslint/eslint/issues/16497)) (Nick Schonning)
-   [`d2cecb4`](https://togithub.com/eslint/eslint/commit/d2cecb4ad2a6d33444cf0288a863c43acb3b468a) docs: Stylelint declaration-block-no-shorthand-property-overrides ([#&#8203;16498](https://togithub.com/eslint/eslint/issues/16498)) (Nick Schonning)
-   [`0a92805`](https://togithub.com/eslint/eslint/commit/0a92805d7713118866e519b0ff2a61c5d6238ad9) docs: stylelint color-hex-case ([#&#8203;16496](https://togithub.com/eslint/eslint/issues/16496)) (Nick Schonning)
-   [`74a5af4`](https://togithub.com/eslint/eslint/commit/74a5af487ac7296a46a8078e585f00df72b63d83) docs: fix stylelint error ([#&#8203;16491](https://togithub.com/eslint/eslint/issues/16491)) (Milos Djermanovic)
-   [`324db1a`](https://togithub.com/eslint/eslint/commit/324db1a11e43ba9d954dc522763faea19129ce6a) docs: explicit stylelint color related rules ([#&#8203;16465](https://togithub.com/eslint/eslint/issues/16465)) (Nick Schonning)
-   [`94dc4f1`](https://togithub.com/eslint/eslint/commit/94dc4f19ba49fe2358f8bcc2fc3555d222766755) docs: use Stylelint for HTML files ([#&#8203;16468](https://togithub.com/eslint/eslint/issues/16468)) (Nick Schonning)
-   [`cc6128d`](https://togithub.com/eslint/eslint/commit/cc6128db4f489c3ab80fff2f9dbeea313e72208d) docs: enable stylelint declaration-block-no-duplicate-properties ([#&#8203;16466](https://togithub.com/eslint/eslint/issues/16466)) (Nick Schonning)
-   [`d03a8bf`](https://togithub.com/eslint/eslint/commit/d03a8bf8978bd330aeb951f18cc92bf1ad24eeec) docs: Add heading to justification explanation ([#&#8203;16430](https://togithub.com/eslint/eslint/issues/16430)) (Maritaria)
-   [`8a15968`](https://togithub.com/eslint/eslint/commit/8a159686f9d497262d573dd601855ce28362199b) docs: add Stylelint configuration and cleanup ([#&#8203;16379](https://togithub.com/eslint/eslint/issues/16379)) (Nick Schonning)
-   [`9b0a469`](https://togithub.com/eslint/eslint/commit/9b0a469d1e4650c1d9da26239357e715b11b2d97) docs: note commit messages don't support scope ([#&#8203;16435](https://togithub.com/eslint/eslint/issues/16435)) (Andy Edwards)
-   [`1581405`](https://togithub.com/eslint/eslint/commit/15814057fd69319b3744bdea5db2455f85d2e74f) docs: improve context.getScope() docs ([#&#8203;16417](https://togithub.com/eslint/eslint/issues/16417)) (Ben Perlmutter)
-   [`b797149`](https://togithub.com/eslint/eslint/commit/b7971496e9b44add405ca0360294f5c3be85b540) docs: update formatters template ([#&#8203;16454](https://togithub.com/eslint/eslint/issues/16454)) (Milos Djermanovic)
-   [`5ac4de9`](https://togithub.com/eslint/eslint/commit/5ac4de911f712cb3a5a16eb7a4063eee09dfc97c) docs: fix link to formatters on the Core Concepts page ([#&#8203;16455](https://togithub.com/eslint/eslint/issues/16455)) (Vladislav)
-   [`33313ef`](https://togithub.com/eslint/eslint/commit/33313ef56258a6a96b00a3e70025b94bd2f2fe9f) docs: core-concepts: fix link to semi rule ([#&#8203;16453](https://togithub.com/eslint/eslint/issues/16453)) (coderaiser)

</details>

<details>
<summary>vitejs/vite</summary>

### [`v3.2.3`](https://togithub.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small323-2022-11-07-small)

[Compare Source](https://togithub.com/vitejs/vite/compare/v3.2.2...v3.2.3)

-   refactor: change style.innerHTML to style.textContent ([#&#8203;10801](https://togithub.com/vitejs/vite/issues/10801)) ([8ea71b4](https://togithub.com/vitejs/vite/commit/8ea71b4)), closes [#&#8203;10801](https://togithub.com/vitejs/vite/issues/10801)
-   fix: add `@types/node` as an optional peer dependency ([#&#8203;10757](https://togithub.com/vitejs/vite/issues/10757)) ([57916a4](https://togithub.com/vitejs/vite/commit/57916a4)), closes [#&#8203;10757](https://togithub.com/vitejs/vite/issues/10757)
-   fix: transform import.meta.glob when scan JS/TS [#&#8203;10634](https://togithub.com/vitejs/vite/issues/10634) ([#&#8203;10635](https://togithub.com/vitejs/vite/issues/10635)) ([c53ffec](https://togithub.com/vitejs/vite/commit/c53ffec)), closes [#&#8203;10634](https://togithub.com/vitejs/vite/issues/10634) [#&#8203;10635](https://togithub.com/vitejs/vite/issues/10635)
-   fix(css): url() with variable in sass/less (fixes [#&#8203;3644](https://togithub.com/vitejs/vite/issues/3644), [#&#8203;7651](https://togithub.com/vitejs/vite/issues/7651)) ([#&#8203;10741](https://togithub.com/vitejs/vite/issues/10741)) ([fa2e47f](https://togithub.com/vitejs/vite/commit/fa2e47f)), closes [#&#8203;3644](https://togithub.com/vitejs/vite/issues/3644) [#&#8203;7651](https://togithub.com/vitejs/vite/issues/7651) [#&#8203;10741](https://togithub.com/vitejs/vite/issues/10741)
-   feat: add `vite:afterUpdate` event ([#&#8203;9810](https://togithub.com/vitejs/vite/issues/9810)) ([1f57f84](https://togithub.com/vitejs/vite/commit/1f57f84)), closes [#&#8203;9810](https://togithub.com/vitejs/vite/issues/9810)
-   perf: improve `multilineCommentsRE` regex (fix [#&#8203;10689](https://togithub.com/vitejs/vite/issues/10689)) ([#&#8203;10751](https://togithub.com/vitejs/vite/issues/10751)) ([51ed059](https://togithub.com/vitejs/vite/commit/51ed059)), closes [#&#8203;10689](https://togithub.com/vitejs/vite/issues/10689) [#&#8203;10751](https://togithub.com/vitejs/vite/issues/10751)
-   perf: Use only one ps exec to find a Chromium browser opened on Mac OS ([#&#8203;10588](https://togithub.com/vitejs/vite/issues/10588)) ([f199e90](https://togithub.com/vitejs/vite/commit/f199e90)), closes [#&#8203;10588](https://togithub.com/vitejs/vite/issues/10588)
-   chore: fix dev build replacing undefined ([#&#8203;10740](https://togithub.com/vitejs/vite/issues/10740)) ([1358a3c](https://togithub.com/vitejs/vite/commit/1358a3c)), closes [#&#8203;10740](https://togithub.com/vitejs/vite/issues/10740)
-   chore: remove non used type definitions ([#&#8203;10738](https://togithub.com/vitejs/vite/issues/10738)) ([ee8c7a6](https://togithub.com/vitejs/vite/commit/ee8c7a6)), closes [#&#8203;10738](https://togithub.com/vitejs/vite/issues/10738)
-   chore(deps): update dependency [@&#8203;rollup/plugin-commonjs](https://togithub.com/rollup/plugin-commonjs) to v23 ([#&#8203;10611](https://togithub.com/vitejs/vite/issues/10611)) ([cc4be70](https://togithub.com/vitejs/vite/commit/cc4be70)), closes [#&#8203;10611](https://togithub.com/vitejs/vite/issues/10611)
-   chore(deps): update dependency [@&#8203;rollup/plugin-dynamic-import-vars](https://togithub.com/rollup/plugin-dynamic-import-vars) to v2 ([#&#8203;10726](https://togithub.com/vitejs/vite/issues/10726)) ([326f782](https://togithub.com/vitejs/vite/commit/326f782)), closes [#&#8203;10726](https://togithub.com/vitejs/vite/issues/10726)

### [`v3.2.2`](https://togithub.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small322-2022-10-31-small)

[Compare Source](https://togithub.com/vitejs/vite/compare/47a78db49740daee873525de90d0e44b19883771...v3.2.2)

-   chore: remove src/client from package ([#&#8203;10703](https://togithub.com/vitejs/vite/issues/10703)) ([816842e](https://togithub.com/vitejs/vite/commit/816842e)), closes [#&#8203;10703](https://togithub.com/vitejs/vite/issues/10703)
-   chore(deps): update all non-major dependencies ([#&#8203;10725](https://togithub.com/vitejs/vite/issues/10725)) ([22cfad8](https://togithub.com/vitejs/vite/commit/22cfad8)), closes [#&#8203;10725](https://togithub.com/vitejs/vite/issues/10725)
-   fix: remove loaded input sourcemap (fixes [#&#8203;8411](https://togithub.com/vitejs/vite/issues/8411)) ([#&#8203;10705](https://togithub.com/vitejs/vite/issues/10705)) ([eb50e3a](https://togithub.com/vitejs/vite/commit/eb50e3a)), closes [#&#8203;8411](https://togithub.com/vitejs/vite/issues/8411) [#&#8203;10705](https://togithub.com/vitejs/vite/issues/10705)
-   fix: tsconfig `jsx` overrides esbuild options, reverts [#&#8203;10374](https://togithub.com/vitejs/vite/issues/10374) ([#&#8203;10714](https://togithub.com/vitejs/vite/issues/10714)) ([aacf6a4](https://togithub.com/vitejs/vite/commit/aacf6a4)), closes [#&#8203;10374](https://togithub.com/vitejs/vite/issues/10374) [#&#8203;10714](https://togithub.com/vitejs/vite/issues/10714)
-   docs(changelog): fix broken url ([#&#8203;10692](https://togithub.com/vitejs/vite/issues/10692)) ([f937ccc](https://togithub.com/vitejs/vite/commit/f937ccc)), closes [#&#8203;10692](https://togithub.com/vitejs/vite/issues/10692)

</details>

<details>
<summary>pmndrs/zustand</summary>

### [`v4.1.4`](https://togithub.com/pmndrs/zustand/releases/tag/v4.1.4)

[Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.1.3...v4.1.4)

This should improve some importing problems. Uncertain if it fixes everything.

#### What's Changed

-   fix(build): use \*.d.mts for esm ('import' condition only) by [@&#8203;dai-shi](https://togithub.com/dai-shi) in [pmndrs/zustand#1387
-   fix(build): no import.meta for "module" condition by [@&#8203;dai-shi](https://togithub.com/dai-shi) in [pmndrs/zustand#1393

#### New Contributors

-   [@&#8203;guenyoo](https://togithub.com/guenyoo) made their first contribution in [pmndrs/zustand#1388

**Full Changelog**: pmndrs/zustand@v4.1.3...v4.1.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Wednesday" in timezone Europe/Berlin, Automerge - 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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/mheob/ef-calc).
@dai-shi dai-shi added this to the v4.1.4 milestone Dec 5, 2022
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.

TSC throws an error when compiling with "moduleResolution": "NodeNext"
2 participants