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

Initialize Package #1

Merged
merged 10 commits into from
Apr 11, 2022
Merged

Initialize Package #1

merged 10 commits into from
Apr 11, 2022

Conversation

StevenXL
Copy link
Collaborator

@StevenXL StevenXL commented Apr 8, 2022

Extract useExtraDeps from entities.

Note that the test suite for useExtraDeps has been ported over and passes.

As a further smoke test, I was able to add this package to entities via:

    "@freckle/react-hooks": "file:./../../../react-hooks",

The test suite entities/.../use-extra-deps/index.test.js passed when using import {useExtraDeps} from '@freckle/react-hooks'. I was also able to use import { type CallbackFn, type PrimitiveDep, type ExtraDeps, useExtraDeps } from '@freckle/react-hooks' in entities/.../use-async/index.js and that test suite also passed.

@restyled-io restyled-io bot mentioned this pull request Apr 8, 2022
There is a purposely malformed `package.json` file in one of the
dependencies (for testing purposes). We are using `.flowconfig` to
ignore this file. See issue:
facebook/flow#2364.
@StevenXL StevenXL force-pushed the sl/initialize-package branch from 3fa4152 to aa0fb64 Compare April 8, 2022 13:26
@restyled-io restyled-io bot mentioned this pull request Apr 8, 2022
@StevenXL StevenXL force-pushed the sl/initialize-package branch from b77f5e0 to aece6fe Compare April 8, 2022 13:32
@StevenXL StevenXL force-pushed the sl/initialize-package branch from aece6fe to 8f1c02f Compare April 8, 2022 13:35
StevenXL added 3 commits April 8, 2022 09:33
Use `flow-typed` to download the `library definitions` for the current
version of `jest`.
@@ -0,0 +1,13 @@
[ignore]
.*/node_modules/resolve/test/resolver/malformed_package_json/package.json
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StevenXL StevenXL force-pushed the sl/initialize-package branch from e9b4122 to d801d9f Compare April 8, 2022 21:58
@StevenXL StevenXL requested a review from stackptr April 8, 2022 22:00
.restyled.yaml Show resolved Hide resolved
Copy link
Member

@stackptr stackptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking on the PrimitiveDep<> type. I would rather not support opaque types, at least until it proves to be an issue.

@@ -0,0 +1,3 @@
# @freckle/react-hooks

Provides a collection of React hooks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useExtraDeps is only used internally, but I see that type CallbackFn and unCallbackFn is imported across the Freckle frontends. It's exported in this extracted module to avoid cyclical dependencies. After use-safe-callback is extracted, these should be documented

src/use-extra-deps/index.js Outdated Show resolved Hide resolved
src/use-extra-deps/index.js Outdated Show resolved Hide resolved
@StevenXL StevenXL requested a review from stackptr April 11, 2022 11:53
@StevenXL StevenXL force-pushed the sl/initialize-package branch 2 times, most recently from cd1c983 to fbaf418 Compare April 11, 2022 12:09
@StevenXL StevenXL force-pushed the sl/initialize-package branch from fbaf418 to ad2f6d5 Compare April 11, 2022 12:30
@@ -0,0 +1,9 @@
// @flow

export type { PrimitiveDep, CallbackFn, ExtraDeps } from "./use-extra-deps";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StevenXL StevenXL merged commit a9a5b60 into main Apr 11, 2022
@StevenXL StevenXL deleted the sl/initialize-package branch April 11, 2022 19:18
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