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

Refactor to a Lerna Monorepo #101

Merged
merged 36 commits into from
Jun 4, 2020
Merged

Refactor to a Lerna Monorepo #101

merged 36 commits into from
Jun 4, 2020

Conversation

smithki
Copy link
Contributor

@smithki smithki commented Jun 2, 2020

📦 Pull Request

Following the Magic SDK integration into Redwood JS, an issue in our approach to multi-platform support (Web + React Native) became abundantly clear: TypeScript is highly limited in its flexibility with regards to global type definitions. Basically, TypeScript expects each NPM module to contain one, environment-specific package.

If a developer imports any NPM package that contains a reference to, or dependency upon some global types, those types are pulled in—regardless of the project’s requirements. This was causing a bug where React Native types would conflict with DOM types even if only the Web bundle is imported.

This issue was not commonly encountered because developers are largely making use of Webpack to bundle Magic SDK with their applications. The Redwood JS integration was the first time a developer attempted to wrap our package within another NPM module, leading to a TypeScript compiler error. At the moment, the issue is mitigated by disabling React Native typings within Magic SDK, but this is unsatisfactory in the long-term. A preferable approach is to distribute React Native-compatible code as a separate NPM package. This is a breaking change, but I think it’s worth doing to prevent future headaches.

The following packages would be published under this new monorepo architecture:

🗜 Versioning

(Check one!)

  • Patch: Bug Fix?
  • Minor: New Feature?
  • Major: Breaking Change?

✅ Fixed Issues

🚨 Test instructions

yarn build then yarn test

⚠️ Update CHANGELOG.md

  • I have updated the Upcoming Changes section of CHANGELOG.md with context related to this Pull Request.

smithki added 29 commits May 23, 2020 18:32
@smithki smithki self-assigned this Jun 2, 2020
@smithki smithki mentioned this pull request Jun 2, 2020
2 tasks
@smithki smithki merged commit 7fac78b into master Jun 4, 2020
@smithki smithki deleted the monorepo branch June 4, 2020 22:43
@smithki
Copy link
Contributor Author

smithki commented Oct 22, 2020

@smithki smithki added the released This issue/pull request has been released. label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor to a Lerna Monorepo
2 participants