8000 fix minify jm issues by bueche · Pull Request #514 · join-monster/join-monster · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix minify jm issues #514

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

Merged
merged 2 commits into from
Mar 25, 2024
Merged

fix minify jm issues #514

merged 2 commits into from
Mar 25, 2024

Conversation

bueche
Copy link
Contributor
@bueche bueche commented Mar 25, 2024

Description

React native deployments include a process to minify the code. This causes join monster to fail: #250. There are work arounds as described in that issue. This PR fixes the issue so that the work arounds are no longer needed.

To fix the problem we replace the calls to the constructor.name with calls that leverage some utility functions provided by graphql that provide equivalent behavior but are minify safe. So for example the following

if (gqlType.constructor.name === 'GraphQLList') {

can be replace with:

if (isListType(gqlType) {

We create a utility function that handles a list of the checked types (as this is done in the code).

References

Testing

This has been tested with regression tests and in a separate repository I tested it with expo. The default expo start does not invoke minify, but expo start --no-dev --minify does. I reproduced it first, and then tested that the code works correctly using minify.

  • [x ] This change adds test coverage for new/changed/fixed functionality

Checklist

  • [x ] I have added documentation for new/changed functionality in this PR via comments and by updating the change log

@lorensr lorensr merged commit 0855cd5 into join-monster:master Mar 25, 2024
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
0