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

move to native BigInt from JSBI #721

Merged
merged 4 commits into from Sep 15, 2022

Conversation

delaneyj
Copy link
Contributor

@delaneyj delaneyj commented Sep 5, 2022

Issue #, if available:
#477

Description of changes:

  1. Removed all references to JSBI and replaced with bigint equivalent calls
  2. Moved to a es2020 target as its necessary assumption for BigInt support
  3. Ran prettier formatting on any effected file. Did not see a prettier config so assuming the defaults
  4. Organize imports on effected files to ensure ordering and removal of unused imports.
  5. 100% of tests pass locally

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

I confirm, currently BigInt->string->JSBI.BigInt is a big pain and slow

@desaikd
Copy link
Contributor

desaikd commented Sep 6, 2022

Hello delaneyj@
Thanks for your contribution! The above change for moving to BigInt is something we have been looking to make ourselves for ion-js. Although this requires a new major version bump and is a breaking change, which is why we have some due diligence to before going ahead with the merge. Also, in addition to this change we have to communicate with our existing use base to determine stock of changes that needs to be added with the new major version release.

That aside, I did look at your PR. All the changes there are mostly converting JSBI reference to BigInt and seems good. Although the GitHub Action checks are failing, would you be able to look into that?

@delaneyj
Copy link
Contributor Author

delaneyj commented Sep 6, 2022

@desaikd I was sure it would be a breaking change and need a semver bump.

The 10.x fail appears to be on a line that has nothing to do with my change.

Khushboo, 23 months ago (September 29th, 2020 12:09 PM)

Maybe moving to es2020 (BigInt support) has issues in 10.x? I checked and 10.24.1 should have it. The other 2 errors are in a python app ion-test-driver.py which I don't quite understand. If there is docs you can point me to on how to run this stuff locally I can try to work out, but npm test run locally with no problems.

@popematt
Copy link
Contributor

popematt commented Sep 8, 2022

Since this requires a major version bump, we are happy to drop support for Node 10 and 12 (both of which are unsupported), and I'm moving your PR so that it's against the v5.0.0-development branch instead of master.

ion-test-driver.py comes from amzn/ion-test-driver, which is a cross-implementation test driver to help validate that ion-js, ion-java, etc. are consistent with one another. I haven't looked too deeply, but it looks like the failed workflow (from ~2 days ago) was using python 3.10, and we only updated ion-test-driver to work with python 3.10 today. I'll re-run the workflow and see if the recent change fixes it. Either way, we (the Ion maintainers) will take responsibility for figuring it out.

@popematt popematt changed the base branch from master to v5.0.0-development September 8, 2022 04:52
@delaneyj
Copy link
Contributor Author

delaneyj commented Sep 9, 2022

Sorry, having a hard time reading that output. It appears all the tests pass but it fails. I seem warnings, but no errors.

@desaikd
Copy link
Contributor

desaikd commented Sep 9, 2022

The latest build failure might be because we didn't yet change the tsconfig.es6.json file with module pointing to es2020 and remove usage of es6.

@delaneyj
Copy link
Contributor Author

The latest build failure might be because we didn't yet change the tsconfig.es6.json file with module pointing to es2020 and remove usage of es6.

Is this something I should do or is it an internal Amazon thing?

@desaikd
Copy link
Contributor

desaikd commented Sep 13, 2022

The latest build failure might be because we didn't yet change the tsconfig.es6.json file with module pointing to es2020 and remove usage of es6.

Is this something I should do or is it an internal Amazon thing?

Oh yes, you can do it. Sorry, I just meant to say the tsconfig.es6.json might be the issue here.

@delaneyj
Copy link
Contributor Author

The latest build failure might be because we didn't yet change the tsconfig.es6.json file with module pointing to es2020 and remove usage of es6.

Is this something I should do or is it an internal Amazon thing?

Oh yes, you can do it. Sorry, I just meant to say the tsconfig.es6.json might be the issue here.

But how do I test it locally?

@desaikd
Copy link
Contributor

desaikd commented Sep 14, 2022

The latest build failure might be because we didn't yet change the tsconfig.es6.json file with module pointing to es2020 and remove usage of es6.

Is this something I should do or is it an internal Amazon thing?

Oh yes, you can do it. Sorry, I just meant to say the tsconfig.es6.json might be the issue here.

But how do I test it locally?

You can test it locally by running npm install that includes all the grunt release tasks including the build for modules.

@delaneyj
Copy link
Contributor Author

@desaikd can you run it again, hopefully those changes make the difference.

@desaikd
Copy link
Contributor

desaikd commented Sep 15, 2022

@desaikd can you run it again, hopefully those changes make the difference.

Thanks for adding the change! I just ran the workflow again.

@delaneyj
Copy link
Contributor Author

Looks like node is fine but not grokking the issues with ion-test-driver from the logs

@cheqianh
Copy link
Contributor

I've linked the test-driver issue to amazon-ion/ion-test-driver#24. Please feel free to ignore it for now.

@desaikd
Copy link
Contributor

desaikd commented Sep 15, 2022

Looks good 🚀 !
We can ignore the ion-test-driver issue for this PR as it is unrelated to your changes.
Thanks @delaneyj for making all the changes. This change should add significant performance improvement as it removes JSBI dependency. We will add the change into our v5.0.0-development branch for our next major version release.

@desaikd desaikd merged commit 6da53a2 into amazon-ion:v5.0.0-development Sep 15, 2022
@delaneyj delaneyj deleted the native-bigint branch September 16, 2022 00:48
@zslayton zslayton mentioned this pull request Nov 23, 2022
desaikd added a commit that referenced this pull request Apr 24, 2023
* Drops support for Node 10.x, 12.x and adds 18.x (#723)

* move to native `BigInt` from `JSBI` (#721)

* Updates typedoc syntax to address warnings (#733)

* updates test-driver to es2020 (#736)

* Migrate linting from TSLint to ESLint (#737)

* adds changes for resolving ion-test-driver build issue (#748)

* adds changes to allow `dom.Decimal` construction from `Number` and `String` (#746)

* updates uglify version

* adds changes for upconverting JS value for dom collections (#749)

* removes deprecated method `byteValue()` for v5.0.0 release (#750)

* modifies `Struct#elements()` to return all field values (#754)

---------

Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
Co-authored-by: Delaney <delaneygillilan@gmail.com>
Co-authored-by: Zack Slayton <zack.slayton@gmail.com>
Co-authored-by: Andrey Lipatkin <400234+Litee@users.noreply.github.com>
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.

None yet

4 participants