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

node wrapper for dart:io #27349

Closed
jmesserly opened this issue Sep 14, 2016 · 9 comments
Closed

node wrapper for dart:io #27349

jmesserly opened this issue Sep 14, 2016 · 9 comments
Labels
dev-compiler-node type-enhancement A request for a change that isn't a bug web-dev-compiler

Comments

@jmesserly
Copy link

From @jmesserly on January 29, 2016 18:8

We can now compile & run on nodejs. But we don't have a dart:io impl.

Copied from original issue: dart-archive/dev_compiler#436

@jmesserly
Copy link
Author

From @Kleak on April 22, 2016 9:52

Hey maybe i can help on this task.

I'm wrapping nodejs with the js package : nodejs.dart
And a beginning of electron : electron.dart

The only problem i have is that i am not able to launch generated js file in node with this CL
dartdevc --v8-binary node -o build --modules node example/test_ddc_example.dart

it throw an error:

Error: Cannot find module 'dart/_runtime'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/kleak/Work/test_ddc/build/test_ddc_example.js:2:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

@jmesserly
Copy link
Author

From @vsmenon on April 22, 2016 12:26

Have you tried the preliminary node usage instructions near the end of #485 ?

@jmesserly
Copy link
Author

From @Kleak on April 22, 2016 12:37

Nop, thanks, i will retry with this :)

@jmesserly
Copy link
Author

yeah you may want to sync to "master" as well. The newer compiler won't generate "dart/_runtime" anymore, it should be trying to require("dart_sdk")

@jmesserly
Copy link
Author

From @Kleak on May 5, 2016 17:57

ok is there a starting point where i can look how to wrap an API ? Or is it the same as with the js package ?

@Kleak
Copy link

Kleak commented Sep 15, 2016

Has i have saied i have started a wrap of node.js, this wrap follow the node.js api.
My question is : do you want the api of this be the same as the dart api ?
if not i have move the source to github so you can take a look :)

nodejs.dart

All the api are not cover for the moment but the basic is almost here.

@bergwerf
Copy link

bergwerf commented Feb 9, 2017

Yeah this would be pretty cool. I'm building an HTML server and I want to use PugJS to render templates. I thought of creating a PugJS wrapper but realized dart:io server stuff is probably not portable to JavaScript. What is the current state of that?

@Kleak
Copy link

Kleak commented Feb 9, 2017

The library is here https://github.com/electron-dart
Not all the nodejs api is covered at this time but you have all the base.
Also this package follow the nodejs api and the electron api not the dart one.

If you have question dont hesitate yo open issues ;)

@munificent munificent added type-enhancement A request for a change that isn't a bug and removed Type: feature request labels Jun 22, 2018
@vsmenon
Copy link
Member

vsmenon commented Apr 24, 2019

No immediate plans to do this.

@vsmenon vsmenon closed this as completed Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-compiler-node type-enhancement A request for a change that isn't a bug web-dev-compiler
Projects
None yet
Development

No branches or pull requests

5 participants