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

Support new arch #185

Merged
merged 6 commits into from
Jan 29, 2024
Merged

Support new arch #185

merged 6 commits into from
Jan 29, 2024

Conversation

janicduplessis
Copy link
Collaborator

@janicduplessis janicduplessis commented Jan 26, 2024

This updates the example app to RN 0.73 then adds support for new arch. I did a best effort at keeping backwards compat but it might introduce some issues with older RN version, could use more testing.

@janicduplessis janicduplessis force-pushed the @janic/new-arch branch 9 times, most recently from ed058ee to 8057c35 Compare January 27, 2024 18:44
@janicduplessis janicduplessis force-pushed the @janic/new-arch branch 2 times, most recently from 8c4d17c to a0b3e5d Compare January 27, 2024 19:46
@janicduplessis janicduplessis marked this pull request as ready for review January 27, 2024 20:00
Copy link
Owner

@mrousavy mrousavy left a comment

Choose a reason for hiding this comment

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

Janic this is just amazing. Only a minor nitpick, which I can fix later - otherwise this is great - I just ran it on my end and all works!

Thanks so much for this, LGTM ❤️


@objc var resizeMode: NSString {
get {
convertContentMode(resizeMode: blurhashView.contentMode)
Copy link
Owner

Choose a reason for hiding this comment

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

We could simply extend the ContentMode type to add a jsValue or stringRepresentation or something like that - but let's leave it like this for now.

Comment on lines +107 to +120
private final func convertResizeMode(resizeMode: NSString) -> ContentMode {
switch resizeMode {
case "contain":
return .scaleAspectFit
case "cover":
return .scaleAspectFill
case "stretch":
return .scaleToFill
case "center":
return .center
default:
return .scaleAspectFill
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Could also be a convenience init instead of a separate func here

@mrousavy mrousavy merged commit 13b1ba7 into mrousavy:master Jan 29, 2024
5 of 7 checks passed
@janicduplessis janicduplessis deleted the @janic/new-arch branch January 29, 2024 15: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.

None yet

2 participants