-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v5] breaking: drop default exports (#2238)
* fix: drop default exports for v5 * chore: remove default from cjs build * refactor: export shallow in v5 * fix: remove `addModuleExport` option for cjs.
- Loading branch information
Showing
7 changed files
with
6 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './vanilla.ts' | ||
export * from './react.ts' | ||
export { default } from './react.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
import { shallow } from './vanilla/shallow.ts' | ||
|
||
// We will export this in v5 and remove default export | ||
// export { shallow } from './vanilla/shallow.ts' | ||
// export { useShallow } from './react/shallow.ts' | ||
|
||
/** | ||
* @deprecated Use `import { shallow } from 'zustand/shallow'` | ||
*/ | ||
export default ((objA, objB) => { | ||
if (import.meta.env?.MODE !== 'production') { | ||
console.warn( | ||
"[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`.", | ||
) | ||
} | ||
return shallow(objA, objB) | ||
}) as typeof shallow | ||
|
||
export { shallow } | ||
export { shallow } from './vanilla/shallow.ts' | ||
export { useShallow } from './react/shallow.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters