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 external dependencies #86

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Update external dependencies #86

merged 2 commits into from
Oct 26, 2023

Conversation

tvdijen
Copy link
Member

@tvdijen tvdijen commented Sep 19, 2023

Needs testing, but the changelogs give no reason to expect any issues

@khlr khlr self-requested a review September 21, 2023 07:22
Copy link
Contributor

@khlr khlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Tim!

Thanks for helping to keep up with the dependencies!

I think there's no problem in replacing pako 2.0.4 with 2.1.0.
Looking at the diff there seems to be literally a single change in pako_inflate.min.js: the version number 😁
This is hardly surprising surprising (if I don't overlook something) since pako's changelog is quite easy to grasp.

But something seems to be wrong with highlight.js:

main:

image

PR:

image

Could you please have a look at this issue?

I used https://stubidp.sustainsys.com for testing.

@tvdijen
Copy link
Member Author

tvdijen commented Sep 21, 2023

Hmm, I just realized I've seen this same issue elsewhere ... Seems they have changed some defaults between 11.3 and 11.8 or something

@khlr
Copy link
Contributor

khlr commented Sep 30, 2023

What's a bit strange: I can't reproduce the unwanted behaviour out of SAML-tracer. Have a look at this fiddle: https://jsfiddle.net/fkwb3p8e/1/

There's a token string assigned to a div's textContent-property. It's done pretty much the same way as SAML-tracer does it.
But in the fiddle the whole token gets highlighted correctly...

Any ideas?

@tvdijen
Copy link
Member Author

tvdijen commented Oct 10, 2023

The only possible explanation I found is in the highlight.js docs:

We strongly recommend <pre><code> wrapping for code blocks. It's quite semantic and "just works" out of the box with zero fiddling. It is possible to use other HTML elements (or combos), but you may need to pay special attention to preserving linebreaks.

I think maybe that's that we're seeing in your screenshot..

@khlr
Copy link
Contributor

khlr commented Oct 24, 2023

I saw that recommendation, too. But I'm not sure it "applies" to us. SAML-tracer has always represented the highlighting token this way and never used a <code> tag
Sure, the argument "we have always done it this way" is not exactly the best now 😁 But I just wonder why it should cause problems right now.

And the hint only talks about line breaks... 🤔

@tvdijen
Copy link
Member Author

tvdijen commented Oct 24, 2023

I guess the highlight package has changed over time too...
We have the same problem in SimpleSAMLphp where we use highlight.js to highlight metadata XML.. The entire color scheme has changed during the upgrade, but nothing in the changelog that could possibly explain this.

@khlr
Copy link
Contributor

khlr commented Oct 26, 2023

I took the liberty to update hljs to version 11.9.0. Whatever was changed with this version... The highlighting works now in any case again as desired...

@tvdijen: Would you please have a look, too?

@khlr
Copy link
Contributor

khlr commented Oct 26, 2023

Hmmm... I just took a look at the diff in our repo from version 11.8.0 to 11.9.0:
Search for the string registerLanguage(".
Did you just include the JavaScript-package? When I downloaded hljs today, I included HTTP and XML. Those two packages are required for the highlighting in SAML-tracer. Maybe this was just the cause for the incorrect highlighting, as hljs tried to highlight the token as JavaScript?

@tvdijen
Copy link
Member Author

tvdijen commented Oct 26, 2023

I just googled to get an updated version of the highlight.min.js file.. I was not aware of any additional packages. How did you update to 11.9?

@tvdijen
Copy link
Member Author

tvdijen commented Oct 26, 2023

Ah, I think I understand where I went wrong :') Good to know this, because I was going to create a workflow for auto-updating our dependencies, but this means I have to build a custom highlight.min.js package

@khlr
Copy link
Contributor

khlr commented Oct 26, 2023

Ah ok :-)

Here you can define the included packages. That's where I picked XML and HTTP. I then downloaded the ZIP file and took the highlight.min.js file.

@khlr
Copy link
Contributor

khlr commented Oct 26, 2023

I was going to create a workflow for auto-updating our dependencies

Very interesting! How are you going to achieve this? Using GitHub actions or something?

Copy link
Contributor

@khlr khlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the PR: From my perspective everything seems to look ok and you can merge the PR 😊

@tvdijen
Copy link
Member Author

tvdijen commented Oct 26, 2023

Let me rephrase that:

My goal was to migrate the build-script to actions:
main...feature/autobuild

Now, this will work because the NPM-package for Highlight.js includes all 190-something languages. I could slightly improve this by building my own highlight.min.js file based on highlight.js/core + the two language packs, but since this is an extension and not a package transfered over the line, the added value would be minimal.

@khlr
Copy link
Contributor

khlr commented Oct 26, 2023

That sounds really promising, Tim!

However I would suggest that we should discuss this in another issue resp. alongside another PR's discussion, do you agree?

Do you agree then in merging this PR here?

@tvdijen tvdijen merged commit c5f77e9 into main Oct 26, 2023
@tvdijen tvdijen deleted the feature/dependencies branch October 26, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants