You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export browser bundle of drivers as ECMAScript module
ECMAScript modules are the official standard format to package JavaScript code for reuse.
This is standard improve the modularity of the applications by avoiding leaking global variables and other benefits.
Usage example of the `neo4j-driver-lite` esm in browser:
```javascript
// jsDelivr CDN minified for production use, version X.Y.Z where X.Y.Z >= 5.4.0
import neo4j from 'https://cdn.jsdelivr.net/npm/neo4j-driver-lite@X.Y.Z/lib/browser/neo4j-lite-web.esm.min.js'
const driver = neo4j.driver(/* your host */, neo4j.auth.basic(/* user */, /* password */))
driver.verifyConnectivity()
.then(() => console.log('Connected'))
.catch(e => console.error(e))
```
**Changes in the `neo4j-driver-lite`**
`Browserify` was replaced by `rollup` as the browser building tool for building `umd` and `esm` outputs.
Since `rollup` is already being used in the `testkit-backend`, this change also standardise the tooling in the monorepo.
The esm module is exported as `neo4j-lite-web.esm.js` (non-minified) and `neo4j-lite-web.esm.min.js` (minified).
The files are available under `lib/browser` along with `umd` modules.
0 commit comments