Giter Club home page Giter Club logo

Comments (6)

jorgebucaran avatar jorgebucaran commented on May 5, 2024 1

@rbiggs SourceMaps are now available:

from hyperapp.

rbiggs avatar rbiggs commented on May 5, 2024 1

Yup, I just noticed. Thanks. Will make it a whole lot easier to debug now.

from hyperapp.

tunnckoCore avatar tunnckoCore commented on May 5, 2024

Yea. Rollup with rollup-plugin-buble and rollup-plugin-uglify and passing just sourceMap: true to Rollup, gives zero config and sourcemaps.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on May 5, 2024

Hi @rbiggs, can you share how you are using source maps to debug? I don't use them, so I really wasn't paying much attention when this issue was created, but now that I thought about it a bit, hyperapp is written in ES5, so what's the benefit of distributing a source map?

See below.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on May 5, 2024

@dodekeract Are you using https://unpkg.com/[email protected]/dist/hyperapp.js.map?

See below.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on May 5, 2024

I was using a dev server to test hyperapp. In production you'll be using the minified/uglified version of hyperapp, so sourcemaps are very useful to have!

The last line in hyperapp.js

//# sourceMappingURL=hyperapp.js.map

makes the Dev Console download/load hyperapp's source map during a debug session, when an exception occurs, etc.

Without source maps 😞

screen shot 2017-04-07 at 12 41 36

screen shot 2017-04-07 at 12 41 47

With source maps 😄

screen shot 2017-04-07 at 12 42 01

screen shot 2017-04-07 at 12 42 08

How to enable source maps?

  • When you grab the minified hyperapp from the CDN, you don't have anything to do because the sourcemap link is already embedded in the file.

  • When you bundle your app with hyperapp.js yourself, it's up to you to generate sourcemaps, just like we generate sourcemaps for hyperapp in this repo. This is easy to do with webpack, rollup, etc.

from hyperapp.

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.