Comments (6)
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.
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.
This will be scheduled for version 2 since it's a breaking change.
from js-async-init.
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.
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.
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:
- ESM migration
- Supply classes of errors instead of supplying error instances
- Specify arg dictionary when using
@CreateDestroyStartStop
from js-async-init.
Related Issues (7)
- Make Decorators workable for Abstract Classes and Getter Properties HOT 6
- Upgrade Mutex to RWLock to enable `ready(undefined, true);` to mean blocking async operation HOT 1
- Allow ready decorator to opt in to being callable with allowed status "exceptions" HOT 1
- Get a useful stack when exceptions are thrown HOT 2
- The `ready` decorator should be capable of decorating regular functions returning promises, generators or async generators HOT 3
- Async creation function requires the usage of `new this()` not `new ClassName()` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-async-init.