Skip to content

Merge upstream into soroban branch. - #590

Merged
Shaptic merged 9 commits into
sorobanfrom
soroban-bump
May 8, 2023
Merged

Shaptic merged 9 commits into
sorobanfrom
soroban-bump

Conversation

@Shaptic

@Shaptic Shaptic commented Apr 20, 2023 •

Copy link
Copy Markdown
Contributor

What

Merge released upstream changes (v9.0.0-beta.0) into the Soroban branch and drop a new release (called v9.0.0-soroban.0). Steps taken:

xdr.varOpaque(SCVAL_LIMIT)
// into
xdr.varOpaque(xdr.lookup("SCVAL_LIMIT"))
  • this was done for SCVAL_LIMIT, SCSYMBOL_LIMIT, and SC_SPEC_DOC_LIMIT
  • (this isn't done in master since next.d.ts isn't used, but it probably should be)
  • rm yarn.lock; yarn to ensure latest dep versions are locked in 🔒
  • yarn preversion to lint and test everything 👍

Why

This change+release is necessary to be able to properly overhaul and modernize stellar/js-soroban-client.

Known Limitations

@paulbellamy note that this will overwrite any other manual changes made to the generated XDR which is what I'm most concerned about getting reviewed here. I looked at the types/next.d.ts diff pretty closely (I can't avoid the linting changes for some reason 😢) and it looks okay, but have any tweaks needed to be made to e.g. work around xdrgen bugs?

Should the new version instead be v9.0.0-soroban.13, v8.2.2-soroban.13, or something else? I'm unsure about the convention here.

Shaptic and others added 6 commits April 13, 2023 12:38
# Building
Webpack 5 support is here!

 - the node package is built using Babel via `yarn build:node`
 - the browser bundle is built using Webpack via `yarn build:browser`
   * this is configured in `cfg/webpack.config.browser.js`
   * its accessible after including the script via the `StellarBase` variable
   * it adds a handful of important polyfills
   * it does linting via ESLint

# Linting
ESLint, Prettier, and DTSLint are all updated:

 - ESLint works with Babel via the `@babel/eslint-parser` in each `.eslintrc.js` file and is implicitly part of building via Webpack (see above)
 - DTSLint is part of the `@definitelytyped` project and has additional configuration implicitly as part of the `types/.eslintrc.js` file which uses `@typescript-eslint/parser`, instead
 - Prettier is configured in `cfg/prettier.config.js` (and `cfg/.prettierignore`) and runs on all files now. It's also (still) a pre-commit hook.

Just run `yarn pretty && yarn lint` to format your files and check that everything is up to par.

# Testing
**Istanbul**: Istanbul is [unmaintained](https://www.npmjs.com/package/istanbul) and superceded by the `nyc` package.

 - the `istanbul` plugin in `.babelrc` tells Babel about it
 - `cfg/.nycrc` extends a Babel-compatible configuration file ([docs](https://github.com/istanbuljs/nyc#babel-projects))
 - the `nyc` key in `package.json` configures instrumentation behavior
 - the coverage is *actually* provided by `babel-plugin-istanbul` ([docs](https://github.com/istanbuljs/babel-plugin-istanbul)), which is why `"instrument": false` in the above

**Node Testing**: Mocha (and its helper friends Sinon and Chai) has been updated.

 - the `mocha` key in `package.json` configures Mocha (replacing `mocha.opts`)
 - this does Babel transpiling and hooks in the helper script
 - code coverage is provided by `nyc` (see above)

**Browser Testing**: Karma has been updated.

 - the SauceLabs Karma configuration has been removed entirely because it wasn't being used
 - Karma has been updated with a code coverage integration with `nyc` ([docs](https://github.com/istanbuljs/babel-plugin-istanbul#karma), see above)
 - It relies on the Webpack configuration but makes some minor changes

Run `yarn test` to run both suites.

# Scripts
Development has a slightly different workflow now:

 - build+test locally with `yarn test:node`
 - this will only run node tests (which are faster/simpler)
 - you can `yarn build && yarn test:all` to get the both test suites (note that building first is *required*)
 - run `yarn preversion` when you want a thorough, clean test of the whole system in "production" mode
* Add the hacky namespace workarounds we use
* Drop overloaded Operation in next.d.ts
@Shaptic
Shaptic requested a review from paulbellamy April 20, 2023 21:39
@paulbellamy

Copy link
Copy Markdown
Contributor

This probably also needs #591 merged into it

Comment thread types/curr.d.ts Resolved
Shaptic and others added 2 commits April 21, 2023 13:12
* Add fully-qualified type (Operation is wrong)
* Add changelog & version bump
@Shaptic
Shaptic merged commit cac624f into soroban May 8, 2023
@Shaptic
Shaptic deleted the soroban-bump branch May 8, 2023 19:19
@Shaptic Shaptic changed the title Merge upstream into soroban branch and tag a new version. Merge upstream into soroban branch. May 8, 2023
@Shaptic Shaptic mentioned this pull request May 8, 2023
4 tasks done
@Malbarr0

Copy link
Copy Markdown

Stellar performance review
On sidrachain bank of kovesional

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