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

chore: Bump dependencies + update example setup #1164

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

krizzu
Copy link
Member

@krizzu krizzu commented Dec 1, 2024

Summary

For each storage (default and sqlite), I'm "detaching" example RN app from the actual library implementation, by moving examples to be their own workspace. This makes it less noisy in terms of config files and what's actually is a part of lib or not.

Additionally, I bumped dependencies to almost latest. Tested most of it myself, to confirm it works, but had some issues with macOS RNCore dependency - will investigate it in a while. @tido64 could I ask you to check out the Windows example, if it works? 🙏

Copy link

changeset-bot bot commented Dec 1, 2024

⚠️ No Changeset found

Latest commit: b4fabf6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@krizzu krizzu force-pushed the chore/deps-and-examples branch 2 times, most recently from b2e7ed4 to 8ebe385 Compare December 2, 2024 11:09
@krizzu krizzu force-pushed the chore/deps-and-examples branch from 8ebe385 to 3b78ef5 Compare December 2, 2024 11:11
@krizzu krizzu force-pushed the chore/deps-and-examples branch from 807e315 to 7ca39b1 Compare January 1, 2025 20:05
@krizzu krizzu marked this pull request as ready for review January 2, 2025 18:45
@krizzu krizzu requested a review from tido64 as a code owner January 2, 2025 18:45
@krizzu
Copy link
Member Author

krizzu commented Jan 6, 2025

@tido64 test are passing now, ready for review 🙏

Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

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

Should we move the example apps out of package folders entirely?

packages/default-storage/react-native.config.js Outdated Show resolved Hide resolved
packages/sqlite-storage/example/package.json Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@krizzu
Copy link
Member Author

krizzu commented Jan 14, 2025

@tido64 I don't mind moving examples out, but feels like they are good where they are now

@krizzu krizzu force-pushed the chore/deps-and-examples branch from a8491ff to b4fabf6 Compare January 14, 2025 08:28
Comment on lines +1 to +18
const path = require("path");
const { getDefaultConfig } = require("@react-native/metro-config");
const { getConfig } = require("react-native-builder-bob/metro-config");
const pkg = require("../package.json");

const root = path.resolve(__dirname, "..");

/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
module.exports = getConfig(getDefaultConfig(__dirname), {
root,
pkg,
project: __dirname,
});
Copy link
Member

Choose a reason for hiding this comment

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

We should keep the contents of the previous file:

Suggested change
const path = require("path");
const { getDefaultConfig } = require("@react-native/metro-config");
const { getConfig } = require("react-native-builder-bob/metro-config");
const pkg = require("../package.json");
const root = path.resolve(__dirname, "..");
/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
module.exports = getConfig(getDefaultConfig(__dirname), {
root,
pkg,
project: __dirname,
});
const { makeMetroConfig } = require("@rnx-kit/metro-config");
const path = require("node:path");
module.exports = makeMetroConfig({
projectRoot: path.join(__dirname, "example"),
watchFolders: [__dirname],
resolver: {
extraNodeModules: {
"@react-native-async-storage/async-storage": __dirname,
},
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
});

This will ensure RN works in future versions as well.

}
],
"resources": {
"android": ["index.android.jsbundle"],
"ios": ["index.ios.jsbundle"],
"macos": ["index.macos.jsbundle"]
"macos": ["index.macos.jsbundle"],
"windows": ["main.windows.bundle"]
Copy link
Member

Choose a reason for hiding this comment

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

Is this right? Why is it the only platform using main.*?

@@ -23,6 +23,7 @@
"Evan Bacon <[email protected]> (https://github.com/evanbacon)",
"Tommy Nguyen <[email protected]> (https://github.com/tido64)"
],
"source": "src/index",
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, which tool is using this field?

Copy link
Member

Choose a reason for hiding this comment

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

We should copy from the other metro.config.js.

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