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

fix(sdk): incomplete bundle for web #400

Merged
merged 31 commits into from
Jun 6, 2022
Merged

Conversation

markin-io
Copy link
Contributor

@markin-io markin-io commented May 23, 2022

Issue being fixed or feature implemented

The fix enables zero-config SDK builds for browser-based apps. This change is needed because configuring webpack at the end-user side became non-trivial, and for certain environments (such as Create React App) it's not possible without ejecting/rewiring configuration which leads to poor developer experience and makes CRA upgrades more complicated.

Issues considered relevant

What was done?

  • Reworked SDK build command

  • Introduced browser entry into package.json to use minified webpack bundle instead of a TS build
    This change makes platform-test-suite to use SDK umd build in karma instead of bundling a TS build, hence providing equal to WebApp conditions

  • Exposed DPP primitives and Node.JS essentials via SDK API

  • Refactored platform-test-suite to use bundled primitives and essential Platform functions exposed from the dash package

    import { PrivateKey } from '@dashevo/dashcore-lib'
    import { Core } from 'dash'
     
    Core.PrivateKey !== PrivateKey // returns 'true'
    
  • Updated relevant tutorials in dashplatform.readme.io to use Buffer from the dash package instead of Buffer from the global scope

import { Essentials: { Buffer } } from 'dash'

How Has This Been Tested?

  • CI
  • Tested manually by using dash in Create React App

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@markin-io markin-io changed the title fix(sdk): bundle for web fix(js-dash-sdk): bundle for web May 23, 2022
@markin-io markin-io changed the title fix(js-dash-sdk): bundle for web fix(sdk): bundle for web May 23, 2022
@lgtm-com
Copy link

lgtm-com bot commented May 31, 2022

This pull request introduces 1 alert when merging c8c6225 into 328554f - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@markin-io markin-io added this to the v0.23.0 milestone May 31, 2022
@lgtm-com
Copy link

lgtm-com bot commented May 31, 2022

This pull request introduces 1 alert when merging 195f015 into 328554f - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@lgtm-com
Copy link

lgtm-com bot commented May 31, 2022

This pull request introduces 1 alert when merging 2e4e203 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2022

This pull request introduces 1 alert when merging 9f7f1e6 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2022

This pull request introduces 1 alert when merging bb5fe18 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2022

This pull request introduces 1 alert when merging 9f8d3f7 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@markin-io markin-io marked this pull request as ready for review June 2, 2022 07:43
@markin-io markin-io requested review from Alex-Werner and pshenmic and removed request for antouhou June 2, 2022 07:43
pshenmic
pshenmic previously approved these changes Jun 3, 2022
Copy link
Collaborator

@pshenmic pshenmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

@lgtm-com
Copy link

lgtm-com bot commented Jun 6, 2022

This pull request introduces 1 alert when merging 92c32c2 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@lgtm-com
Copy link

lgtm-com bot commented Jun 6, 2022

This pull request introduces 1 alert when merging 1a12098 into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

@shumkov shumkov changed the title fix(sdk): bundle for web fix(sdk): incomplete bundle for web Jun 6, 2022
packages/js-dpp/lib/index.js Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jun 6, 2022

This pull request introduces 1 alert when merging ef4d5be into 66bfd20 - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

Copy link
Member

@shumkov shumkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! 👍

@markin-io markin-io merged commit afc5300 into master Jun 6, 2022
@markin-io markin-io deleted the fix/bundle-sdk-for-web branch June 6, 2022 16:12
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.

3 participants