Malawi-DCCMS / weather-app

An app to show the weather.
0 stars 0 forks source link

chore(app): migrate to rnp #44

Closed danielmwakanema closed 8 months ago

danielmwakanema commented 8 months ago
havardf commented 8 months ago

@danielmwakanema The code has some links to expo still, and that results in a runtime error for me. presets: ['babel-preset-expo'] in babel.config.js.

Results in error:

error: index.js: Cannot find module 'babel-preset-expo'
Require stack:
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/config/files/plugins.js
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/config/files/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro-transform-worker/src/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/src/DeltaBundler/Worker.flow.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/src/DeltaBundler/Worker.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/node_modules/jest-worker/build/workers/processChild.js
havardf commented 8 months ago

I was also wondering why so many files change in order for including react-native-paper? Would it not be enough to update index.ts, App.tsx, package.json and add components that use react-native?

danielmwakanema commented 8 months ago

@danielmwakanema The code has some links to expo still, and that results in a runtime error for me. presets: ['babel-preset-expo'] in babel.config.js.

Results in error:

error: index.js: Cannot find module 'babel-preset-expo'
Require stack:
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/config/files/plugins.js
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/config/files/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/@babel/core/lib/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro-transform-worker/src/index.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/src/DeltaBundler/Worker.flow.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/src/DeltaBundler/Worker.js
- /Users/havardf/git/dccms/weather-app/node_modules/metro/node_modules/jest-worker/build/workers/processChild.js

Did you run npm install?

havardf commented 8 months ago

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

danielmwakanema commented 8 months ago

I was also wondering why so many files change in order for including react-native-paper? Would it not be enough to update index.ts, App.tsx, package.json and add components that use react-native?

Ideally, yes. However do note, that I also upgraded the RN version which has led to some of the other file changes.

danielmwakanema commented 8 months ago

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Sorry. I had some local changes, I assumed I had pushed. Pushing now. To my knowledge the babel-preset-expo is a babel config that allows us to use the icons from the vector icons package as shown here, https://callstack.github.io/react-native-paper/docs/guides/getting-started.

havardf commented 8 months ago

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Sorry. I had some local changes, I assumed I had pushed. Pushing now. To my knowledge the babel-preset-expo is a babel config that allows us to use the icons from the vector icons package as shown here, https://callstack.github.io/react-native-paper/docs/guides/getting-started.

I quickly read that page, and I think it says that if you created your project with expo, then you should use babel-preset-expo.

If the project is a react-native project, then you should use module:metro-react-native-babel-preset. I might be wrong though, as I read this very quickly. (in a meeting :)).

danielmwakanema commented 8 months ago

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Did you run npm install?

Yes. Actually I cloned into a fresh local dir, and ran npm install. But also, we migrated away from expo right? So as far as I understand, we should not have any dependencies on that?

Sorry. I had some local changes, I assumed I had pushed. Pushing now. To my knowledge the babel-preset-expo is a babel config that allows us to use the icons from the vector icons package as shown here, https://callstack.github.io/react-native-paper/docs/guides/getting-started.

I quickly read that page, and I think it says that if you created your project with expo, then you should use babel-preset-expo.

If the project is a react-native project, then you should use module:metro-react-native-babel-preset. I might be wrong though, as I read this very quickly. (in a meeting :)).

Ah alright. Misread it then, :). Reverting and dropping that package.