Skip to content

Commit

Permalink
Remove browserify builds (#3759)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Oct 3, 2023
1 parent 5c45c98 commit 68317ac
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 1,375 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
specs: [browserify, integ, unit]
specs: [integ, unit]
node: [18, latest]
steps:
- name: Checkout code
Expand All @@ -32,10 +32,6 @@ jobs:
- name: Install dependencies
run: "yarn install"

- name: Build
if: matrix.specs == 'browserify'
run: "yarn build"

- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2
Expand Down
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,7 @@ endpoints from before Matrix 1.1, for example.

## In a browser

### Note, the browserify build has been deprecated. Please use a bundler like webpack or vite instead.

Download the browser version from
https://github.com/matrix-org/matrix-js-sdk/releases/latest and add that as a
`<script>` to your page. There will be a global variable `matrixcs`
attached to `window` through which you can access the SDK. See below for how to
include libolm to enable end-to-end-encryption.

The browser bundle supports recent versions of browsers. Typically this is ES2015
or `> 0.5%, last 2 versions, Firefox ESR, not dead` if using
[browserlists](https://github.com/browserslist/browserslist).

Please check [the working browser example](examples/browser) for more information.
### Note, the browserify build has been removed. Please use a bundler like webpack or vite instead.

## In Node.js

Expand Down Expand Up @@ -375,9 +363,6 @@ To run tests (Jest):
$ yarn test
```

> **Note**
> The `sync-browserify.spec.ts` requires a browser build (`yarn build`) in order to pass
To run linting:

```
Expand Down
10 changes: 0 additions & 10 deletions examples/browser/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions examples/browser/browserTest.js

This file was deleted.

17 changes: 0 additions & 17 deletions examples/browser/index.html

This file was deleted.

1 change: 0 additions & 1 deletion examples/browser/lib/matrix.js

This file was deleted.

2 changes: 0 additions & 2 deletions examples/crypto-browser/lib/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion examples/crypto-browser/lib/matrix.js

This file was deleted.

60 changes: 0 additions & 60 deletions examples/crypto-browser/olm-device-export-import.html

This file was deleted.

105 changes: 0 additions & 105 deletions examples/crypto-browser/olm-device-export-import.js

This file was deleted.

26 changes: 1 addition & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
"start": "echo THIS IS FOR LEGACY PURPOSES ONLY. && babel src -w -s -d lib --verbose --extensions \".ts,.js\"",
"dist": "echo 'This is for the release script so it can make assets (browser bundle).' && yarn build",
"clean": "rimraf lib dist",
"build": "yarn build:dev && yarn build:compile-browser && yarn build:minify-browser",
"build": "yarn build:dev",
"build:dev": "yarn clean && git rev-parse HEAD > git-revision.txt && yarn build:compile && yarn build:types",
"build:types": "tsc -p tsconfig-build.json --emitDeclarationOnly",
"build:compile": "babel -d lib --verbose --extensions \".ts,.js\" src",
"build:compile-browser": "mkdir dist && BROWSERIFYSWAP_ENV='no-rust-crypto' browserify -d src/browser-index.ts -p [ tsify -p ./tsconfig-build.json ] | exorcist dist/browser-matrix.js.map > dist/browser-matrix.js",
"build:minify-browser": "terser dist/browser-matrix.js --compress --mangle --source-map --output dist/browser-matrix.min.js",
"gendoc": "typedoc",
"lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 0 src spec && prettier --check .",
Expand Down Expand Up @@ -97,8 +95,6 @@
"allchange": "^1.0.6",
"babel-jest": "^29.0.0",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"browserify-swap": "^0.2.2",
"debug": "^4.3.4",
"domexception": "^4.0.0",
"eslint": "8.49.0",
Expand Down Expand Up @@ -136,25 +132,5 @@
"outputDirectory": "coverage",
"outputName": "jest-sonar-report.xml",
"relativePaths": true
},
"browserify": {
"transform": [
"browserify-swap",
[
"babelify",
{
"sourceMaps": "inline",
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
]
}
]
]
},
"browserify-swap": {
"no-rust-crypto": {
"src/rust-crypto/index.ts$": "./src/rust-crypto/browserify-index.ts"
}
}
}
34 changes: 0 additions & 34 deletions spec/browserify/setupTests.ts

This file was deleted.

Loading

0 comments on commit 68317ac

Please sign in to comment.