GithubHelp home page GithubHelp logo

flutter astprint about astprinter HOT 5 OPEN

gekorm avatar gekorm commented on July 20, 2024
flutter astprint

from astprinter.

Comments (5)

fangkyi03 avatar fangkyi03 commented on July 20, 2024 2

At present, the biggest problem is that flutter is imported through package.

This is completely different from ts or JS

So the d.ts file cannot be generated if TS is used for editing.

So I would like to write a script like Babel that converts all flutter code into ts.

This facilitates writing and completes the effect in this way.

from astprinter.

GeKorm avatar GeKorm commented on July 20, 2024

Hi @fangkyi03, thanks for your interest in astprinter!

This is currently a command line tool which works with files. It will take a file in, and it will output AST as a string. You can't use it programmatically as a library.

However, it won't be hard to make it into a library, I'd be interested in doing that. Would you mind sharing how you'd like to ideally use it? What sort of features are important to you?

Thanks

from astprinter.

fangkyi03 avatar fangkyi03 commented on July 20, 2024

Hello, I actually have an idea that I want to convert flutter code into ts.

It also supports converting TS code into flutter

After all, the code in the flutter section is really too verbose.

I want to write flutter in a react-like way

In order to get through all the mobile phone development links

from astprinter.

GeKorm avatar GeKorm commented on July 20, 2024

This is great! I've long been wishing flutter was more react-like.

So astprinter may not be that useful to you in this case, as all it does is output the entire AST as a string. This is usually helpful to have as a reference while developing a transformer that acts on the actual AST with its type information intact.

Take a look at how this package uses the analyzer to parse and traverse a file's AST. Here's an example that transforms JSX (DSX) to regular Flutter code https://spark-heroku-dsx.herokuapp.com/index.html

from astprinter.

fangkyi03 avatar fangkyi03 commented on July 20, 2024

I found a way to write react directly in dart and use Babel or TS directly without using flutter's AST transformation.

from astprinter.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.