automerge / automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
http://automerge.org/
MIT License
14.75k stars 466 forks source link

Add `eslint-plugin-compat` and update linting config #396

Closed scotttrinh closed 3 years ago

scotttrinh commented 3 years ago

Adds linting to detect usage of features that are not natively supported by our target platforms. Sets those platforms using https://github.com/browserslist/browserslist but we should negotiate what those platform ought to be before merging this—I picked this list as a sensible starting point.

We should also update the docs to let consumers know what sort of environments are supported.

Note: @babel/preset-env also uses this same setup as the target of its transpilation and polyfilling, so we will want to check the output of the bundling and transpilation to ensure it does not include any performance regressions. See #368 for some babel-related discussion that is relevant here.

Closes https://github.com/automerge/automerge/issues/370

ept commented 3 years ago

Hi @scotttrinh, thank you! This config looks reasonable to me.

At the moment when running webpack I get Error: Universal Chunk Loading is not implemented yet. Is that just me?

scotttrinh commented 3 years ago

@ept

At the moment when running webpack I get Error: Universal Chunk Loading is not implemented yet. Is that just me?

Ahh, yeah, it looks related to this webpack issue when targeting node in browserslist: https://github.com/webpack/webpack/issues/11660

The suggestion there to update the output.chunkLoading: false did not seem to work for me, but splitting the browserslist into two environments seems to work.

ept commented 3 years ago

Okay, this seems fine to me — thank you for your help @scotttrinh!