index.js has an arrow function causing prosemirror not transpiled correctly for ie11 #3

Closed
opened 2019-11-27 21:27:14 +01:00 by vuduo · 6 comments
vuduo commented 2019-11-27 21:27:14 +01:00 (Migrated from github.com)

Hi

there is an arrow function leftover in the index.js code

this.forEach((elt, i) => result.push(f(elt, i)), from, to)

in

  // :: ((element: T, index: number) → U, ?number, ?number) → [U]
  // Map the given functions over the elements of the rope, producing
  // a flat array.
  map(f, from = 0, to = this.length) {
    let result = []
    this.forEach((elt, i) => result.push(f(elt, i)), from, to)
    return result
  }

causing prosemirror not to work in ie11. Could you please fix this.

Best regards

Hi there is an arrow function leftover in the index.js code `this.forEach((elt, i) => result.push(f(elt, i)), from, to)` in ``` // :: ((element: T, index: number) → U, ?number, ?number) → [U] // Map the given functions over the elements of the rope, producing // a flat array. map(f, from = 0, to = this.length) { let result = [] this.forEach((elt, i) => result.push(f(elt, i)), from, to) return result } ``` causing prosemirror not to work in ie11. Could you please fix this. Best regards
marijnh commented 2019-11-27 22:18:54 +01:00 (Migrated from github.com)

Which version are you using? I don't see any ES6 in dist/index.js in 1.3.2

Which version are you using? I don't see any ES6 in dist/index.js in 1.3.2
vuduo commented 2019-11-27 23:31:16 +01:00 (Migrated from github.com)

I am using prosemirror-history 1.1.2. Looks like that version uses rope-sequence 1.3.0.

In the index.js file in line 64, there is an arrow function after the forEach statement. This seems not to be transpiled correctly into the dist/index.mjs

I am using prosemirror-history 1.1.2. Looks like that version uses rope-sequence 1.3.0. In the index.js file in line 64, there is an arrow function after the forEach statement. This seems not to be transpiled correctly into the dist/index.mjs
marijnh commented 2019-11-28 07:49:28 +01:00 (Migrated from github.com)

But package.json only references dist/index.js, so I'm confused why the ES6 file would be getting bundled.

But package.json only references dist/index.js, so I'm confused why the ES6 file would be getting bundled.
vuduo commented 2019-11-28 07:59:45 +01:00 (Migrated from github.com)

I am using webpack 4.41.2 for bundling. Looks like it prioritize module field over main causing it to bundle the index.mjs. So looks like i have to find a way to tell webpack to use the main field to get the dependency.

I am using webpack 4.41.2 for bundling. Looks like it prioritize module field over main causing it to bundle the index.mjs. So looks like i have to find a way to tell webpack to use the main field to get the dependency.
marijnh commented 2019-11-28 08:04:33 +01:00 (Migrated from github.com)

module points at dist/index.es.js, which also does not contain the string =>.

module points at `dist/index.es.js`, which also does not contain the string `=>`.
vuduo commented 2019-11-28 08:12:46 +01:00 (Migrated from github.com)

Now I see. Had to refetch prosemirror-history 1.1.2 for it to fetch the updated rope-sequence. Thanks for helping me out.

Now I see. Had to refetch prosemirror-history 1.1.2 for it to fetch the updated rope-sequence. Thanks for helping me out.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
marijn/rope-sequence#3
No description provided.