Giter Site home page Giter Site logo

Comments (4)

GianlucaGuarini avatar GianlucaGuarini commented on August 20, 2024

@talee you can't use both the preprocessors (riot and babel) together. Your javascript gets processed only once either by babel or riot, combining both it's not possible (and it's dangerous). This does not mean that you can not build your own adding special plugin to parse that kind of expressions

from compiler.

talee avatar talee commented on August 20, 2024

@GianlucaGuarini - Thanks for the explanation! Does the Riot preprocessor do anything else besides transpile ES6 method definitions for tag instances? It would be good to know if there any other situations where I should not use Riot specific syntax.

Running riot --type babel component.tag is not clear to the user that the Riot preprocessor is being executed. If mixing Riot and Babel preprocessors is illegal/indeterminate, we should suppress the Riot preprocessor when a --type option is passed.

A bonus would be to document this so people using ES6 and following Riot syntax for custom tags aren't confused: http://riotjs.com/guide/compiler/#pre-processors.

from compiler.

aMarCruz avatar aMarCruz commented on August 20, 2024

@talee, the default riot parser does nothing more than remove comments and transpile ES6 method definitions.

As @GianlucaGuarini said, you can use only one JS parser, no one example shows method shortcuts of the riot parser with babel.

from compiler.

aMarCruz avatar aMarCruz commented on August 20, 2024

Closing this issue, the answer is clear.

from compiler.

Related Issues (20)

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.