Skip to content
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

adding a page on web standards #802

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

adding a page on web standards #802

wants to merge 7 commits into from

Conversation

thisisjofrank
Copy link
Collaborator

This is a starter for what should be documentation on the deno philosophy on the three api groups.

runtime/fundamentals/web_standards.md Outdated Show resolved Hide resolved
Comment on lines 5 to 6
Deno aims to bridge the gap between the browser and the backend with a set of
web standard APIs that are familiar to web developers. These APIs are designed
Copy link
Member

Choose a reason for hiding this comment

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

this sounds a little roundabout- maybe something along these lines: "Deno aims to narrow the gap between browser and server-side JavaScript by providing the exact same web standard APIs available client side in the server. This means if you know how to program a browser, you already know how to program Deno."

Comment on lines 14 to 15
Deno also provides its global namespace APIS, to empower developers with
low-level capabilities, often essential for system-level tasks.
Copy link
Member

Choose a reason for hiding this comment

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

Deno also provides its own Deno specific APIs, accessible under the Deno global variable that are performant, simple ways to do server-side only operations.

Comment on lines +17 to +25
## Web Platform APIs

If you’ve ever built for the browser, you’re already on familiar ground. Deno
supports standard web APIs (like fetch, WebSockets, and more) instead of
proprietary alternatives. This means your existing web knowledge can be used in
your Deno projects.

For more information about the web platform APIs, see the
[Web Platform APIs](/runtime/reference/web_platform_apis/) documentation.
Copy link
Member

Choose a reason for hiding this comment

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

this would be a good place to discuss spec deviations and other content contained in https://docs.deno.com/runtime/reference/web_platform_apis/

Comment on lines 26 to 37

## Node.js Compatibility and APIs

Deno’s Node.js compatibility isn’t about replacing Node, it’s about coexistence.
Developers can gradually migrate their projects, leveraging Deno’s security
features and built in tooling while benefiting from Node.js libraries. Many
Node.js libraries are battle-tested and widely used. Deno’s compatibility allows
developers to reuse this code seamlessly. No need for a complete rewrite—just
import your favorite Node.js modules.

For more information about Node.js compatibility, see the
[Node.js Compatibility](/runtime/reference/node/) documentation.
Copy link
Member

Choose a reason for hiding this comment

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

This could be more exact. Instead of "Node.js Compatibility and APIs", I would call it "Node built-in APIs" the description could explain "these are imports that are prefixed with node:, like node:fs. They operate exactly as in Node"

I would image to find this content here: https://docs.deno.com/runtime/reference/node/#node.js-built-ins

For more information about Node.js compatibility, see the
[Node.js Compatibility](/runtime/reference/node/) documentation.

## Deno Namespace APIs
Copy link
Member

Choose a reason for hiding this comment

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

Just "Deno APIs" or "Deno specific APIs"

There isn't much meat to this section yet...

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

LGTM, left two minor comments. Let me know what you think.

Comment on lines 5 to 8
Deno aims to bridge the gap between the browser and the backend with a set of
web standard APIs that are familiar to web developers. These APIs are designed
to be compatible with the web platform, making it easier to write code that can
run in both the browser and Deno.
Copy link
Contributor

Choose a reason for hiding this comment

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

This reads a little strange to me: Like we didn't design the APIs ourselves. I feel like we should be more direct than the phrasing here. Maybe something like

"Deno is built primarily around Web Platform APIs that you already know from working with browsers. There are very few additional Deno-specific APIs for more low level access which can be found on the Deno global if needed."

I think the point we're trying to make here that Deno should be familiar to you already if you're a web developer. We can be a bit more "on the nose" with that here.

Comment on lines 10 to 12
Existing Node.js ecosystem compatibility is provided through a set of Node.js
compatible APIs and Deno namespace APIs. These APIs are designed to be
compatible with Node.js, making it easier to port existing Node.js code to Deno.
Copy link
Contributor

Choose a reason for hiding this comment

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

The phrasing seems to suggest that the Deno namespace APIs help with node compatibility. Maybe something like:

Suggested change
Existing Node.js ecosystem compatibility is provided through a set of Node.js
compatible APIs and Deno namespace APIs. These APIs are designed to be
compatible with Node.js, making it easier to port existing Node.js code to Deno.
Existing Node.js ecosystem compatibility is provided through a built-in compatibility layer that allows you to use any npm package directly in Deno.

Comment on lines +19 to +22
If you’ve ever built for the browser, you’re already on familiar ground. Deno
supports standard web APIs (like fetch, WebSockets, and more) instead of
proprietary alternatives. This means your existing web knowledge can be used in
your Deno projects.
Copy link
Contributor

Choose a reason for hiding this comment

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

Love this!

@marvinhagemeister marvinhagemeister dismissed their stale review September 5, 2024 13:07

wrong button, wanted to just leave a comment review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants