haraka / node-address-rfc2821

RFC2821 Email Address parser (from Haraka)
https://www.npmjs.com/package/address-rfc2821
13 stars 6 forks source link

nearley output is incompatible with node.js < 11 #39

Closed msimerson closed 3 years ago

msimerson commented 3 years ago

nearly produces output that uses array.flat() which doesn't exist in node < 11. Nearly installs just fine, it compiles the grammar.js file, but then when Haraka calls it it crashes because .flat doesn't exist.

I see a couple options:

  1. revert the 1.x branch of this module to the pre-nearley version. Then publish this module with those changes as a 2.x branch. When Haraka drops support for node 10 in a few months, we can update to the newer major version.
  2. drop node.js 10.x support now.
  3. add Array.prototype.flat polyfill to the grammar.js file
  4. ???
gene-hightower commented 3 years ago

I opened an issue at https://github.com/kach/nearley/issues/564 to ask about this.

baudehlo commented 3 years ago

Wouldn’t a good option be to polyfill it?

On Jan 5, 2021, at 6:49 PM, Gene Hightower notifications@github.com wrote:

 I opened an issue at kach/nearley#564 to ask about this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

msimerson commented 3 years ago

We could, but flat might not be the only call nearley generates that requires node > 10.

Update: testing seems to indicate that it is.

gene-hightower commented 3 years ago

I've started using https://github.com/andris9/mailauth which requires node 14.

gene-hightower commented 3 years ago

Is the plan for Haraka to maintain support for Node 10 until it's official end-of-life date of 2021-04-30?

msimerson commented 3 years ago

Our Standard Operating Procedure is to support the versions of node.js that are supported upstream. Being this close to EOL, I was feeling it was okay to drop 10.x early, but then I considered the users of this module that aren't using it in Haraka. Since this turned out to be a breaking change, it really deserved a semver major bump.

gene-hightower commented 3 years ago

It's worthy of a major version, I agree.