-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: remove graphql-request dependency #1597
Conversation
* docs: purge hardcoded snippets on 'using typegen' page * Update .gitignore * delete typegen files * fix formatting * update ignore files * refactor package.json * fix author Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh> * fix author Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh> * update predicate test * fix failing predicate test * Fix authors * add gasLimit * update gas limit --------- Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh> Co-authored-by: Daniel Bate <djbate23@gmail.com>
* Revert "feat: add `Predicate.getTransferTxId` helper (#1467)" This reverts commit 70233c1. * chore: add rc workflow * chore: changeset * chore: change rc workflow name * chore: fix rc version * chore: remove workflow dispatch for rc worjflow * chore: add correct rc naming * chore: use correct branch filtering * chore: linting * chore: alter branch name env * chore: change pull request to push * feat: set correct rc versiuon in worflow * feat: add echo rc verison * chore: test ci * chore: test ci * chore: echo changesets * chore: use env in rc changeset * test dan release * chore: enable pr release * chore: copy pr relase * try rc nam,e * use salamander * chore: use rc name * use: salamander * chore: test salamander * chore: fix workflow trigger * chore: remove env rc name * chore: update rc suffix --------- Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
* chore: fix string replace * chore: changeset
…1520) * docs: Updated high-level doc links in README files * docs: updating "/guide/" based doc hyperlinks * docs: update "/sway/" and "/forc/" related doc urls * docs: update "fuels-rs" doc links * docs: update quickstart doc links * docs: updated the quickstart docs link * docs: added the changeset --------- Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
* chore: pin graphql request version * chore: changeset
* Setting up * Adjusting tests from `packages/address` * Adjusting tests from `packages/abi-typegen` * Forgotten files * Adjusting scripts * Touchups * Adjusting script * Touchups * Adjusting tests for `packages/crypto` * Adjusting tests for `packages/errors` * feat: implement coverage merging, reporting. Also in test workflow with test validation * feat: migration of functionalities from vitest * feat: further config change to implement vitest * feat: some jest -> vitest syntax migration * feat: migrate jest spys to vite * feat: add todo vitest mocks * feat: upgrade lodash and ethers in hasher package * feat: install buffer for tests * feat: add vite env and browser config * chore: lint * feat: add missing test groups * feat: implement check tests module * chore: update lock file * feat: add missing test env tags * chore: regen lock file * feat: migrate jest mocks to vite in providers * feat: add ts expect error for browser test for browser apis * feat: add missing vite restore mocks to provider test * feat: replace provider mocks with vite compatible mocks * feat: reenable env specific tests * feat: enable ts dom lib * efat: remove ts expect error for browser apis * feat: fallback to first faucet for vite env * feat: move vite config files to ts * feat: polyfill node apis * feat: uninstall buffer in place of browser polyfill * feat: remove node process import from vite env * feat: remove vi import from vite env * feat: example commit with hasher hardlinked * chore: regen lock file * feat: migrate all jest mocking and fix all node tests * chore: remove redundant snapshots * feat: add ts expect error for vite mocks * feat: add node group tags to all tests * feat: symlink fuels hasher deps * chore: regen lock file * feat: fix test groups * feat: remove redundant process dep * feat: migrate to vite hooks in typegen test * feat: alter coverage reporters * feat: add missing test group * feat: reduce pnpm test commands and simplify test scripts * feat: remove browser test stage from test workflow * feat: implement browser test command * feat: alter docs that reference jest * chore: changeset * feat: fix doc snippets * feat: don't run rewrite scripts inside vitest * feat: fix doc snippet tags * feat: add missing tsdoc files * feat: remove redundant imports * chore: linting * feat: remove workflow from download artifact action in gh workflow * feat: alter test workflow * feat: add support for live node tests in vitest * feat: use different workflow download action * feat: fix check tests to find all tests * feat: migrate jest to vi in provider tests * feat: fix provider mock in provider unit test * feat: add e2e to all find tests flag * feat: remove process define in place of polyfill plugin * feat: rename tests coverage script functions * feat: fix vitest mock in mock versions test * feat: reintroduce hasher tests * feat: update test contribution docs * feat: rename coverage commands * feat: add missing test groups * chore: force rebuild * feat: add test and coverage exclusions * feat: reitroduce coverage flags * feat: add missing test group * feat: remove file from master merge * feat: use more updated lcov workflow action * chore: rebuild * feat: use old coverage report action * feat: move test CI setup to a composite action * feat: reimplement checkout to test CI * feat: add shell to test setup CI action * chore: force rebuild * feat: fix test ci * feat: create test setup action * feat: implement coverage diff script and PR comment action * feat: resolve issue in previous merge conflict * feat: add missing test envs * feat: remove temp test ci stage * feat: alter find tests script to produce new diff * feat: alter find tests script to produce new diff * feat: recreate coverage PR comment * feat: fix find test script * Adjusting new tests (merged from master) to vite * Adding missing test’s group tag * chore: regen lock file * feat: restore contents of crypto * feat: fix crypto test mocks * feat: fix shell js refactors * feat: implement filter tests command * feat: isolate browser tests * feat: migrate test validate script to sh * feat: remove browser test stages from test workflow * feat: rename gen coverage script to merge coverage * feat: rollback crypto types change * feat: fix browser types * feat: remove redundant test workflow step * chore: linting * feat: add missing crypto tsdoc file * feat: improve test ci stage names * feat: remove test that was brought in merge * feat: migrate fuels cli work to vitest * chore: linting * feat: implement test matrix to speed up builds * feat: rename test matrix stage * chore: linting * Moving fixtures around * Revamping test utilities * Updating gitignore * Re-stitching files for `build` command * Re-stitching files for `dev` command * Re-stitching core cli files * Fixing broken mocks * Refactoring all feature tests * Fixing all broken unit tests * Adding missing units * Re-enabling convenient html report generation * Re-position flag appropriately * Ensuring method interruption * Setting up cleanup hook * Removing useless method call * Lintfix * Adjusting hook timing * Adding [missing] test group tag * Adjusting mocks’ restoration * Lintfix * Fixing tsconfig * Fixing test mocks * Lintfix * Experimenting with a bigger timeout on long-running tests * Removing unused import * chore: force rebuild * feat: rename test ci stages * chore: update changeset Co-authored-by: Nedim Salkić <nedim.salkic@fuel.sh> * feat: change test workflow stage names * feat: reintroduce test step * feat: improve diff text * feat: add missing test grouops * chore: spelling * chore: fix unused imports * chore: linting * chore: upgrade vite, vitest and deps * chore: remove unused ts expect errors * test: fix import * test: update hbs assertion * test: fix forc project mocks * test: fix hbs assertion * test: fix ethers mock * test: add missing test groups * feat: ignore apps/docs in vite * chore: update lock * test: update math mock in provider test * test: fix math mock * chore: update lock * chore: rebuild * chore: update lock * chore: pin graphql request version * chore: regen lock * chore: migrate to vite mts * test: resolve fuels mocks * test: add missing group * chore: DRY build sway programs test * test: remve invalid jest calls * chore: rebuild * chore: upgrade vite deps * chore: allocate more memory to test workflow * chore: rebuild * chore: add nyc excluded * chore: increase exclusions * chore: alter merge report * chore: alter test runner * chore: add coverage includes * chore: try without max mem size in CI * chore: rebuild --------- Co-authored-by: Anderson Arboleya <anderson@arboleya.me> Co-authored-by: Daniel Bate <--global> Co-authored-by: Nedim Salkić <nedim.salkic@fuel.sh>
* chore: changeset * chore: use int array for temp stage * chore: fix conditional workflow
* chore: update node engine in create fuels * chore: changeset
I went through their source code and didn't find anything comprehensive around error handling. I only found them providing the ability to configure an error policy, which is something we don't have a need for because we want to throw all errors.
The only specific error they have is
They don't provide any comprehensive error handling because that's not their purpose as they're a general-purpose library. It is up to their consumers to do a
This library has been in the SDK's dependencies since the beginning and its only usage was for creating a proper fetch request and parsing the response correctly - something that was replaced by 21 lines of code (create a request object and send and parse the response). We don't need the ceremonies of a library to do a simple fetch, however well the library is maintained. The maintenance burden of a
IMO two-ish years of usage in the SDK that only amounted to the use case of fetching is enough to say, "We don't need this library if we can replace it with a simple fetch". Fetching has been our only need met by As far as the future goes, if the potential case arises where we need some additional functionality we can always take inspiration from them or even return to them if we see that it's too complex to maintain. As for the current situation, the size reduction and easier grokking of the whole 21-line fetching functionality compared to whatever other library that hides it internally IMO is enough to go through with this PR. |
Coverage Report:
Changed Files:
|
My two cents on this PR: If everything is working as intended like @Torres-ssf mentioned, I think we should go ahead with this PR and get it merged. I did read through the points that Sergio mentioned in his comment, too. I think the Nedim's explanation in his response is fair enough. I don't see a downgrade in terms of quality/reliability or an increase in burden maintenance-wise if we go ahead with Nedim's solution. On top of that, this PR would decrease the bundle size - which is crucial. I agree that we cannot be 100% sure that nothing will break unexpectedly, but we can be 99% sure and that's good enough. If something pops up, we can put together a quick fix or roll things back. The benefits outweigh the costs here. |
All points make sense, but I'm mainly concerned with unknown unknowns and the possible introduction of unforeseen problems, especially in preparation for the subsequent releases, as I'm not sure the risk outweighs the benefits. |
I agree with the fact that My main problem here is that right now stability should be our top priority, alongside delivering main net features. Although package size is a big consideration, I would rather deliver a stable package that we have complete confidence in than one that is leaner in size, but has unknowns. At this point in time, if something even has 1% unknowns it is worth not merging at the moment. Especially, as we already have a working solution. I'd be in favour of closing the PR. |
Closing this PR because most of the team is not in favor of it at the moment. |
This PR replaces the
graphql-request
andgraphql-tag
dependencies with a simplefetch
implementation.This change reduces the final bundle size by 15.68 kB.
Note