Git Product home page Git Product logo

Comments (5)

jmaupetit avatar jmaupetit commented on May 24, 2024

If I understand well, it means that we will have two consecutive code transpilation phases (TS+babel). Don't you think this will make debugging rather complex? Does it worth it? Is this the way to go with TS?

from richie.

mbenadda avatar mbenadda commented on May 24, 2024

Don't you think this will make debugging rather complex?

Source maps are working. Do you have other concerns? How would it make debugging more complex than with just TS?

Is it worth it? Is this the way to go with TS?

I think it is. Tooling for i18n string extraction is pretty thin on the ground, so if we have a simple, working, automated solution it's definitely worth adding a little bit of complexity to the build config IMO.

from richie.

jmaupetit avatar jmaupetit commented on May 24, 2024

Source maps are working.

I may have misunderstood how a second loader (i.e. babel) will work: source maps from TS will be generated from the TS loader, and then babel will generate (or overwrite) a new source maps version from compiled TS?

In this case, a babel-related bugs may be hard to track. I might be wrong on this, please enlighten me.

from richie.

mbenadda avatar mbenadda commented on May 24, 2024

Source maps mean errors, logs, etc. get associated with the actual call site in the TypeScript source. Babel does generate new source maps based on the ones TS generated (otherwise we could not associate the final code to the actual source).

In this case, babel-related bugs may be hard to track

Because the ES6 babel compiles from is an intermediate representation that does not get written to disk? Indeed, you would have to output the ES6 itself from typescript to take a look at it.

However, I would argue that such bugs would be a rare occurence. Babel is mature (more so than TS I'd say) and I would be amazed if we actually ran into a bug in it when compiling vanilla ES6. Combining TS & babel is not exotic and mostly works out of the box.


Bugs in our own code (or regular deps) which would constitute >99% of debugging work will be straightforward to pinpoint with source maps.

from richie.

jmaupetit avatar jmaupetit commented on May 24, 2024

Thanks for this explanation. I put my trust in you. Let's do this!

from richie.

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.