vojtajina / js2dart Goto Github PK
View Code? Open in Web Editor NEWCompile JavaScript to Dart so that you can compile it back to JavaScript and run.
Compile JavaScript to Dart so that you can compile it back to JavaScript and run.
class Foo {
constructor() {
this.x:Foo = null;
}
}
Unnecessarily changes generated files in case they are checked in or published somewhere.
var x:Foo = null;
Helps in rewriting method names for built ins like arrays, ...
... so you could compile js2dart using js2dart to Dart, so you could compile it back to JS and use it to compile JS to Dart, then compile is back and run it :)
@field
annotationconst constructor
s in Dart through @const
annotationExample:
class Annotation {
@field('final name:String')
@field('final age:int')
@const constructor(name:String, age:int) {
this.name = 'Hello ' + name;
this.age = age + 0;
}
}
@Annotation('usage')
class Foo {}
this needs to transpile to:
class Annotation {
final String name;
final int age;
const Annotation(String name, int age):
name = 'Hello ' + name,
age = age + 0;
}
@Annotation('usage')
class Foo {}
This tool is awesome, please continue developing it. Porting libraries would be a breeze. But can it also help converting Polymer elements from javascript to Polymer.Dart, including HTML templates? That would require to add some semantic conversion on top of the syntactic, but it would be worthwile. Please consider this.
How is this used? For instance, I have a .js file I'd like to convert to a .dart file. Is this what this tool is for? If so, how do I run/use it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.