Skip to content

(DOCSP-12450): JS Compatibility Table #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions source/functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Constraints
- Function memory usage is limited to 256MB.

- Functions support most commonly used ES6+ features, but some features that are
uncommon or unsuited to serverless workloads are not supported (e.g.
``WeakSet``, ``Proxy``, ``Array.prototype.flat()``).
uncommon or unsuited to serverless workloads are not supported. For more
information, see :ref:`JavaScript Feature Compatibility <js-feature-compat>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is there any advantage of using :ref: over the :doc: here? Seems like they both send you to the same place (top of the Javascript Feature Compatibility page).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No advantage other than we can change the page slug without needing to update this location. There's pros and cons to that but the rest of the realm team seems to prefer ref


- A function may open a maximum of 5 sockets using the :nodejs:`net
<docs/v10.18.1/api/net.html>` built-in module.
Expand Down Expand Up @@ -207,6 +207,9 @@ Reference Documentation
* - :doc:`Built-In Module Support </functions/built-in-module-support>`
- Details which standard Node modules and APIs are available in {+service-short+} functions.

* - :doc:`JavaScript Feature Compatibility </functions/js-feature-compatibility>`
- Details the JavaScript syntax and built-ins that are available in {+service-short+} functions.


.. toctree::
:titlesonly:
Expand Down Expand Up @@ -234,3 +237,4 @@ Reference Documentation
Function Context Reference </functions/context>
Utility Packages </functions/utilities>
JSON & BSON </functions/json-and-bson>
JavaScript Feature Compatibility </functions/js-feature-compatibility>
153 changes: 153 additions & 0 deletions source/functions/js-feature-compatibility.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.. _js-feature-compat:

================================
JavaScript Feature Compatibility
================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Overview
--------

{+service+} :doc:`functions </functions>` fully support JavaScript ES5 syntax as
well as most modern JavaScript features included in EcmaScript 2015 (ES6) and
more recent releases. This page outlines Realm's support for a non-exhaustive
list of features released in or since EcmaScript 2015.

Syntax
------

.. list-table::
:header-rows: 1
:widths: 80 20

* - Feature
- Supported

* - :mdn:`arrow function expressions <Web/JavaScript/Reference/Functions/Arrow_functions>`
- Yes

* - :mdn:`classes <Web/JavaScript/Reference/Classes>`
- Yes

* - :mdn:`super <Web/JavaScript/Reference/Operators/super>`
- Yes

* - :mdn:`generators <Web/JavaScript/Reference/Statements/function*>`
- Yes

* - :mdn:`default function parameters <Web/JavaScript/Reference/Functions/Default_parameters>`
- Yes

* - :mdn:`rest parameters <Web/JavaScript/Reference/Functions/rest_parameters>`
- Yes

* - :mdn:`spread iterables <Web/JavaScript/Reference/Operators/Spread_syntax>`
- Yes

* - :mdn:`object literal extensions <Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015>`
- Yes

* - :mdn:`for...of loops <Web/JavaScript/Reference/Statements/for...of>`
- Yes

* - :mdn:`for await...of loops <Web/JavaScript/Reference/Statements/for-await...of>`
- Yes

* - :mdn:`octal and binary literals <Web/JavaScript/Reference/Lexical_grammar#Binary>`
- Yes

* - :mdn:`template literals <Web/JavaScript/Reference/Template_literals>`
- Yes

* - :mdn:`destructuring assignment <Web/JavaScript/Reference/Operators/Destructuring_assignment>`
- Yes

* - :mdn:`new.target <Web/JavaScript/Reference/Operators/new.target>`
- Yes

* - :mdn:`RegExp -y and -u flags <Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2>`
- No

* - :mdn:`Exponentiation (**) <Web/JavaScript/Reference/Operators/Exponentiation>`
- Yes

Built-In Objects
----------------

.. list-table::
:header-rows: 1
:widths: 80 20

* - Feature
- Supported

* - :mdn:`TypedArray <Web/JavaScript/Reference/Global_Objects/TypedArray>`
- Yes

* - :mdn:`Map <Web/JavaScript/Reference/Global_Objects/Map>`
- Yes

* - :mdn:`Set <Web/JavaScript/Reference/Global_Objects/Set>`
- Yes

* - :mdn:`WeakMap <Web/JavaScript/Reference/Global_Objects/WeakMap>`
- Yes

* - :mdn:`WeakSet <Web/JavaScript/Reference/Global_Objects/WeakSet>`
- No

* - :mdn:`Proxy <Web/JavaScript/Reference/Global_Objects/Proxy>`
- No

* - :mdn:`Reflect <Web/JavaScript/Reference/Global_Objects/Reflect>`
- No

* - :mdn:`Promise <Web/JavaScript/Reference/Global_Objects/Promise>`
- Yes

* - :mdn:`Symbol <Web/JavaScript/Reference/Global_Objects/Symbol>`
- Yes

Built-In Object Methods & Properties
------------------------------------

.. list-table::
:header-rows: 1
:widths: 80 20

* - Feature
- Supported

* - :mdn:`Object static methods <Web/JavaScript/Reference/Global_Objects/Object#Static_methods>`
- Yes

* - :mdn:`String static methods <Web/JavaScript/Reference/Global_Objects/String#Static_methods>`
- Yes

* - :mdn:`String.prototype methods <Web/JavaScript/Reference/Global_Objects/String#Instance_methods>`
- Yes

* - :mdn:`RegExp.prototype properties <Web/JavaScript/Reference/Global_Objects/RegExp#Instance_properties>`
- No

* - :mdn:`Function.name <Web/JavaScript/Reference/Global_Objects/Function/name>`
- Yes

* - :mdn:`Array static methods <Web/JavaScript/Reference/Global_Objects/Array#Static_methods>`
- Yes

* - :mdn:`Array.prototype methods <Web/JavaScript/Reference/Global_Objects/Array#Instance_methods>`
- Yes

* - :mdn:`Number static methods <Web/JavaScript/Reference/Global_Objects/Number#Static_methods>`
- No

* - :mdn:`Math methods <Web/JavaScript/Reference/Global_Objects/Math#Static_methods>`
- No