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

Initial Proposal #2

Merged
merged 16 commits into from Jan 12, 2023
Merged

Initial Proposal #2

merged 16 commits into from Jan 12, 2023

Conversation

Ethan-Arrowood
Copy link
Collaborator

@Ethan-Arrowood Ethan-Arrowood commented Oct 19, 2022

This PR adds the initial proposal.

Before this is merged, we need to seek approval from the various runtimes represented in this initial draft. The following list matches the list of keys included in this initial draft. Each runtime is either linked to a discussion/issues/post requesting approval from the relative project, or someone apart of WinterCG who can represent the runtime is tagged.

@QuiiBz
Copy link

QuiiBz commented Oct 19, 2022

Using edge as a key for Vercel Edge Runtime might be confusing for users. The word « Edge » is used in many projects including Cloudflare Workers, Deno Deploy, and Vercel Edge Runtime. A user might think that everything with « Edge » in its marketing should have the edge runtime key, which won’t be the case unless he uses the Vercel Edge Runtime. Maybe a more specific key like vercel would make more sense?

@Ethan-Arrowood
Copy link
Collaborator Author

A user might think that everything with « Edge » in its marketing should have the edge runtime key

This is almost exactly why we are creating this proposal 😄 It is currently ambiguous and vague what folks should be using. And since it is not standardized every tooling makes up its own rules. Node says you can use a variety of keys, Webpack has its own list, etc.

By listing them here, and encouraging tools to adopt this standard, at least there will be no more confusion and vagueness.

While yes "edge" is a commonly used word in this space, no other runtime is branding and marketing itself as Vercel's Edge Runtime is and it was what was decided upon internally at Vercel. If there is hard push back from the group, I will bring the feedback back to Vercel for discussion.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

I would like to see a key for Netlify Edge Functions too.

@Ethan-Arrowood
Copy link
Collaborator Author

I'll go ahead and add a stub now! Do we have anyone from Netlify involved in WinterCG? Anyone specific I should reach out too? Otherwise, I will open a discussion thread like I did for React Native

@lucacasonato
Copy link
Member

lucacasonato commented Oct 19, 2022

I'll get you someone.

I also have concerns about using "edge" as the key for Vercel Edge Runtime. Edge is not a name unique to Vercel. There are many other products with edge in the name, so this may get very confusing. I think we need something more specific. An arbitrarily chosen list of other runtimes with Edge in the name:

  • Lambda@Edge
  • Netlify Edge
  • Vercel Edge Network (not the same thing as Vercel Edge Runtime AFAICT)
  • Netlify Edge Functions (not the same thing as Netlify Edge Functions)
  • Google Distributed Cloud Edge
  • Microsoft Edge

Then there are also other products that use "edge" as a concept in marketing material:

  • Cloudflare Workers
  • Deno Deploy

index.bs Outdated Show resolved Hide resolved
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

What about individual browsers?

index.bs Outdated Show resolved Hide resolved
@Ethan-Arrowood
Copy link
Collaborator Author

What about individual browsers?

Since the browsers wouldn't necessarily be concerned with what we are working towards here in WinterCG it could be weird to have them on the list. I think generally, we are trying to create the list of server runtimes so that we can leverage the same tooling browsers have benefited from (i.e. browserlist) previously.

@ljharb
Copy link
Member

ljharb commented Oct 19, 2022

Sure - but we'd still want to make sure that server runtime keys didn't conflict with what users might want to name their browsers, and it seems the simplest way to do that is to include them here?

@Ethan-Arrowood
Copy link
Collaborator Author

didn't conflict with what users might want to name their browsers, and it seems the simplest way to do that is to include them here?

Good point! Is there an existing standard for those browser identifiers? My assumption is that the tooling we are looking to improve with this key set is currently not concerned with specific browser bundles. Like even Webpack only has a browser key for representing browsers as a target environment.

@ljharb
Copy link
Member

ljharb commented Oct 19, 2022

The closest is likely https://github.com/browserslist/browserslist

Co-authored-by: Jordan Harband <ljharb@gmail.com>
@Ethan-Arrowood
Copy link
Collaborator Author

Ethan-Arrowood commented Oct 19, 2022

Instead of having browsers in the list, we add some text to also avoid conflicting with browsers defined in browserlist to prevent tooling conflicts. This way we aren't responsible for getting any sort of browser buy-in or maintenance

@ljharb
Copy link
Member

ljharb commented Oct 19, 2022

That sounds perfectly reasonable!

@jasnell
Copy link

jasnell commented Oct 19, 2022

image

@Ethan-Arrowood ... let's not list anyone next to the Node.js slot in this list since the TSC has never formally decided that Node.js has any official representation here. Those of us here who contribute to Node.js cannot say that we are representing the project as a whole.

@jasnell
Copy link

jasnell commented Oct 19, 2022

To be clear, my sign off on this PR is from my POV as representing cloudflare workerd, not Node.js

@Ethan-Arrowood
Copy link
Collaborator Author

Okay removed myself. I was planning on opening an discussion in the tooling group anyways so i'll link to that instead when I do. Luckily, they should be an easy one as node is already documented, supported, and known (and no one else is using that branding).

@Ethan-Arrowood
Copy link
Collaborator Author

Does anyone have more input into the criteria for being on this list? I've intentionally left that section vague since there is value in not having a large set of restrictive rules (so any runtime can be included), but I can also see some value in setting stricter expectations.

Some things that come to mind are:

  • runtime availability
    • is it open sourced?
    • is there available documentation for what the runtime defines as part of its API?
  • legitimacy
    • representative marketing & branding
    • does it actually exist?
      • like is the runtime more than just a pet project someone threw some catchy name in front of?
    • does it have some resemblance of a community? chat/forum/support channels
    • is it backed by any entity other than individual efforts? I.e. corporate, organization (such as OpenJS Foundation)

I'm not proposing that we need to set more than what I've written so far, but want to share the thought so it can be discussed 😄

index.bs Outdated Show resolved Hide resolved
index.bs Outdated

Repository: [https://github.com/facebook/react-native](https://github.com/facebook/react-native)

## Netlify - Edge Functions ## {#}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Netlify - Edge Functions ## {#}
## Netlify - Edge Functions ## {#netlify}

should we at least have a temporary naming for this one ? and same for key. I think we choose for others runtimes without having someone from the company so why not here too ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other ones were pulled from existing resources or told to me by someone from that project. I've reached out to someone from Netlify so they will be checking out soon

@sheplu
Copy link
Contributor

sheplu commented Oct 20, 2022

I think we should have some restricting rules - at least some basics one. I am not sure that if I build a runtime only for me / private it is interesting to have it listed here.
open sourced seems a bit much but I think publicly available seems a good fit

@jacob-ebey
Copy link

jacob-ebey commented Nov 10, 2022

I don't understand the purpose of proposing these keys in the first place. Seems as though "runtime keys" should be scoped to the concerns of wintercg: implementation of common runtime API's. If company X builds a "runtime" on top of Deno, it's not a new runtime, it's still Deno. If WinterCG introduces a new API, it's Deno that needs to implement it, therefore company X's "runtime" doesn't belong on the list. "where the WinterCG implementation lives" should determine if something deserves a runtime key. The goal isn't "bundler tooling interoperability", it's runtime interoperability, and at no point would runtime code that's interoperable need to check a runtime key.

Just to clarify I'm not talking about "edge-runtime" naming, I'm talking core reason these keys exist.

@verythorough
Copy link

If edge-runtime isn't meant to be a vendor platform product, why is the vendor name included in the proposed runtime name?

And if it's meant to be independent, shouldn't it include maintainers (not just contributors) representing multiple parties?

@Ethan-Arrowood
Copy link
Collaborator Author

For folks new to this proposal, the albeit short history started from the idea of how do we expand the usage of engines and exports field in package.json wintercg/admin#36

To summarize that part, there is already developer tooling that lets you specify "my project needs to run in Node version 16+" or "use this file when you run my module in the browser, and this file when you run it in node".

Now that we have so many new runtimes being developed such as Workerd, Deno, Bun, Edge Runtime, etc. we wanted a clear way to define what key can be used to represent those runtimes in these same fields.

The simplest way to do so was to create a proposal that acts as a living registry.

This specification contains the language necessary for the keys to be added, modified, and deprecated over time. It enables developer tooling to build around a defined list just like browserlist was implemented. And most importantly, it acts to prevent multiple runtime projects from having conflicting identifiers.

@jacob-ebey
Copy link

jacob-ebey commented Nov 10, 2022

Why is it not based off of who owns the implementation / what the actual runtime is? I.e, we are going to continue to see an explosion of cases like the following unless the criteria for being on this list becomes "I own the WinterCG API implementations":

swtich (runtimeKeyProposal) {
  "cloudflare":
  "vendor-a-edge":
  "vendor-b-edge":
    // same
    break;
  "deno":
  "vendor-c-edge":
  "vendor-d-edge":
    // same
    break;
  "bun"
  "vendor-e-edge":
  "vendor-f-edge":
    // same
    break;
  // ...etc
}

I don't need 50 more keys to add to a bundler's "exports" / "imports" configuration.

@Ethan-Arrowood
Copy link
Collaborator Author

That is the benefit of this proposal. It does not dictate how tools need to utilize the list. All it does is specify the registry. It is up to (figuratively) you how you want to use these keys. Are you a tooling author creating a bundler that supports Node, Deno, CF, Bun, and more? Maybe this list and a lengthy export list in package.json is important. Are you a module author creating an library meant to run only in Node? Okay great, specify "node" in your exports and call it a day. Maybe you are a module author creating a library meant to run across node, deno, etc... then you definitely care about this registry so you can precisely specify what export files match with what.

@Ethan-Arrowood
Copy link
Collaborator Author

I will reiterate that we have been very intentional with the language used in the proposal. We do not want to be telling anyone to do anything; we are simply making this information publicly available in the most consistent and openly collaborative way possible. For the overall benefit of all developers working in the budding web runtime space.

@jacob-ebey
Copy link

jacob-ebey commented Nov 10, 2022

Fair enough. I then ask those on the list to reconsider if they need their own key or fall into an existing key. Specifically if you do not own the WinterCG API's or the module loading system.

@panva
Copy link

panva commented Nov 10, 2022

@jacob-ebey I've made the proposal to also add a catch*all key to represent "any runtime that satistisfies the WinterCG minimal API". Such that runtimes that do just that and nothing on top can rely on that and also that library authors that don't need any specific runtime's API don't need to keep on adding unique vendor specific keys to their declaration files.

@Ethan-Arrowood
Copy link
Collaborator Author

Yes! #1 it was actually the very first issue in this repo ✨ We just want to be intentional what "wintercg" would represent. Does it correlate to the latest iteration of the minimum common api spec?

It is something to be discussed and iterated on in the future for sure

@jacob-ebey
Copy link

Just want to verify that we are not specifying runtime API compatibility with this, but rather what runtime owns specific keys for "exports" / "imports". Seems outside of the stated goals of WinterCG, or am I still misunderstanding?

@Ethan-Arrowood
Copy link
Collaborator Author

Ethan-Arrowood commented Nov 10, 2022

I believe you are misunderstanding. The goal of the Minimum Common API is to specify runtime API compatibility. Other specs and proposals in this group have other goals

@Ethan-Arrowood
Copy link
Collaborator Author

Our charter accurately established our the groups goals:

The Web-interoperable Runtimes Community Group (wintercg) is intended to augment the work of other existing community and working groups focusing on the development of Web Platform features and APIs by focusing directly on the specific needs of non-Web Browser based implementations.

@Ethan-Arrowood
Copy link
Collaborator Author

Just want to verify that we are not specifying runtime API compatibility with this

Yes, this is articulated in the specification: https://github.com/wintercg/runtime-keys/pull/2/files#diff-5e793325cd2bfc452e268a4aa2f02b4024dd9584bd1db3c2595f61f1ecf7b985R31-R33

If you believe this can be better articulated please leave some feedback!

@jacob-ebey
Copy link

Is the second part to the quote you cut short accurate?

but rather what runtime owns specific keys for "exports" / "imports".

Beyond that it feels like this proposal doesn't accomplish much, and if it is in fact part of, if not the whole goal, the number of keys should be limited and not open for anyone who forks a runtime, otherwise that switch statement above will just grow and grow with more unique keys with the same underlying meaning.

@Ethan-Arrowood
Copy link
Collaborator Author

https://github.com/wintercg/runtime-keys/pull/2/files#diff-5e793325cd2bfc452e268a4aa2f02b4024dd9584bd1db3c2595f61f1ecf7b985R27-R29

As I've mentioned previously, this proposal is not dictating how they are meant to be used. It is acting as a registry to be used however folks see fit. That is the purpose of this proposal.

If you disagree with the effectiveness of this proposal you are welcome to ignore it and build your tools and modules however you see fit.

@lucacasonato
Copy link
Member

Discussed in today's meeting:

  • it would be useful to include an example in the intro

@maxpassion
Copy link

maxpassion commented Nov 21, 2022

Hello all, I'd like to propose adding the following runtime keys as discussed in the previous teleconference.

##Alibaba Cloud - edge-routine## {edge-routine}
The JavaScript/Webassembly runtime that powers Alibaba Cloud edge-routine.
Key:  edge-routine
Website: [https://www.alibabacloud.com/help/en/dynamic-route-for-cdn/latest/er-overview] (https://www.alibabacloud.com/help/en/dynamic-route-for-cdn/latest/er-overview)

@Ethan-Arrowood
Copy link
Collaborator Author

Ethan-Arrowood commented Dec 14, 2022

Hi folks, I've adjusted the proposal to reflect recent feedback. Summary:

  • Added an example usage section. Would love some feedback on this part!
  • Included Alibaba Cloud
  • Adjust Vercel's naming to Edge Light

We are still in the process of rebranding, but this new name and key represents our intended changes. Thank you again for the feedback!

index.bs Outdated Show resolved Hide resolved
Keys {#keys}
============

## Alibaba Cloud - edge-routine ## {#edge-routine}

The JavaScript/Webassembly runtime that powers Alibaba Cloud edge-routine.
Copy link
Contributor

Choose a reason for hiding this comment

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

is it JavaScript/Webassembly ? or just JS ? (I don't find any reference of webassembly on the doc - but only did a quick search)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just copied this comment: #2 (comment)

Choose a reason for hiding this comment

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

is it JavaScript/Webassembly ? or just JS ? (I don't find any reference of webassembly on the doc - but only did a quick search)
It is JavaScript/Webassembly. Currently, there is no doc for Webassembly but the doc will be updated to add Webassembly shortly.

Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com>
@QuiiBz
Copy link

QuiiBz commented Dec 18, 2022

Hi, as discussed on the WG chat, I would like to add another key for Lagon, an open-source runtime and platform I'm working on. This project is not backed by a big company or a VC but is bootstrapped and driven by the community. It's currently in development but will be stable in 2023:

## Lagon - Lagon Runtime ## {#lagon}

Lagon is an open-source runtime and platform that allows developers to run TypeScript and JavaScript Functions at the Edge.

Key: `lagon`

Website: [https://lagon.app](https://lagon.app)

Repository: [https://github.com/lagonapp/lagon](https://github.com/lagonapp/lagon)

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.

None yet