-
Notifications
You must be signed in to change notification settings - Fork 17
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
Remove module shim for browser #37
Conversation
Maintainer: After this you should build highlight.js with this repo in the |
My only questions here are:
Otherwise, whatever works, right? :) |
I really can't tell if this would be a breaking change. But it does seem that we need to implement the new recommendations for highlightjs plugins. |
OK, are you going to include that in this or should one of us do that separately later? |
I see them as the same issue. I can do it tomorrow unless you're eager to ship it earlier. |
No, no actual rush here. I just get antsy sometimes. :P |
I started looking at this but I have some reservations about the setup proposed in highlightjs/highlight.js#3008 so I left a comment over there before moving forward. |
The bottom part should also be removed. All that is necessary is:
or
Our build system should be happy with either. The CDN distributable will automatically include the OR you don't have to point |
Ran into this today. Currently floating a git fork by installing it top level with the shim removed. "highlightjs-solidity": "github:little-core-labs/highlightjs-solidity", |
Decided to switch to using patch-package. Would love to get this simple fix in. |
OK, since @frangio doesn't have time anymore, I guess I'll take over this PR? I'd like to get this through. Only question is: Is this a breaking change? Will we have to bump the major version number if we do this? I don't want to merge until that's answered! |
Thanks for taking over this. I would say the safe thing is to release a new major. |
OK, I'll do that when I have some time soon, then! |
OK @joshgoebel I want to get back to this and actually get this merged... is this comment still applicable? Also, what is the "bottom part" that should be removed? Are there other changes I need to make to this? Assuming I don't want to go adding to much, and just want to get this working for people without them having to do ridiculous things? Sorry, I realize all this has probably been answered before in some form, but reading over the discussion I find it doesn't entirely clear things up for me, so I thought I should ask again. |
Yes, the shim should not be necessary. The "preferred" way to ship a 3rd party grammar module is as a Node library and a separate web build in the dist folder. No shim is needed. |
Yes, the problem is I was kind of hoping to avoid having to set up webpack or whatever other build system! Which is why I'm asking about if I can get away with just adding that "CJS" comment and other such simple things. :) |
There is no magic in any comment. I was only saying/showing that per our "spec" the only content that really should be in the file is a single default exported function. If your following the developer docs Highlight.js does the build for you, there is no need for other build systems. |
Oh! Silly me, the comments were just illustrative, not magic. Sorry, as I guess you can tell, my job is normally getting the logic right, build systems are fairly arcane to me. :) So does that mean this can be merged then without any additional work? That would sure be nice! |
If you are using the documented build process to build your dist folder, yes. |
Ah, I hadn't been following any build process, just publishing things as-is. OK, I guess whoever publishes this will have to look up and run this documented build process before publishing, then, once this is merged...? (Sorry for the obvious questions, like I said, this sort of thing is not really my area...) |
Typically 3rd party maintainers should work on their grammars INSIDE a HLJS checkout:
Then to generate
And the necessarily CDN files are dropped into your |
OK, I'm really confused here. You're saying the I'm also confused by the following:
By "just checking them into git" -- checking what into git, and doing just that as opposed to what? And is this a simple module? Are you saying that I can skip any build process here, and continue just publishing with no build as I've been doing? Or no? (Because if I can, that's what I am going to do!) Also, when you talk about working inside an HLJS checkout, would that be using git submodules? Actually I'm confused about how working inside an HLJS checkout would work when this language isn't part of the |
Sure, if you want to setup a complex build pipeline and official releases, etc... the super easy way to do it is run the script,
I'd worry you'd be broken in the browser (since there is no For a perfect example (CJS): https://github.com/highlightjs/highlightjs-robots-txt/blob/master/src/robots-txt.js
No, just checkout your repo into the
Our build process treats the The automated security checks alone are a REALLY GOOD reason to use our build process.
Nope, |
Oh, nice, it's in |
OK, cool, I think I get how this works, I'll go ahead with this soon. :) |
OK, time to finally pull the trigger on this! |
Fixes #36