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

Deno Support? #1964

Open
KartoffelToby opened this issue May 18, 2020 · 6 comments
Open

Deno Support? #1964

KartoffelToby opened this issue May 18, 2020 · 6 comments
Labels

Comments

@KartoffelToby
Copy link

is there any plan to Support the deno runtime?

@daffl daffl added this to the v5 (Dove) milestone May 19, 2020
@daffl
Copy link
Member

daffl commented May 19, 2020

Yes. The new @feathersjs/hooks is already Deno compatible with the rest of core to follow in v5 (Dove). To clarify, this applies only to

  • Feathers core (@feathersjs/feathers)
  • Authentication with JWT and local login
  • A Deno transport for REST (and possibly Websockets)
  • The feathers-memory database adapter

Any other Feathers plugins that rely on third party modules are likely not going to work until there is a Deno equivalent for those third party modules. This means the following things are likely not going to be available right away:

  • Other database adapters (no Sequelize, Mongoose etc.)
  • oAuth (for now)
  • GraphQL, JSON schema etc.

@apollo79
Copy link

Is this still being worked on?

@miguelrk
Copy link

miguelrk commented Jan 18, 2023

Starting from [email protected], npm compatibliity is now marked stable. I've successfully migrated some Node.js projects to deno and adding npm prefix to import {} from "npm:package-name" with import_map.json.

What in my opinion is great about Deno it how it pushes the ecosystem forward in terms of standards, so targeting node from deno with tools like dnt (a deno to npm package build tool) makes sense for a development workflow. Also, the fact Deno has built-in formatting, linting, removes the need for node_modules, package*.json, etc greatly enhances DX.

If this is still being considered, I think now might finally be an adequate time to do so (or actually continue to do so, there has been progress in other branches). Would moving the whole ecosystem e.g. packages like @feathersjs/mongodb be in order?

The following script can be used to convert dependencies in package.json to a valid import_map.json:

// main.ts - run with: `deno run -A main.ts`
const text = await Deno.readTextFile(`${Deno.cwd()}/package.json`);
const deps = JSON.parse(text).dependencies;

const importMap = {
  imports: {
    ...Object.keys(deps).reduce((acc, dep) => {
      acc[dep] = `npm:${dep}@${deps[dep].replace("^", "")}`;
      return acc;
    }, {}),
  },
};

await Deno.writeTextFile(
  `${Deno.cwd()}/importMap.json`,
  JSON.stringify(importMap, null, 2)
);

@apollo79
Copy link

apollo79 commented Jan 18, 2023

I've done some work in this PR: #2828

The plan was to use dnt to support node and deno but it turned out that that isn't as easy as it sounds... And there are some decisions to make, that should not be made by me but by the core members.

That's the reason why I stopped working on it until dove is stable and @daffl and the other core members can focus more on deno. There has been even opened a channel for deno development and questions in the feathers discord: https://discord.com/channels/509848480760725514/1042225783042736179

The first message in the channel summarizes the work that is done until now and some of the problems I encountered.

But maybe @daffl can give a better answer about the current plan for deno.

@miguelrk
Copy link

Thanks for the thorough overview @apollo79 ! I will stick around 👍🏼

@Abdillah
Copy link

Now Deno has npm package support. Improving the framework user experience on Deno (compat, getting started, permission, etc) can be a huge plus before really migrating to Deno APIs.

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

No branches or pull requests

5 participants