Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update highlight.js #1588

Closed
humphd opened this issue Jan 22, 2021 · 10 comments · Fixed by #1768 or #1763
Closed

Update highlight.js #1588

humphd opened this issue Jan 22, 2021 · 10 comments · Fixed by #1768 or #1763
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@humphd
Copy link
Contributor

humphd commented Jan 22, 2021

I notice a warning in our build for highlight.js:


  Verion 9 of Highlight.js has reached EOL.  It will no longer
  be supported or receive security updates in the future.
  Please upgrade to version 10 or encourage your indirect
  dependencies to do so.

  For more info:
  
  https://github.com/highlightjs/highlight.js/issues/2877
  https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md

@humphd humphd added the type: bug Something isn't working label Jan 22, 2021
@Metropass
Copy link
Contributor

@humphd Is this bug still present? I looked at package.json, and it seems like the latest version is 10.4.1

"highlight.js": "10.4.1",

@humphd
Copy link
Contributor Author

humphd commented Jan 25, 2021

I'm unclear why I saw it. Do we import it in multiple places and one of them is really old?

@Metropass
Copy link
Contributor

That's strange.
Is there anyway I could re-create the warning? I think one of the libraries that we're using must be running an older version of highlight.js

@HyperTHD HyperTHD added this to the 1.7 Release milestone Feb 2, 2021
@humphd
Copy link
Contributor Author

humphd commented Feb 2, 2021

$ npm list highlight.js
@seneca/telescope@1.5.0 /Users/humphd/repos/telescope
├─┬ bull-board@0.9.0
│ └─┬ react-highlight@0.12.0
│   └── highlight.js@9.18.5
└── highlight.js@10.4.1

@humphd
Copy link
Contributor Author

humphd commented Feb 2, 2021

It looks like bull-board is using this. We should update this dependency and/or remove it. Looks like it's been updated to 1.2 https://www.npmjs.com/package/bull-board

@yuanLeeMidori
Copy link
Contributor

@humphd

I've tested 1.2.0 of bull-board, it didn't pass our tests. I think the main reason is this error,

 FAIL  test/feed-queue.test.js
  ● Test suite failed to run

    TypeError: bullQueues.forEach is not a function

       9 |
      10 | // For visualizing queues using bull board
    > 11 | setQueues(queue);
         | ^
      12 |
      13 | /**
      14 |  * Provide a helper for adding a feed with our desired default options.

      at setQueues (node_modules/bull-board/src/index.ts:41:14)
      at Object.<anonymous> (src/backend/feed/queue.js:11:1)
      at Object.<anonymous> (test/feed-queue.test.js:3:1)

setQueue is not working due to the bullQueues.forEach not a function error.

https://github.com/vcapretz/bull-board/blob/82ca337dac03b8be1182f824ab343a5bc749e08d/src/index.ts#L40

Does that mean the problem here is in the package?

@humphd
Copy link
Contributor Author

humphd commented Feb 9, 2021

The API must have changed, looks like: https://github.com/vcapretz/bull-board/tree/82ca337dac03b8be1182f824ab343a5bc749e08d#hello-world. We need to wrap in a BullAdapter I guess and send as an Array of one element.

@yuanLeeMidori
Copy link
Contributor

@humphd
ohh okay it passes the test when I wrap it with BullAdapter. Thanks!

The other failure still exist, didn't pass with the setQueue wrapping.

 FAIL  test/feeds.test.js
  ● Test suite failed to run

    TypeError: Router.use() requires a middleware function but got a undefined

      11 |
      12 | // Only authenticated admins can use these routes
    > 13 | router.use('/queues', protectAdmin(true), UI);
         |        ^
      14 |
      15 | // Only authenticated admin users can see this route
      16 | router.get('/log', protectAdmin(true), (req, res) => {

      at Function.use (node_modules/express/lib/router/index.js:458:13)
      at Object.<anonymous> (src/backend/web/routes/admin.js:13:8)
      at Object.<anonymous> (src/backend/web/routes/index.js:5:15)

Is this failure complaining about the router.use() or the '/queues'? There was no such failure before upgrading to this version.

@humphd
Copy link
Contributor Author

humphd commented Feb 13, 2021

It is likely that the UI function isn't a middleware function now. Can you see what it is?

@birtony
Copy link
Contributor

birtony commented Feb 17, 2021

highlight.js was updated in #1763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
5 participants