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

[ECO-4204] Remove code that's supporting older platforms (in v2) #1629

Merged
merged 38 commits into from
Feb 28, 2024

Conversation

VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Feb 21, 2024

Resolves #1538 , resolves #1332

See commit messages for more details.

@github-actions github-actions bot temporarily deployed to staging/pull/1629/features February 21, 2024 11:17 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/bundle-report February 21, 2024 11:18 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/typedoc February 21, 2024 11:18 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/features February 21, 2024 11:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/bundle-report February 21, 2024 11:21 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/typedoc February 21, 2024 11:21 Inactive
@VeskeR VeskeR marked this pull request as ready for review February 21, 2024 11:24
@VeskeR VeskeR force-pushed the 1538/remove-old-platforms-code branch from 6af3284 to 3d41166 Compare February 21, 2024 14:24
@github-actions github-actions bot temporarily deployed to staging/pull/1629/features February 21, 2024 14:25 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/typedoc February 21, 2024 14:26 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/bundle-report February 21, 2024 14:26 Inactive
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian left a comment

Choose a reason for hiding this comment

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

There still seem to be some mentions of IE:

and of browser compatibility accommodations:

  • // comma-dangle used for browser compatibility for browsers that don't support trailing commas
    (related to this I think)

Also, just a heads-up that writing "Resolves #1538 , #1332" in your PR description doesn't do what you think it does — you need to write "Resolves #1538, resolves #1332".

src/common/lib/util/logger.ts Outdated Show resolved Hide resolved
src/platform/web/lib/util/webstorage.ts Show resolved Hide resolved
src/platform/web/config.ts Outdated Show resolved Hide resolved
src/common/lib/util/utils.ts Show resolved Hide resolved
src/platform/web/lib/http/request/xhrrequest.ts Outdated Show resolved Hide resolved
@VeskeR
Copy link
Contributor Author

VeskeR commented Feb 21, 2024

There still seem to be some mentions of IE:

Initially I wasn't sure if I wanted to remove IE code from tests that would lead to those tests not even being able to run on IE, but now looking at it again it really doesn't make sense to have this code present anymore. We're never going to test against IE and if someone else would try to run those tests - well it is going to break for a reason - we don't support IE anymore. So I will remove those mentions from test cases too.

and of browser compatibility accommodations:

Will take a look.

Also, just a heads-up that writing "Resolves #1538 , #1332" in your PR description doesn't do what you think it does — you need to write "Resolves #1538, resolves #1332".

Right, thanks!

@github-actions github-actions bot temporarily deployed to staging/pull/1629/features February 23, 2024 01:25 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/bundle-report February 23, 2024 01:26 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/typedoc February 23, 2024 01:26 Inactive
This is in preparation for unifying IPlatformConfig.getRandomValues and
IConfig.getRandomArrayBuffer functions into one.

`getRandomArrayBuffer` implementation details for each platform:

- for `nativescript` - based on nativescript's `getRandomValues`
  function
- for `nodejs` - based on `generateRandom` function from our nodejs
  crypto code [1]
- for `react-native` - was already implemented
- for `web` - based on `generateRandom` function from our web crypto
  code [2]. After fccd4ac it is possible
  to simplify this code by removing `DEFAULT_BLOCKLENGTH_WORDS` and
  using Uint8Array directly instead of Uint32Array and calculating words

[1] https://github.com/ably/ably-js/blob/d0e9fbe4797ebb8520286592ba7b5d82a139eb39/src/platform/nodejs/lib/util/crypto.ts#L32
[2] https://github.com/ably/ably-js/blob/d0e9fbe4797ebb8520286592ba7b5d82a139eb39/src/platform/web/lib/util/crypto.ts#L35
In #1537 we established browser versions we intend to support in ably-js
v2 going forward, and all of them support `Crypto.getRandomValues`, thus
there is no need to have fallbacks to `Math.random` anymore.

This commit removes such code and changes corresponding places to always
call IPlatformConfig.getRandomArrayBuffer instead.

Resolves #1332
@VeskeR VeskeR force-pushed the 1538/remove-old-platforms-code branch from e356d07 to 9a05dc8 Compare February 23, 2024 02:36
@github-actions github-actions bot temporarily deployed to staging/pull/1629/features February 23, 2024 02:36 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/bundle-report February 23, 2024 02:37 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1629/typedoc February 23, 2024 02:37 Inactive
@VeskeR
Copy link
Contributor Author

VeskeR commented Feb 23, 2024

Applied changes from conversations, removed IE mentions from tests and removed browser compatibility eslint rule

src/common/lib/util/logger.ts Outdated Show resolved Hide resolved
src/common/lib/util/utils.ts Show resolved Hide resolved
@VeskeR
Copy link
Contributor Author

VeskeR commented Feb 27, 2024

Added 2fc88a3 to remove node 0.8.x specific code, please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove code that's supporting older platforms (in v2) Remove fallbacks to Math.random
2 participants