holtwick / zeed-dom

🌱 Lightweight offline DOM
MIT License
33 stars 5 forks source link

The dist contains nullish coalescing operator. #6

Closed lecion closed 1 year ago

lecion commented 1 year ago

The dist contains nullish coalescing operator:

parseAttributes(tagName, input) {
    const attrs = {};
    input.replace(
      this.attrRe,
      (attr, name, c2, value, c4, valueInQuote, c6, valueInSingleQuote) => {
        attrs[name] = valueInSingleQuote ?? valueInQuote ?? value ?? true;
      }
    );
    return attrs;
  }

Older browsers cannot run this code correctly.

holtwick commented 1 year ago

Thank you very much for identifying this issue. I set the Tyescript target to "ES2019" now. Hope this fixes the issue.

lecion commented 1 year ago

Thank you very much for identifying this issue. I set the Tyescript target to "ES2019" now. Hope this fixes the issue.

Thanks a lot, it's fixed in the 0.10.4.

pavan-sunkara-qatalog commented 1 year ago

I am encountering this with 0.9.26 which is used in https://tiptap.dev/. How do I fix it? Will you release a 0.9 patch?

holtwick commented 1 year ago

Thanks for letting me know. I'll take a look if either TipTap should update its dependency or if a 0.9 fix makes sense.

pavan-sunkara-qatalog commented 1 year ago

I ended up working around this, but I think it's worth fixing it in a patch release.

holtwick commented 1 year ago

I came to the conclusion, that this requires a change from TipTap's side. In my opinion the 0.10 versions of zeed-dom should not have any incompatibilities. If you like to see that change, please add a ticket in their project to update this file https://github.com/ueberdosis/tiptap/blob/bdc51d12b513e8d395e2aefa52ad890e4f2478a7/packages/html/package.json#L40 Thanks.