-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding useIsomorphicLayoutEffect hook package
- Loading branch information
1 parent
15e0974
commit 527f515
Showing
15 changed files
with
207 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@project44-manifest/use-isomorphic-layout-effect': minor | ||
--- | ||
|
||
Adding useIsomorhpicLayoutEffect hook package |
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
32 changes: 32 additions & 0 deletions
32
packages/react/hooks/use-isomorphic-layout-effect/CHANGELOG.md
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# @project44-manifest/use-controlled-state | ||
|
||
## 0.1.1 | ||
|
||
### Patch Changes | ||
|
||
- [#238](https://github.com/project44/manifest/pull/238) | ||
[`f247e35`](https://github.com/project44/manifest/commit/f247e35a3056d714d8a21ed59ece6b418266332d) | ||
Thanks [@bclark-p44](https://github.com/bclark-p44)! - Fixing issue with workspace dependency | ||
format | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- [#213](https://github.com/project44/manifest/pull/213) | ||
[`345def0`](https://github.com/project44/manifest/commit/345def02dc7f66db38fff6a8716422121c1adf92) | ||
Thanks [@bclark-p44](https://github.com/bclark-p44)! - Adding react transition package | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
[[`345def0`](https://github.com/project44/manifest/commit/345def02dc7f66db38fff6a8716422121c1adf92)]: | ||
- @project44-manifest/react-utils@0.2.4 | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- [#204](https://github.com/project44/manifest/pull/204) | ||
[`486d294`](https://github.com/project44/manifest/commit/486d29490cd30b3c2a243fe25c7222db66a1dff0) | ||
Thanks [@bclark-p44](https://github.com/bclark-p44)! - Adding useControlledState hook package |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 project44, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
associated documentation files (the "Software"), to deal in the Software without restriction, | ||
including without limitation the rights to use, copy, modify, merge, publish, distribute, | ||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial | ||
portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT | ||
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES | ||
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# @project44-react/react-use-isomorphic-layout-effect | ||
|
||
This package is part of [Manifest Design System](https://github.com/project44/manifest). Please see | ||
the repo for more details. |
3 changes: 3 additions & 0 deletions
3
packages/react/hooks/use-isomorphic-layout-effect/jest.config.js
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
preset: 'jest-preset-manifest', | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/react/hooks/use-isomorphic-layout-effect/moon.yml
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type: 'library' | ||
language: 'typescript' | ||
|
||
workspace: | ||
inheritedTasks: | ||
rename: | ||
buildPackage: 'build' | ||
|
||
tasks: | ||
build: | ||
outputs: | ||
- 'esm' | ||
- 'lib' |
55 changes: 55 additions & 0 deletions
55
packages/react/hooks/use-isomorphic-layout-effect/package.json
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "@project44-manifest/use-isomorphic-layout-effect", | ||
"version": "0.0.0", | ||
"description": "Manifest Design System react hook for a ssr safe useEffect", | ||
"license": "MIT", | ||
"author": "project44", | ||
"keywords": [ | ||
"manifest", | ||
"design", | ||
"system", | ||
"react", | ||
"hooks" | ||
], | ||
"sideEffects": false, | ||
"main": "./lib/index.js", | ||
"module": "./esm/index.js", | ||
"types": "./dts/index.d.ts", | ||
"files": [ | ||
"dts/**/*.d.ts", | ||
"esm/**/*.{js,map}", | ||
"lib/**/*.{js,map}", | ||
"src/**/*.{ts,tsx,json}" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:project-44/manifest.git", | ||
"directory": "packages/react/hookes/use-isomorphic-layout-effect" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"peerDependencies": { | ||
"react": "^17.0.0 || ^18.0.0", | ||
"react-dom": "^17.0.0 || ^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"react": "^18.1.0", | ||
"react-dom": "^18.1.0" | ||
}, | ||
"packemon": { | ||
"platform": "browser" | ||
}, | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dts/index.d.ts", | ||
"browser": { | ||
"module": "./esm/index.js", | ||
"import": "./esm/index.js", | ||
"default": "./lib/index.js" | ||
}, | ||
"default": "./lib/index.js" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useIsomorphicLayoutEffect'; |
4 changes: 4 additions & 0 deletions
4
packages/react/hooks/use-isomorphic-layout-effect/src/useIsomorphicLayoutEffect.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as React from 'react'; | ||
|
||
export const useIsomorphicLayoutEffect = | ||
typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; |
10 changes: 10 additions & 0 deletions
10
packages/react/hooks/use-isomorphic-layout-effect/tests/useIsomorphicLayoutEffect.test.tsx
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { renderHook } from '@testing-library/react'; | ||
import { useIsomorphicLayoutEffect } from '../src'; | ||
|
||
test('should execute callback', () => { | ||
const callback = jest.fn(); | ||
const { result } = renderHook(() => void useIsomorphicLayoutEffect(callback)); | ||
|
||
expect(result.current).toBeUndefined(); | ||
expect(callback).toHaveBeenCalled(); | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/react/hooks/use-isomorphic-layout-effect/tsconfig.build.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../../../tsconfig.options.json", | ||
"compilerOptions": { | ||
"outDir": "dts", | ||
"rootDir": "src" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"references": [] | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/react/hooks/use-isomorphic-layout-effect/tsconfig.json
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../../../../tsconfig.options.json", | ||
"compilerOptions": { | ||
"outDir": "../../../../.moon/cache/types/packages/react/hooks/use-isomorphic-layout-effect" | ||
}, | ||
"include": [ | ||
"src/**/*", | ||
"tests/**/*" | ||
], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.build.json" | ||
} | ||
] | ||
} |
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
527f515
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.
Successfully deployed to the following URLs:
manifest-design-system-storybook – ./
manifest-design-system-storyb-git-504a87-manifest-design-system.vercel.app
manifest-design-system-storybook-manifest-design-system.vercel.app
manifest-design-system-storybook.vercel.app
storybook.manifestdesignsystem.com