nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.5k stars 175 forks source link

Miscellaneous Questions About the Solito Stack #2

Closed corysimmons closed 2 years ago

corysimmons commented 2 years ago

I'm about to build my own product using a very similar stack to your Next/Expo one and had a couple questions if you'd be nice enough to answer them:

  1. Are you using Firebase? How has that experience been with Expo? Anything I should be careful about? Specifically I like SWR and noticed your https://github.com/nandorojo/swr-firestore repo and also noticed Expo tries to cater to the Firebase crowd with https://docs.expo.dev/guides/using-firebase/
  2. Suuuper interested to hear about this whole "using params for state management" thing you're doing. If you could point me towards any articles/videos/etc about that, or just give me a quick rundown on why you're doing that, that would be greatly appreciated.

Thank you again for all your help, transparency, and tools you're developing to make this stack an enjoyable experience!

nandorojo commented 2 years ago
  1. yes, but just for auth. on the backend we’ve used firestore for over a year, but we’re changing to a dgraph graph db (no, that’s not a typo lol). if you’re good at backend caching and stuff, firestore should be okay for most stuff. it worked well for us. but i didn’t do the backend there, my cofounder did. firebase auth is great. we use RNFB on ios and firebase JS on Web.

  2. my next.js talk (and the code on my website, linked to at the end) covers this.

talk: https://www.youtube.com/watch?v=0lnbdRweJtA resources (including useParam hook): http://fernandorojo.co/conf

corysimmons commented 2 years ago

I'm all about DGraph (graph dbs > everything). Your stack keeps getting better and better.

my next.js talk (and the code on my website, linked to at the end) covers this. I saw the talk but maybe I missed the part where you went over why you use it. https://gist.github.com/nandorojo/052887f99bb61b54845474f324aa41cc clarifies and is really interesting. I like that pattern a lot.

Alright, thank you so much for all your help!

nandorojo commented 2 years ago

I also discussed this stack in this podcast: https://reactnativeradio.com/episodes/rnr-224-react-native-web-on-nextjs-with-fernando-rojo

at minute 20:50, I go deeper into reasoning for using URLs/query parameters for our React State.

corysimmons commented 2 years ago

Very cool. Doing chores now so I'll definitely give it a listen! Thank you again.

corysimmons commented 2 years ago

@nandorojo Thoughts on using something like Turborepo with https://www.npmjs.com/package/@turborepo/adapter-expo for Solito?

nandorojo commented 2 years ago

I wouldn't use that, I think it's outdated. This is my metro file:

// Learn more https://docs.expo.io/guides/customizing-metro
/**
 * @type {import('expo/metro-config')}
 */
const { getDefaultConfig } = require('expo/metro-config')
const path = require('path')

const projectRoot = __dirname
const workspaceRoot = path.resolve(__dirname, '../..')

const config = getDefaultConfig(__dirname)

config.watchFolders = [workspaceRoot]
config.resolver.nodeModulesPath = [
  path.resolve(projectRoot, 'node_modules'),
  path.resolve(workspaceRoot, 'node_modules'),
]

config.transformer = {
  ...config.transformer,
  minifierPath: require.resolve('metro-minify-esbuild'),
  minifierConfig: {},
}

module.exports = config

I also installed metro-minify-esbuild

corysimmons commented 2 years ago

Yeah I figured it was outdated, but there are some other boilerplates like https://github.com/Enricopv/turbo-boilerplate that use Turborepo. I suppose my question is more generic: what do you think of Turborepo?

nandorojo commented 2 years ago

it seems useful, i use it for the next side. I don’t really see what value it adds for expo though. I’ve asked many times on twitter and get nothing. they don’t do remote caching for EAS, so i’m not sure what else it could do exactly, since you don’t want it for running expo start

corysimmons commented 2 years ago

image

What monorepo do you prefer [just re-read "i use it for the next side"] and what is the folder structure? Tried looking at Solito examples but it's not ready. :(

jaykay-p commented 2 years ago

@corysimmons Hey, im also trying out solito recently. I made minimal monorepo example here. Hope this helps a little!

corysimmons commented 2 years ago

@kuk941025 That's awesome! Thank you so much!

corysimmons commented 2 years ago

@nandorojo Is there any chance of getting Solito (solito/link) to work outside of Next? Specifically I would love to use it across Next, Expo, and a Preact SPA. I looked at the solito/link build and noticed it uses next/link.

nandorojo commented 2 years ago

My plan with this library is to target Next.js on the Web side. However, you could peak into the Link code and fork it for any other Web libraries too.

corysimmons commented 2 years ago

Okay thank you.