polkadot-js / docs

This is the documentation portal for all Polkadot and Substrate related tools and libraries in the polkadot-js family of repos.
https://polkadot.js.org/docs/
Creative Commons Zero v1.0 Universal
164 stars 199 forks source link

Mixture between CommonJS and Modules in documentation #290

Open benjichat opened 2 years ago

benjichat commented 2 years ago

Module Example -> https://polkadot.js.org/docs/api/start/create Common Js Example -> https://polkadot.js.org/docs/api/examples/promise/listen-to-blocks

In the overview, it seems like 'CommonJs' is the chosen format. Perhaps a task is to redo some of the examples?

jacogr commented 2 years ago

ESM is actually preferred for all. The documentation is quite old at this point, PRs to adjust are very welcome. (Especially the examples are still from the days before Node had .mjs support, since they are meant to be runnable, they stuck with cjs)

polkadot-js-bot commented 2 years ago

This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.