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

PKG -- [fcl-core] split fcl to fcl-core, fcl, and fcl-react-native #1809

Merged
merged 41 commits into from
Dec 6, 2023

Conversation

nialexsan
Copy link
Contributor

@nialexsan nialexsan commented Nov 15, 2023

@onflow/fcl-core - shared code
@onflow/fcl - fcl for web
@onflow/fcl-react-native - fcl for react native

Copy link

changeset-bot bot commented Nov 15, 2023

🦋 Changeset detected

Latest commit: f2e1cff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@onflow/transport-grpc Patch
@onflow/fcl-core Minor
@onflow/sdk Patch
@onflow/fcl-react-native Minor
@onflow/fcl Minor
@onflow/util-encode-key Patch
@onflow/transport-http Patch
@onflow/util-invariant Patch
@onflow/util-template Patch
@onflow/util-address Patch
@onflow/util-logger Patch
@onflow/fcl-bundle Patch
@onflow/util-actor Patch
@onflow/typedefs Patch
@onflow/util-uid Patch
@onflow/config Patch
@onflow/fcl-wc Major
@onflow/types Patch
@onflow/rlp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nialexsan nialexsan marked this pull request as ready for review November 16, 2023 21:39
@nialexsan nialexsan requested a review from a team as a code owner November 16, 2023 21:39
@@ -1,10 +1,9 @@
export * from "./shared-exports"
export * from "@onflow/fcl-core"
Copy link
Contributor

@jribbink jribbink Nov 30, 2023

Choose a reason for hiding this comment

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

Can we namespace the exports from FCL core? i.e. separate the ones that are supposed to be exported/"shared exports" between both packages & the ones that are only used internally.

That way way we avoid external consumers coupling with FCL internals (otherwise some exports like getMutate, etc. will be exported from @onflow/fcl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point!

},
"dependencies": {
"@babel/runtime": "^7.18.6",
"@onflow/fcl-core": "^1.8.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

imo we should lock this dependency (i.e. "1.8.1"). I have the feeling we're going to have a difficult time following semver with this package since this is was previously functionality internal to FCL (@onflow/fcl-react-native will probably end up tightly coupled/reliant on an exact version of @onflow/fcl-core).

Also if it's not locked we risk users encountering different "FCL" behaviour in the same version of FCL. This is honestly a problem with all of our packages and I wonder if we should enforce this requirement across the board (but this is a different discussion maybe).

"start": "fcl-bundle --watch",
"lint": "eslint ."
},
"dependencies": {
"@babel/runtime": "^7.18.6",
"@onflow/fcl-core": "^1.8.1",
Copy link
Contributor

@jribbink jribbink Nov 30, 2023

Choose a reason for hiding this comment

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

same comment about versioning/locking dependencies

@nialexsan nialexsan requested a review from jribbink December 1, 2023 15:59
@nialexsan nialexsan changed the title Nialexsan/fcl core web react native PKG -- [fcl-core] split fcl to fcl-core, fcl, and fcl-react-native Dec 1, 2023
Copy link
Contributor

@jribbink jribbink left a comment

Choose a reason for hiding this comment

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

LGTM. I think as long as @onflow/fcl is still working we're good here. I left a couple other comments as some ideas we can follow up on but I don't think it's important for this PR and we can merge this so that we don't start getting more merge conflicts.

Awesome stuff :)

@@ -1,6 +1,6 @@
import * as Linking from "expo-linking"
import {AppState} from "react-native"
import {URL} from "../url"
import {URL} from "@onflow/fcl-core"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think our URL patch might be able to be replaced by adding react-native-url-polyfill as a dependency in fcl-react-native now that we made the split actually. But not a big deal, we can follow this stuff up with another PR with the rest of the react native changes imo

Comment on lines +65 to +71
"peerDependencies": {
"@react-native-async-storage/async-storage": "^1.13.0",
"expo-linking": "^4.0.0",
"expo-web-browser": "^12.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-native": "^0.0.0-0 || 0.60 - 0.72 || 1000.0.0"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When we make follow up changes to fcl-react-native we can try to clean up these peer dependencies & see which ones we can transition to regular dependencies.

@nialexsan nialexsan merged commit 852b081 into master Dec 6, 2023
1 check passed
@nialexsan nialexsan deleted the nialexsan/fcl-core-web-react-native branch December 6, 2023 17:32
nialexsan added a commit that referenced this pull request Dec 6, 2023
nialexsan added a commit that referenced this pull request Dec 6, 2023
nialexsan added a commit that referenced this pull request Dec 6, 2023
@nialexsan nialexsan restored the nialexsan/fcl-core-web-react-native branch December 6, 2023 17:37
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