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

refactor(tiptap-extensions): Do not import the full lowlight library. #62

Conversation

erickwilder
Copy link
Contributor

@erickwilder erickwilder commented Oct 13, 2018

BREAKING CHANGE: CodeBlockHighlight was importing the full lowlight libraries, including all
syntax highlighting definitions from highlight.js. The new behavior changes the signature of
CodeBlockHighlight to accept an object with all syntax highlighting definitions. This means that
now the user of the library MUST import languages themselves and tiptap will no longer
bundle the full highlight.js in itself.


Testing:

  • Given that you have a working copy from the test repo[1]
  • Run npm run build in the test repo and check if the highlight.js library is bundled with it.
  • Checkout this branch and run yarn build:packages
  • Copy[2] the contents of tiptap-extensions to the test repo:
    cp -R packages/tiptap-extensions /path/to/test/repo/node_modules/tiptap-extensions
    
  • Run npm run build again on the rest repo
  • You shouldn't see traces of highlight.js anymore.

Expected result:
screenshot 2018-10-13 at 16 11 20


This closes #16

[1] https://github.com/erickwilder/tiptap-treeshaking
[2] I had some issues with npm link and just to be quick I've copied the locally compiled tiptap-extensions over the files installed vie npm install in the test repo.

BREAKING CHANGE: `CodeBlockHighlight` was importing the full `lowlight` libraries, including _all_
syntax highlightning definitions from `highlight.js`. The new behavior changes the signature of
`CodeBlockHighlight` to accept an object with all syntax highlightning definitions. This means that
now the user of the library __MUST__ import languages themselves and tiptap will no longer
bundle the full `highlight.js` in itself.
@erickwilder
Copy link
Contributor Author

@philippkuehn It would be nice to add the hacktoberfest label in the affected issue (#16, or this PR)😄

Let's make the 1.0.0 roadmap happen! 🍻

@philippkuehn philippkuehn merged commit b6039c7 into ueberdosis:master Oct 13, 2018
@philippkuehn
Copy link
Contributor

Thank you @erickwilder!

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.

"Tree-Shaking" support for TipTap
2 participants