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

V3.0.0 - Big Refactor, updated libraries, project converted to typescript, Popup refactored #270

Merged
merged 18 commits into from
Mar 7, 2024

Conversation

Fabianurrutia
Copy link
Contributor

@Fabianurrutia Fabianurrutia commented Feb 13, 2024

Changes:

  • Project converted to Typescript
  • Updated tests to work correctly with typescript
  • Updated jest and lint configuration
  • Refactored the popup component separating responsibilities
  • Updated example project for working correctly with the last version of react-native-map-link
  • From the main function of index, I extracted logic to create new functions, allowing them to be tested in the future if necessary and removing direct responsibility from the parent function.

Break Changes:

  • Removed use of react-native-modal to use modal directly provided by react

@Fabianurrutia Fabianurrutia changed the title 2.11.5 - Update Libraries, and small refactor V3.0.0 - Big Refactor, updated libraries, project converted to typescript, Popup refactored Feb 13, 2024
@tschoffelen
Copy link
Owner

This is really awesome @Fabianurrutia! Thanks for doing all this work, so cool!

Give me a few more days to look into this and give it a test, and then we can get it merged next week.

@tschoffelen
Copy link
Owner

This looks great - I have one question, that I couldn't really find the answer to online: don't we need to compile the Typescript before publishing to NPM to make it work in older RN projects?

It looks like the current version of metro might support Typescript bundling of node modules out of the box, but most RN packages I could find on Github include a compilation step before publishing to NPM, I think we might need to add that as well?

@Fabianurrutia
Copy link
Contributor Author

Yes, you're correct. It's generally a good practice to compile TypeScript code before publishing to npm, especially if you want to ensure compatibility with older React Native projects or environments that might not support TypeScript natively.

I missed testing with previous versions, give me a couple of days and I'll do the update so it compiles correctly.

@Fabianurrutia
Copy link
Contributor Author

Fabianurrutia commented Feb 23, 2024

Hi @tschoffelen It took me a little while because I wanted to install semantic-release, and test a little. I leave the example of how it would be published: https://www.npmjs.com/package/react-native-map-link-test

You need to configure in the project:
secrets.CI_GITHUB_TOKEN
secrets.NPM_TOKEN

https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md

In this way, every time it is updated, the publication will be automatically made based on the commits that were made.

@tschoffelen
Copy link
Owner

Made one small change to the push workflow - going to merge this now, thanks for your amazing work on this!

@tschoffelen tschoffelen merged commit 8fb8c92 into tschoffelen:master Mar 7, 2024
2 checks passed
Copy link

github-actions bot commented Mar 7, 2024

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@andreialecu
Copy link

I noticed #282 after this update.

Also, I am wondering what the reason is for removing react-native-modal because the built-in one in RN is very barebones. It's not easily possible to set a custom backdrop color, for example.

@meteorlxy
Copy link
Contributor

meteorlxy commented Apr 11, 2024

Also, I am wondering what the reason is for removing react-native-modal because the built-in one in RN is very barebones.

Agree with that. After upgrading to v3, the popup style was broken in our project. We need to build a new popup in our side.

@tschoffelen
Copy link
Owner

Yeah, that's a fair point. We can do more to fix the default styling here.

I'm happy with the move away from the separate react-native-modal dependency though, because only a small subset of the users of this library use the popup, so I want to keep the lib as lightweight as possible.

Happy to accept styling/UX improvement PRs for the popup though!

@andreialecu
Copy link

I'm happy with the move away from the separate react-native-modal dependency though, because only a small subset of the users of this library use the popup, so I want to keep the lib as lightweight as possible.

Fwiw react-native-modal could be added as an optional peer dependency, so that users can choose whether to install it or not.

I'm not sure whether only a subset of users use the popup, though; the popup has been the main use of this library for us in several projects. As of now, we need to stick to v2.

PS: The change could've been better documented as well. We only caught this after upgrading, and we had to revert.

@meteorlxy
Copy link
Contributor

Yep. A detailed migration guide is necessary for a major version bump with such lots of breaking changes

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.

4 participants