Skip to content

Conversation

D4ryl00
Copy link
Contributor

@D4ryl00 D4ryl00 commented Dec 15, 2023

This PR wants all the example apps and the Go framework to use the API in the ./api folder instead of copying the API files into their subdirectory. So if you update the API files, every app will use the latest version of them.

Fixes #103

@D4ryl00 D4ryl00 self-assigned this Dec 15, 2023
@D4ryl00 D4ryl00 marked this pull request as draft December 15, 2023 17:08
@D4ryl00 D4ryl00 changed the title chore: centralize API for React-Native apps chore: centralize API usage Dec 15, 2023
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@D4ryl00 D4ryl00 force-pushed the chore/centralize-api branch from 313e8b0 to fe43722 Compare February 22, 2024 13:57
@D4ryl00 D4ryl00 marked this pull request as ready for review February 22, 2024 13:59
@D4ryl00 D4ryl00 requested review from iuricmp and jefft0 February 22, 2024 13:59
Copy link
Contributor

@iuricmp iuricmp left a comment

Choose a reason for hiding this comment

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

I didn't run this branch, but looks good to me.

@jefft0
Copy link
Contributor

jefft0 commented Feb 22, 2024

In a fresh clone, I do make build.ios . I open and run the gnoboard Xcode project. When the app starts it prints:

iOS Bundling failed 1524ms
Unable to resolve "@bufbuild/protobuf" from "../../../api/gen/es/rpc_pb.js"

@jefft0
Copy link
Contributor

jefft0 commented Feb 22, 2024

... The same error for Android. I do make build.android. I open and run the gnoboard Android project. When the app starts it prints:

Android Bundling failed 1278ms
Unable to resolve "@bufbuild/protobuf" from "../../../api/gen/es/rpc_pb.js"

@jefft0
Copy link
Contributor

jefft0 commented Feb 22, 2024

Problem with Wails. In a fresh clone of this branch, I go to examples/wails and follow the new README (including patch files). wails dev prints:

    src/hooks/use-gno.ts(36,25): error TS2307: Cannot find module '@gno/api/gnonativetypes_pb' or its corresponding type declarations.

@jefft0
Copy link
Contributor

jefft0 commented Feb 23, 2024

Problem with new-app. In a fresh clone, I enter APP_NAME=myapp make new-app. It prints:

/Applications/Xcode.app/Contents/Developer/usr/bin/make new-react-native-app OUTPUT_DIR=/Users/jefft0/temp/gnonative/examples/react-native
creating a new gno awesome project at: /Users/jefft0/temp/gnonative/examples/react-native
cd /Users/jefft0/temp/gnonative/examples/react-native && yarn create expo gnoboard --template expo-template-blank-typescript
yarn create v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "create-expo@2.1.4" with binaries:
      - create-expo
[##] 2/2The directory gnoboard has files that might be overwritten:

  .eslintrc.json
  .prettierignore
  .prettierrc
  .storybook
  App.tsx
  Makefile
  REAME.md
  android
  app.json
  assets
  babel.config.js
  ios
  metro.config.js
  package.json
  src
  tsconfig.json
  yarn.lock

Try using a new directory name, or moving these files.

error Command failed.
Exit code: 1
Command: /Users/jefft0/.yarn/bin/create-expo
Arguments: gnoboard --template expo-template-blank-typescript
Directory: /Users/jefft0/temp/gnonative/examples/react-native
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
make[1]: *** [new-react-native-app] Error 1
make: *** [new-app] Error 2

Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@D4ryl00 D4ryl00 force-pushed the chore/centralize-api branch from 85602af to 5faead8 Compare February 27, 2024 15:45
@jefft0
Copy link
Contributor

jefft0 commented Feb 27, 2024

The problems with gnoboard mentioned above are resolved.

@jefft0
Copy link
Contributor

jefft0 commented Feb 27, 2024

The problem with make new-app for Android has been resolved. There is still a problem for iOS. I enter APP_NAME=testapp make new-app . In Xcode I open examples/react-native/testapp/ios/testapp.xcworkspace . Build gives the error:

Build input file cannot be found: '/Users/jefft0/temp/gnonative/examples/react-native/testapp/node_modules/react-native/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@jefft0
Copy link
Contributor

jefft0 commented Feb 28, 2024

The problem with make new-app with iOS is resolved.

Copy link
Contributor

@jefft0 jefft0 left a comment

Choose a reason for hiding this comment

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

Tested make new-app, the Wails example and the gnoboard example on Android and iOS simulators.

@D4ryl00 D4ryl00 merged commit 8d48ee0 into gnolang:main Feb 28, 2024
@D4ryl00 D4ryl00 deleted the chore/centralize-api branch February 28, 2024 10:48
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.

Further minor utilities for the keybase data-base

3 participants