Skip to content

Commit

Permalink
[EDU-5621] Update Node Compatibility reference (#1368)
Browse files Browse the repository at this point in the history
* fix: update compatible apis

* feat: update code samples

* fix: reorder items
  • Loading branch information
guiafonso-ol authored Nov 13, 2024
1 parent 336a6fb commit fd2a66d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import { API } from "import-origin";
| API | Support Level | Code sample | Comments |
|---------|---------------|----------|-------------|
| async_hooks | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/azion-samples/tree/dev/samples/node-async-hooks) | Only [AsyncLocalStorage](https://nodejs.org/api/async_context.html#class-asynclocalstorage) and [AsyncResource](https://nodejs.org/api/async_hooks.html#class-asyncresource) are implemented |
| process.env | 🟢 Supported | `process.env.VAR_NAME`| |
| fs | 🟡 Partially supported| | [Check the list below](#fs-support) |
| fs | 🟡 Partially supported| | Only async methods ([check the list below](#fs-support)), others through [polyfills](#node-polyfills) |
| module | 🟡 Partially supported | | Also supported in local dev through polyfills ([check table below](#node-polyfills)) |
| process.env | 🟢 Supported | `process.env.VAR_NAME`| Other features supported through polyfills ([check table below](#node-polyfills)) |
| url | 🟡 Partially supported | | Only global `URL` and `URLSearchParams` |

### FS support

Expand Down Expand Up @@ -58,45 +60,21 @@ Here's a list of Node APIs supported through polyfills:
| API | Support Level | Code sample |
|---------|---------------|-------------|
| buffer | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/azion-samples/tree/dev/samples/polyfills/buffer) |
| crypto | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/crypto/main.js) |
| events | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/events/main.js) |
| fs | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/azion-samples/tree/dev/samples/polyfills/fs) |
| crypto | 🟡 Partially supported | - |
| dns | 🟡 Partially supported | - |
| http2 | 🟡 Partially supported | - |
| module | 🟡 Partially supported | - |
| navigator | 🟡 Partially supported | - |
| path_dirname | 🟡 Partially supported | - |
| performance | 🟡 Partially supported | - |
| process | 🟡 Partially supported | - |
| accepts | 🟡 Partially supported | - |
| child_process | 🟡 Partially supported | - |
| cluster | 🟡 Partially supported | - |
| console | 🟡 Partially supported | - |
| dgram | 🟡 Partially supported | - |
| events | 🟡 Partially supported | - |
| http | 🟡 Partially supported | - |
| https | 🟡 Partially supported | - |
| inspector | 🟡 Partially supported | - |
| net | 🟡 Partially supported | - |
| os | 🟡 Partially supported | - |
| path | 🟡 Partially supported | - |
| perf_hooks | 🟡 Partially supported | - |
| querystring | 🟡 Partially supported | - |
| readline | 🟡 Partially supported | - |
| repl | 🟡 Partially supported | - |
| stream | 🟡 Partially supported | - |
| _stream_passthrough | 🟡 Partially supported | - |
| _stream_readable | 🟡 Partially supported | - |
| _stream_transform | 🟡 Partially supported | - |
| _stream_writable | 🟡 Partially supported | - |
| string_decoder | 🟡 Partially supported | - |
| sys | 🟡 Partially supported | - |
| timers | 🟡 Partially supported | - |
| tls | 🟡 Partially supported | - |
| tty | 🟡 Partially supported | - |
| url | 🟡 Partially supported | - |
| util | 🟡 Partially supported | - |
| vm | 🟡 Partially supported | - |
| zlib | 🟡 Partially supported | - |
| http | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/http/main.js) |
| module | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/module/main.js) |
| os | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/os/main.js) |
| path | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/path/main.js) |
| process | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/process/main.js) |
| stream | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/stream/main.js) |
| string_decoder | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/string-decoder/main.js) |
| timers | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/timers/main.js) |
| url | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/url/main.js) |
| util | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/util/main.js) |
| vm | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/vm/main.js) |
| zlib | 🟡 Partially supported | [Access code sample](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/zlib/main.js) |

:::note
You can check the list of APIs resolved through polyfills in [Azion Bundler's repository](https://github.com/aziontech/bundler/blob/main/lib/build/bundlers/polyfills/polyfills-manager.js), as well as contribute with the project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import { API } from "import-origin";
| API | Nível de suporte | Exemplo de código | Comentários |
|---------|---------------|----------|-------------|
| async_hooks | 🟡 Parcialmente suportada | [Acessar o exemplo de código](https://github.com/aziontech/azion-samples/tree/dev/samples/node-async-hooks) | Apenas [AsyncLocalStorage](https://nodejs.org/api/async_context.html#class-asynclocalstorage) e [AsyncResource](https://nodejs.org/api/async_hooks.html#class-asyncresource) estão implementadas. |
| process.env | 🟢 Suportada | `process.env.NOME_VAR`| |
| fs | 🟡 Parcialmente suportado | | [Verifique a lista abaixo](#suporte-fs) |
| fs | 🟡 Parcialmente suportada | | Apenas métodos assíncronos ([confira a lista abaixo](#fs-support)), outros através de [polyfills](#node-polyfills) |
| module | 🟡 Parcialmente suportada | | |
| process.env | 🟢 Suportada | `process.env.VAR_NAME`| Outros recursos suportados através de polyfills ([confira a tabela abaixo](#node-polyfills)) |
| url | 🟡 Parcialmente suportada | | Apenas os globais `URL` e `URLSearchParams` |

### Suporte de FS

Expand Down Expand Up @@ -60,45 +62,21 @@ Aqui está a lista de APIs do Node suportadas através de polyfills:
| API | Nível de suporte | Exemplo de código |
|---------|---------------|----------|
| buffer | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/azion-samples/tree/dev/samples/polyfills/buffer) |
| fs | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/azion-samples/tree/dev/samples/polyfills/fs) |
| crypto | 🟡 Parcialmente suportada | - |
| dns | 🟡 Parcialmente suportada | - |
| http2 | 🟡 Parcialmente suportada | - |
| module | 🟡 Parcialmente suportada | - |
| navigator | 🟡 Parcialmente suportada | - |
| path_dirname | 🟡 Parcialmente suportada | - |
| performance | 🟡 Parcialmente suportada | - |
| process | 🟡 Parcialmente suportada | - |
| accepts | 🟡 Parcialmente suportada | - |
| child_process | 🟡 Parcialmente suportada | - |
| cluster | 🟡 Parcialmente suportada | - |
| console | 🟡 Parcialmente suportada | - |
| dgram | 🟡 Parcialmente suportada | - |
| events | 🟡 Parcialmente suportada | - |
| http | 🟡 Parcialmente suportada | - |
| https | 🟡 Parcialmente suportada | - |
| inspector | 🟡 Parcialmente suportada | - |
| net | 🟡 Parcialmente suportada | - |
| os | 🟡 Parcialmente suportada | - |
| path | 🟡 Parcialmente suportada | - |
| perf_hooks | 🟡 Parcialmente suportada | - |
| querystring | 🟡 Parcialmente suportada | - |
| readline | 🟡 Parcialmente suportada | - |
| repl | 🟡 Parcialmente suportada | - |
| stream | 🟡 Parcialmente suportada | - |
| _stream_passthrough | 🟡 Parcialmente suportada | - |
| _stream_readable | 🟡 Parcialmente suportada | - |
| _stream_transform | 🟡 Parcialmente suportada | - |
| _stream_writable | 🟡 Parcialmente suportada | - |
| string_decoder | 🟡 Parcialmente suportada | - |
| sys | 🟡 Parcialmente suportada | - |
| timers | 🟡 Parcialmente suportada | - |
| tls | 🟡 Parcialmente suportada | - |
| tty | 🟡 Parcialmente suportada | - |
| url | 🟡 Parcialmente suportada | - |
| util | 🟡 Parcialmente suportada | - |
| vm | 🟡 Parcialmente suportada | - |
| zlib | 🟡 Parcialmente suportada | - |
| crypto | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/blob/main/examples/runtime-apis/nodejs/crypto/main.js) |
| events | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/events/main.js) |
| fs | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/azion-samples/tree/dev/samples/polyfills/fs/main.js) |
| http | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/http/main.js) |
| module | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/module/main.js) |
| os | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/os/main.js) |
| path | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/path/main.js) |
| process | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/process/main.js) |
| stream | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/stream/main.js) |
| string_decoder | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/string-decoder/main.js) |
| timers | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/timers/main.js) |
| url | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/url/main.js) |
| util | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/util/main.js) |
| vm | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/vm/main.js) |
| zlib | 🟡 Parcialmente suportada | [Acessar exemplo de código](https://github.com/aziontech/bundler-examples/tree/main/examples/runtime-apis/nodejs/zlib/main.js) |

:::note
Você pode verificar a lista de APIs resolvidas através de polyfills no [repositório do Azion Bundler](https://github.com/aziontech/bundler/blob/main/lib/build/bundlers/polyfills/polyfills-manager.js) e contribuir com o projeto.
Expand Down

0 comments on commit fd2a66d

Please sign in to comment.