-
Notifications
You must be signed in to change notification settings - Fork 2
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
demo: on each page link to setup template #6
Comments
Good suggestion, I'll add a link to the source file of each pages, maybe also show the code with syntax highlight |
yeah! As always there is a tool advertising... The lightest suitable tool I know so far is
|
prismjs looks like great choice, mush smaller than highlight.js |
great! regarding second language: got there from this issue and the mentioned merge: PrismJS/prism#2776 |
Updated the deployed version to show source code of each demo pages. Will explore using regex to extract Screenshot of current version https://liveviews.cc/auto-complete: |
Maybe it would be helpful to omit the import statements for simplicity. (Updated to hide import statements by default but able to show them after click to expand (using |
looks great in the demo! |
The double loading phenomenon is expected, because the style and script tag is included in the component, not directly in the app skeleton, hence if the component is used multiple times, the resources will be loaded multiple times. On another hand, if the component is not used in that page, it's not loaded. Normally, subsequent loading should be answered from the browser cache. I can think up a workaround, to inject the resources only once by marking a flag in the render context, and inject them in a place of dom that will not be removed throughout the whole life cycle. This workaround may work but it'll (slightly) increase the complexity. |
when starting to dive a little deeper into the stunning demo by looking into webdev tools, Of course it's great to be able to directly look into the setup and one should keep it! Since you already hide the setup code and make users to click a button to show it |
That is a great suggestion! We can load the additional js and css upon the click event. In additional, the long code that are hidden by default can also be loaded lazily. That is possible for clients with javascript enabled, but it'll require a full page load for clients without/disabled javascript. So I prefer to keep the code content inline but load the js and css lazily. On the other hand, I'll try to do the parsing and code generation (wrapping span with classes) on the server at boot-time or build-time. This way may result in lighter runtime 🤔 |
as suggested in beenotung/ts-liveview#6
would be perfectly helpful to understand how it's done asap, to have on every page of the demo a direct deeplink to it's tsx template file
e.g.
on:
https://liveviews.cc/auto-complete
link to:
https://github.com/beenotung/ts-liveview/blob/master/server/app/pages/auto-complete-demo.tsx
The text was updated successfully, but these errors were encountered: