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

Establish a way to test components inside the H&B app without publishing to npm #6865

Closed
2 tasks done
timwright12 opened this issue Sep 28, 2023 · 6 comments
Closed
2 tasks done
Assignees
Labels
mobile-platform work associated with building & maintaining the VA Mobile Platform

Comments

@timwright12
Copy link
Contributor

timwright12 commented Sep 28, 2023

During our first component build we had a heck of a time testing inside the app without a patch publish to npm. yarn link is supposed to work, so ideally we should be able to use that, but any way we can test inside the app is fine. This ticket is to get that working and document the process.

Starting the investigation with yarn link.

Definition of done

  • Components are testable in the VA mobile app
  • Documentation about how to do it is published
@timwright12 timwright12 added the mobile-platform work associated with building & maintaining the VA Mobile Platform label Sep 28, 2023
@timwright12 timwright12 self-assigned this Sep 28, 2023
@timwright12
Copy link
Contributor Author

Documented process should be:

in va-mobile-library/packages/components, run YARN_IGNORE_PATH=1 yarn link
in va-mobile-app/VAMobile run yarn link @department-of-veterans-affairs/mobile-components

However, the app is having trouble resolving the symlink imports

@timwright12
Copy link
Contributor Author

timwright12 commented Sep 28, 2023

Discovered that the issue here is that "The link command doesn't work because React Native packager doesn't support symlinks." (reference)

So we can't use yarn link.

There's another packager called Haul that supports it, but this would have to be installed in the app instead of the native packer, so I'm calling this one a non-starter.

Still investigating other ways

@timwright12
Copy link
Contributor Author

timwright12 commented Sep 29, 2023

I was able to get yarn link working with metro (and watch commands), but it doesn't work very well and it's really sluggish. Because of this we're just going to link to the package directly with:
"@department-of-veterans-affairs/mobile-component-library": "file:../../va-mobile-library/packages/components",

I'm going to move on to testing a CI check to make sure the app build works, we can use that as a baseline as well to make sure we're not breaking the app.

Slack update as well

@timwright12
Copy link
Contributor Author

@timwright12
Copy link
Contributor Author

PR is ready to run tests against the va-mobile-app

Should be closing this up soon with a documentation PR

@timwright12
Copy link
Contributor Author

Documentation PR: #6918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile-platform work associated with building & maintaining the VA Mobile Platform
Projects
None yet
Development

No branches or pull requests

1 participant