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

showcase: replace Highlight.js by the stark-pretty-print component in the ExampleViewer component #494

Closed
christophercr opened this issue Jul 9, 2018 · 0 comments · Fixed by #503

Comments

@christophercr
Copy link
Collaborator

christophercr commented Jul 9, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

The ExampleViewer component uses the highlight.js library to leverage syntax highlighting. However, apart from the fact that there is another library we used to do this in the old Stark (PrismJS), the highlight.js library causes the following failure on the Travis build in Node 6:

ERROR in ./node_modules/highlight.js/lib/languages/sqf.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
RangeError: Maximum call stack size exceeded
    at Object.visitEachChild (/home/travis/build/NationalBankBelgium/stark/showcase/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:56952:28)
    at visitor (/home/travis/build/NationalBankBelgium/stark/showcase/node_modules/@angular-devkit/build-optimizer/src/transforms/wrap-enums.js:53:23)
    at visitNode (/home/travis/build/NationalBankBelgium/stark/showcase/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:56836:23)
    at Object.visitEachChild (/home/travis/build/NationalBankBelgium/stark/showcase/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:57078:46)
    at visitor (/home/travis/build/NationalBankBelgium/stark/showcase/node_modules/@angular-devkit/build-optimizer/src/transforms/wrap-enums.js:53:23)

This issue has been reported and it is open for some months already: highlightjs/highlight.js#1685

Expected behavior

Minimal reproduction of the problem with instructions

Trigger a production build for the showcase app with one of these commands under Node 6:

npm run build:showcase
npm run build:showcase:ghpages

What is the motivation / use case for changing the behavior?

PrismJS is better structured. It has meaningful classnames like: "token.block-comment", "token.boolean", "token.operator"... These make it easier to customize the css.

Environment


Angular version: 6.0.7

 
For Tooling issues:
- Node version: 6.X  
- Platform:  ALL
@christophercr christophercr added this to the 10.0.0-alpha.4 milestone Jul 9, 2018
@christophercr christophercr changed the title showcase: replace HighlightJS by Prism in ExampleViewer component showcase: replace Highlight.js by PrismJS in ExampleViewer component Jul 9, 2018
@RobbyDeLaet RobbyDeLaet changed the title showcase: replace Highlight.js by PrismJS in ExampleViewer component showcase: replace Highlight.js by the stark-pretty-print component in the ExampleViewer component Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant