Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Remove jQuery #85

Closed
BennyHinrichs opened this issue Oct 12, 2019 · 9 comments
Closed

Remove jQuery #85

BennyHinrichs opened this issue Oct 12, 2019 · 9 comments

Comments

@BennyHinrichs
Copy link
Contributor

I would be willing to go through and remove jQuery from the codebase. Before I do, I just want to know if that would be desired and merged?

@Gerrit0
Copy link
Contributor

Gerrit0 commented Oct 13, 2019

👍 I'd definitely be in favor of this, the default theme is really quite simple, it doesn't do very much and includes both jQuery and Lodash in order to do it, which feels at least a bit overkill.

I know @aciccarello was concerned about changing the exposed surface of the typedoc global, but I just looked through the most popular themes and none of them added anything on to the existing JS, they either left it as is or replaced it completely.

@BennyHinrichs
Copy link
Contributor Author

BennyHinrichs commented Oct 15, 2019

Behold: https://github.com/BennyHinrichs/typedoc-default-themes/tree/remove-jquery

It looks we still have to have both jQuery and Underscore in the dependencies because of Backbone?

@Gerrit0
Copy link
Contributor

Gerrit0 commented Oct 19, 2019

I guess to remove jQuery we'd also have to get rid of Backbone then.

@BennyHinrichs
Copy link
Contributor Author

BennyHinrichs commented Oct 20, 2019

One way to do that is to simply turn them into custom HTML elements. Probably wouldn't even be that big of a change. A little more code in the component files, plus we could probably get rid of Application.ts entirely. I've never mixed custom elements and TypeScript, so it would be an adventure.

@sgrishchenko
Copy link
Contributor

I have read this conversation and I like this idea. I have seen this fork, but I think this is bad idia to rewrite all libriary in one commit. I have tried to work with this problem and found this mistakes:

So many changes can cause big regression. I think, it will be better to make this changes iterativly. I have tried to make first step in this direction and made this pull request #97. I hope this will help to achive good results.

@sgrishchenko
Copy link
Contributor

sgrishchenko commented Mar 19, 2020

I have finished all works for query removing. Here list of PRs: #97, #98, #99, #100.
Now js bundle size has reduced from 174 KB to 35 KB (lunr library weighs 29 KB).
Thanks @BennyHinrichs for his work too. I have used some solutions and ideas from his repository.

@BennyHinrichs
Copy link
Contributor Author

Hey, looks pretty good! You took what I did and went the extra mile. That size reduction is awesome :)

@Gerrit0
Copy link
Contributor

Gerrit0 commented Mar 21, 2020

Thank you both! I should have time to look at the PRs this weekend or next week :)

@Gerrit0
Copy link
Contributor

Gerrit0 commented Mar 22, 2020

Merged in :) I squashed the commits together to preserve conventional commit style.

Released in 0.9.0, which the next patch of TypeDoc will use.

@Gerrit0 Gerrit0 closed this as completed Mar 22, 2020
This was referenced Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants