Giter VIP home page Giter VIP logo

Comments (10)

mcous avatar mcous commented on June 13, 2024 1
  1. 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:
  2. By default, both webpack and browserify will automatically swap out core requires with user-land modules

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.

mcous avatar mcous commented on June 13, 2024

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.

kasbah avatar kasbah commented on June 13, 2024

Hmm, will think about this one and maybe try and do something before 2.0.0.

from tracespace.

kasbah avatar kasbah commented on June 13, 2024

What's the advantage of handling this in core as opposed to here?

from tracespace.

mcous avatar mcous commented on June 13, 2024

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.

kasbah avatar kasbah commented on June 13, 2024

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.

mcous avatar mcous commented on June 13, 2024

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.

kasbah avatar kasbah commented on June 13, 2024

This one? https://github.com/Olical/EventEmitter

from tracespace.

mcous avatar mcous commented on June 13, 2024

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.

kasbah avatar kasbah commented on June 13, 2024

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)

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.