Comments (10)
- readable-stream is there to ensure the same latest Streams API is available across all platforms (see this old but I guess still relevant article)
- Without it, the gerber-* module test suites fail on 0.10
- It's actually not for browser purposes, because:
- By default, both webpack and browserify will automatically swap out core requires with user-land modules
- For streams, both happen to use readable-stream
- Here's the full list of swaps that webpack uses
- You can also override manually; in browserify, for example, you can use the browser field in package.json
The core EventEmitter API hasn't changed (enough) since 0.10 for (1) to be a problem, and for browser environments, (2) is handled by either the build system or the user. Finally, readable-stream depends on core events, so it's already in the browser build.
TL;DR - it's fine to just var EventEmitter = require('events').EventEmitter
from tracespace.
Failed parse should be pretty easy to detect by handling error or by looking for zero-size output (result.width === 0 || result.height === 0
). However, unless the layer is a drill, having more than one layer of the same type seems like a problem, no?
I've been toying with the idea of throwing an error in stackup-core if more than one of certain layer types is passed in. e.g. there should never be more than one top copper layer, etc. Any thoughts?
from tracespace.
Hmm, will think about this one and maybe try and do something before 2.0.0.
from tracespace.
What's the advantage of handling this in core as opposed to here?
from tracespace.
Doesn't really make a difference to me. I can't remember the reason why I wanted to do that in core, so I'm assuming it wasn't important hah
from tracespace.
Because we can probably still make the stackup with the layers we have I was just looking at creating warnings but there doesn't seem to be any convention. We could callback with an Error
but still have a stackup
as well. But there doesn't seem to be a normal way discern errors either which is annoying. Though we could actually do something like:
pcbStackup(layers, function(err, stackup) {
if(err.severity > 3) {
throw err
}
...
})
from tracespace.
I like the idea of warnings for this. I think the best warning solution would be to have pcbStackup return an EventEmitter with error
, warning
, and stackup
(or data
or done
or whatever
) events (and obviously keep the callback). That way:
pcbStackup(layers, handleStackupDone)
.on('warning', handleStackupWarning)
or even
pcbStackup(layers)
.on('error', handleStackupError)
.on('warning', handleStackupWarning)
.on('stackup', handleStackup)
from tracespace.
This one? https://github.com/Olical/EventEmitter
from tracespace.
Just meant core EventEmitter. It's easy enough for an end user to swap in a lightweight event-emitter module thru webpack / browserify configuration if needed for the browser.
from tracespace.
I don't have any experience with swapping in Node core modules. I see that in gerber-to-svg you depend on readable-stream. Wouldn't it make sense to depend on something like event-emitter here?
Edit: or maybe this: https://www.npmjs.com/package/events
from tracespace.
Related Issues (20)
- Provide easier way to get shareable to URL from tracespace viewer's uploaded gerber HOT 1
- Board size calculation error HOT 3
- How do I align the layers? HOT 1
- Incorrectly displaying triangle shape top and bottom SVG HOT 2
- top side outline clippath incorrect HOT 1
- Support rendering Allegro drill files with lots of missing information HOT 10
- About Use Three.js load 3d components
- Allow soldermask layer to cover vias in board render HOT 3
- Outline SVG is coming blank for a particular Gerber file and that is distorting the top and bottom view HOT 2
- Does whats-that-gerber parses and identifies whether slots or cutouts exist in a drill file?? HOT 9
- outline layer is not rendered correctly. HOT 2
- drill layer is not rendered correctly disturbed by origin HOT 2
- Incorrectly Rendered Board Outline HOT 1
- clipPath is not rendered correctly and set gap fill limit HOT 1
- Error: File type not recognized in v5 HOT 2
- About Allegro CAD drill's places HOT 2
- Error: NetworkError when attempting to fetch resource. HOT 2
- filled copper area traces are missing HOT 2
- drill layer not rendered correctly in v4 and v5
- gpu accelerated computing
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 tracespace.