The C++ bindings for the node serialport project. (Fork)
Find a file
renovate[bot] a8a7ca4b2a
chore(deps): update dependency esbuild to v0.18.4 (#120)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [esbuild](https://togithub.com/evanw/esbuild) | [`0.18.2` ->
`0.18.4`](https://renovatebot.com/diffs/npm/esbuild/0.18.2/0.18.4) |
[![age](https://badges.renovateapi.com/packages/npm/esbuild/0.18.4/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/esbuild/0.18.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/esbuild/0.18.4/compatibility-slim/0.18.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/esbuild/0.18.4/confidence-slim/0.18.2)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>evanw/esbuild</summary>

###
[`v0.18.4`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#&#8203;0184)

[Compare
Source](https://togithub.com/evanw/esbuild/compare/v0.18.3...v0.18.4)

- Bundling no longer unnecessarily transforms class syntax
([#&#8203;1360](https://togithub.com/evanw/esbuild/issues/1360),
[#&#8203;1328](https://togithub.com/evanw/esbuild/issues/1328),
[#&#8203;1524](https://togithub.com/evanw/esbuild/issues/1524),
[#&#8203;2416](https://togithub.com/evanw/esbuild/issues/2416))

When bundling, esbuild automatically converts top-level class statements
to class expressions. Previously this conversion had the unfortunate
side-effect of also transforming certain other class-related syntax
features to avoid correctness issues when the references to the class
name within the class body. This conversion has been reworked to avoid
doing this:

    ```js
    // Original code
    export class Foo {
      static foo = () => Foo
    }

    // Old output (with --bundle)
    var _Foo = class {
    };
    var Foo = _Foo;
    __publicField(Foo, "foo", () => _Foo);

    // New output (with --bundle)
    var Foo = class _Foo {
      static foo = () => _Foo;
    };
    ```

This conversion process is very complicated and has many edge cases
(including interactions with static fields, static blocks, private class
properties, and TypeScript experimental decorators). It should already
be pretty robust but a change like this may introduce new unintentional
behavior. Please report any issues with this upgrade on the esbuild bug
tracker.

You may be wondering why esbuild needs to do this at all. One reason to
do this is that esbuild's bundler sometimes needs to lazily-evaluate a
module. For example, a module may end up being both the target of a
dynamic `import()` call and a static `import` statement. Lazy module
evaluation is done by wrapping the top-level module code in a closure.
To avoid a performance hit for static `import` statements, esbuild
stores top-level exported symbols outside of the closure and references
them directly instead of indirectly.

Another reason to do this is that multiple JavaScript VMs have had and
continue to have performance issues with TDZ (i.e. "temporal dead zone")
checks. These checks validate that a let, or const, or class symbol
isn't used before it's initialized. Here are two issues with well-known
VMs:

- V8: https://bugs.chromium.org/p/v8/issues/detail?id=13723 (10%
slowdown)
- JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=199866 (1,000%
slowdown!)

JavaScriptCore had a severe performance issue as their TDZ
implementation had time complexity that was quadratic in the number of
variables needing TDZ checks in the same scope (with the top-level scope
typically being the worst offender). V8 has ongoing issues with TDZ
checks being present throughout the code their JIT generates even when
they have already been checked earlier in the same function or when the
function in question has already been run (so the checks have already
happened).

Due to esbuild's parallel architecture, esbuild both a) needs to convert
class statements into class expressions during parsing and b) doesn't
yet know whether this module will need to be lazily-evaluated or not in
the parser. So esbuild always does this conversion during bundling in
case it's needed for correctness (and also to avoid potentially
catastrophic performance issues due to bundling creating a large scope
with many TDZ variables).

- Enforce TDZ errors in computed class property keys
([#&#8203;2045](https://togithub.com/evanw/esbuild/issues/2045))

JavaScript allows class property keys to be generated at run-time using
code, like this:

    ```js
    class Foo {
      static foo = 'foo'
      static [Foo.foo + '2'] = 2
    }
    ```

Previously esbuild treated references to the containing class name
within computed property keys as a reference to the
partially-initialized class object. That meant code that attempted to
reference properties of the class object (such as the code above) would
get back `undefined` instead of throwing an error.

This release rewrites references to the containing class name within
computed property keys into code that always throws an error at
run-time, which is how this JavaScript code is supposed to work. Code
that does this will now also generate a warning. You should never write
code like this, but it now should be more obvious when incorrect code
like this is written.

- Fix an issue with experimental decorators and static fields
([#&#8203;2629](https://togithub.com/evanw/esbuild/issues/2629))

This release also fixes a bug regarding TypeScript experimental
decorators and static class fields which reference the enclosing class
name in their initializer. This affected top-level classes when bundling
was enabled. Previously code that does this could crash because the
class name wasn't initialized yet. This case should now be handled
correctly:

    ```ts
    // Original code
    class Foo {
      @&#8203;someDecorator
      static foo = 'foo'
      static bar = Foo.foo.length
    }

    // Old output
    const _Foo = class {
      static foo = "foo";
      static bar = _Foo.foo.length;
    };
    let Foo = _Foo;
    __decorateClass([
      someDecorator
    ], Foo, "foo", 2);

    // New output
    const _Foo = class _Foo {
      static foo = "foo";
      static bar = _Foo.foo.length;
    };
    __decorateClass([
      someDecorator
    ], _Foo, "foo", 2);
    let Foo = _Foo;
    ```

- Fix a minification regression with negative numeric properties
([#&#8203;3169](https://togithub.com/evanw/esbuild/issues/3169))

Version 0.18.0 introduced a regression where computed properties with
negative numbers were incorrectly shortened into a non-computed property
when minification was enabled. This regression has been fixed:

    ```js
    // Original code
    x = {
      [1]: 1,
      [-1]: -1,
      [NaN]: NaN,
      [Infinity]: Infinity,
      [-Infinity]: -Infinity,
    }

    // Old output (with --minify)
    x={1:1,-1:-1,NaN:NaN,1/0:1/0,-1/0:-1/0};

    // New output (with --minify)
    x={1:1,[-1]:-1,NaN:NaN,[1/0]:1/0,[-1/0]:-1/0};
    ```

###
[`v0.18.3`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#&#8203;0183)

[Compare
Source](https://togithub.com/evanw/esbuild/compare/v0.18.2...v0.18.3)

- Fix a panic due to empty static class blocks
([#&#8203;3161](https://togithub.com/evanw/esbuild/issues/3161))

This release fixes a bug where an internal invariant that was introduced
in the previous release was sometimes violated, which then caused a
panic. It happened when bundling code containing an empty static class
block with both minification and bundling enabled.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/serialport/bindings-cpp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTcuMyIsInVwZGF0ZWRJblZlciI6IjM1LjExNy4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-16 19:57:35 +00:00
.github fix: update build tools and fix arm64 build for rpi (#111) 2023-04-19 23:22:09 -04:00
bin fix: find arduino 2022-01-22 22:25:20 -05:00
lib chore: upgrade ts and fix type warnings (#91) 2022-11-16 22:09:25 -05:00
src fix: support wchar_t and Unicode encoding in .list() parameters (#63) 2022-11-16 20:28:51 -05:00
test chore: upgrade ts and fix type warnings (#91) 2022-11-16 22:09:25 -05:00
.eslintrc.js feat: migrate to typescript (#3) 2022-01-22 15:55:03 -05:00
.gitignore feat: migrate to typescript (#3) 2022-01-22 15:55:03 -05:00
.node-version feat: update to node 18, build with node 20, drop node 12 (#110) 2023-04-19 12:01:15 -04:00
.npmignore fix: npm ignore 2022-02-05 10:44:08 -05:00
.releaserc fix: prebuild upload path to a glob 2022-01-07 13:01:47 -05:00
binding.gyp fix: update build tools and fix arm64 build for rpi (#111) 2023-04-19 23:22:09 -04:00
CODE_OF_CONDUCT.md docs: formalize a governance model (#1667) 2018-09-17 22:31:05 -04:00
codecov.yml chore: update codecov because of deprecation (#52) 2022-03-04 23:44:32 -05:00
CONTRIBUTING.md chore: update org/repo urls (#1879) 2019-05-25 22:17:57 -04:00
LICENSE Pull README edits into the template and JS Doc 2017-06-18 21:24:51 -04:00
package-lock.json chore(deps): update dependency esbuild to v0.18.4 (#120) 2023-06-16 19:57:35 +00:00
package.json chore(deps): update dependency esbuild to v0.18.4 (#120) 2023-06-16 19:57:35 +00:00
README.md Update README.md (#109) 2023-04-19 10:29:06 -04:00
SECURITY.md Update SECURITY.md 2021-07-06 14:32:21 -04:00
tsconfig-build.json feat: migrate to typescript (#3) 2022-01-22 15:55:03 -05:00
tsconfig.json feat: new binding interface (#19) 2022-01-29 22:51:40 -05:00

@serialport/bindings-cpp

Backers on Open Collective Sponsors on Open Collective codecov Test / Lint

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Go to https://serialport.io/ to learn more, find guides and api documentation.

Bindings

The Bindings provide a low level interface to work with your serialport. It is possible to use them alone but it's usually easier to use them with an interface.

Developing

Developing node serialport projects

  1. Clone this repo git clone git@github.com:serialport/bindings-cpp.git
  2. Run npm install to setup local package dependencies (run this any time you depend on a package local to this repo)
  3. Run npm test to ensure everything is working properly
  4. If you have a serial loopback device (TX to RX) you can run run TEST_PORT=/path/to/port npm test for a more comprehensive test suite. (Defaults to 115200 baud customize with the TEST_BAUD env.) You can use an arduino with the test/arduino-echo sketch.

Developing Docs

See https://github.com/serialport/website

License

SerialPort packages are all MIT licensed and all it's dependencies are MIT licensed.

Code of Conduct

SerialPort follows the Nodebots Code of Conduct. While the code is MIT licensed participation in the community has some rules to make this a good place to work and learn.

TLDR

  • Be respectful.
  • Abusive behavior is never tolerated.
  • Data published to NodeBots is hosted at the discretion of the service administrators, and may be removed.
  • Don't build evil robots.
  • Violations of this code may result in swift and permanent expulsion from the NodeBots community.

Governance and Community

SerialPort is currently employees a governance with a group of maintainers, committers and contributors, all fixing bugs and adding features and improving documentation. You need not apply to work on SerialPort, all are welcome to join, build, and maintain this project.

  • A Contributor is any individual creating or commenting on an issue or pull request. By participating, this is you.
  • Committers are contributors who have been given write access to the repository. They can review and merge pull requests.
  • Maintainers are committers representing the required technical expertise to resolve rare disputes.

If you have a PR that improves the project people in any or all of the above people will help you land it.

Maintainers

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]