Coder Social home page Coder Social logo

Comments (6)

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

This would be a breaking change, and would require fixes to all other downstream repos to change to the class. A large find & replace.

from js-async-init.

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

In the timed usage (MatrixAI/Polykey#297 (comment)), I've found more information is more useful. So I think in the case here, we may not really need to reset the stack trace at all once we have switched to using error class constructors instead of error instances.

It would give us a useful stack trace during debugging.

from js-async-init.

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

This will be scheduled for version 2 since it's a breaking change.

from js-async-init.

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

That means the resetStackTrace utility function can just be completely removed. And we just get the full information about the stack trace where it is thrown.

from js-async-init.

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

This means for example in the function CreateDestroyStartStop, it currently takes the errorRunning and errorDestroyed as full Error instances.

Instead it should take Class<Error>, so it can be constructed in the appropriate place.

Same for the ready functions, it should just take Class<Error> as well so it can be properly constructed.

from js-async-init.

CMCDragonkai avatar CMCDragonkai commented on June 3, 2024

See #32. It has to be done first, before this issue can be resolved. Then a mass ESM migration can occur at the same time as doing the this issue's breaking changes.

The CreateDestroyStartStop should just take the full args as dictionary rather than taking errorRunning, then errorDestroyed. It should just take { errorRunning, errorDestroyed, eventStart, ... }.

Then breaking changes mean:

  1. ESM migration
  2. Supply classes of errors instead of supplying error instances
  3. Specify arg dictionary when using @CreateDestroyStartStop

from js-async-init.

Related Issues (7)

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.