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 refractor to 4.1.0 #10

Open
BrendanThompson opened this issue Jul 28, 2021 · 7 comments
Open

Update refractor to 4.1.0 #10

BrendanThompson opened this issue Jul 28, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@BrendanThompson
Copy link

Would it be possible have this using Refractor 4.1.0 as there are a few more languages in there as well as an updated version of Prism.

I did fork this to attempt myself, but unfortunately my JS skills are trash.

@j0lvera j0lvera added the enhancement New feature or request label Jul 28, 2021
@j0lvera
Copy link
Owner

j0lvera commented Jul 28, 2021

@BrendanThompson yeah it's an easy change I think I will do it in the next few days. Unless you want to give it a try and I can help you out.

@BrendanThompson
Copy link
Author

@j0lv3r4 – I think it would probably best if I just let you do it to be honest.

@BrendanThompson
Copy link
Author

Hey @j0lv3r4 – I don't suppose you've had any opportunity to do this have you?

@reesscot
Copy link

reesscot commented Oct 4, 2021

Hi @j0lv3r4 I'm interesting in helping get this updated, as refractor 4.x includes a security update for prismjs. I tried pulling down this repo and bumping refractor but when I ran the yarn test it fails:

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

    /Volumes/workplace/mdx-prism/node_modules/refractor/index.js:8
    export {refractor} from './lib/common.js'
    ^^^^^^

    SyntaxError: Unexpected token 'export'

Examing the refractor codebase, it looks like they moved from CommonJS modules to ESM when they bumped to 4.x. How would you like to support an ESM import in this repo?

@j0lvera
Copy link
Owner

j0lvera commented Oct 4, 2021

@reesscot sure!

Sorry, I misunderstood what you said. I have no idea honestly. do you have any recommendations? I don't have experience moving a library to ESM.

@j0lvera
Copy link
Owner

j0lvera commented Oct 4, 2021

@reesscot OK, so I have an idea of how to do it. I think we need to do a major release and move entirely to ESM.

The reason is that our main dependency already did it, so I guess it makes sense for us to do it. Even if we tried to keep it a dual CJS/ESM module, the main dependency has already moved on.

Resources:

@nirmalathapa
Copy link

Hi @j0lv3r4 I would to point out that there is a high security risk due to this refractor package.

Screenshot 2022-11-16 at 18 26 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants