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

Dedupe content in JavaScript #305

Closed
1 of 5 tasks
thescientist13 opened this issue Mar 18, 2020 · 7 comments
Closed
1 of 5 tasks

Dedupe content in JavaScript #305

thescientist13 opened this issue Mar 18, 2020 · 7 comments
Assignees
Labels
CLI P0 Critical issue that should get addressed ASAP question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc v0.10.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Mar 18, 2020

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

One concern with a pre-rendering approach is that even though the HTML is pre-generated, it often still ends up with an architecture that ships the same code via JavaScript as well.
ETP_TAQXsAIcldW

If the project is generating static content it really shouldn't also be delivered via JavaScript too, ideally.

This should also be taken into context with #299 and #265

Details

For example, in our project, since all pages are generated by JavaScript, you'll see that even static the page content is in the index.js bundle.

        <h2>Community</h2>
<p>Greenwood understands the role of community in open source, technology, and learning and we want to embrace that in this project as well.  There are many great tools and projects available in the web ecosystem and we want to highlight those projects here, that have been important in the development of Greenwood (in no particular order).</p>
<ul>
<li><a href="https://webpack.js.org/"><strong>webpack</strong></a> (and friends) - Module bundler and powers the local development environment for Greenwood.</li>
<li><a href="https://github.com/GoogleChrome/puppeteer"><strong>puppeteer</strong></a> - Headless Chrome browser used for serializtion.</li>
<li><a href="https://github.com/hutchgrant/wc-markdown-loader/"><strong>WC Markdown Loader</strong></a> - A webpack plugin that transforms a markdown file into a Web Component! 🤯</li>
<li><a href="https://github.com/fernandopasik/lit-redux-router"><strong>LitReduxRouter</strong></a> - Declarative client side routing library.</li>
</ul>
<p>And of course we can't forget our <a href="https://github.com/ProjectEvergreen/greenwood/graphs/contributors">Contributors</a>!</p>
<p>So please come join our community and help us grow and advance the web together!  We can't wait to see what you come up with.  💡</p>

Wondering if there's anything about our implementation that should change re: pre-rendering vs SSG?

@thescientist13 thescientist13 added question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc labels Mar 18, 2020
@thescientist13
Copy link
Member Author

thescientist13 commented Mar 19, 2020

Some interesting comments / links / resources on the subject

https://twitter.com/slightlylate/status/1240419628557283328
Screen Shot 2020-03-19 at 7 04 07 PM

My best hope today is "RedactJS": go full-SSR, strip out all client-side JS from the payload, and then only re-add JS via module/no-module and web components (via Lit, Stencil, etc.) that are vended by a smaller group in the org:


https://twitter.com/slightlylate/status/1240376840788643840

My interest was piqued at Gatsby + "low-tech", but my affections were cemented with "no JavaScript".


https://www.gatsbyjs.org/packages/gatsby-plugin-no-javascript/

Removes all javascript files created by Gatsby from the static HTML files. This plugin is not meant to remove all javascript, but only the javascript that Gatsby is adding to the page.

@thescientist13
Copy link
Member Author

thescientist13 commented Apr 16, 2020

An interesting Twitter thread on the topic, with some comments in regards to lit-html

edit: another one

@thescientist13 thescientist13 added the P0 Critical issue that should get addressed ASAP label Apr 24, 2020
@thescientist13
Copy link
Member Author

If we "dedupe" content from JS, then in SPA mode wouldn't all the content be missing when routing? Will each page need to grab it's contents some other way, like we do with cache.json?

@thescientist13
Copy link
Member Author

@thescientist13 thescientist13 added this to the MVP milestone May 11, 2020
@thescientist13 thescientist13 changed the title Dedup content in JavaScript (SSG vs Pre-rendering?) Dedup content in JavaScript May 31, 2020
@thescientist13 thescientist13 mentioned this issue Nov 12, 2020
12 tasks
@thescientist13
Copy link
Member Author

thescientist13 commented Apr 4, 2021

We are HTML first for all (markdown) content now as part of v0.10.0! 🎉

@thescientist13 thescientist13 changed the title Dedup content in JavaScript Dedupe content in JavaScript Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI P0 Critical issue that should get addressed ASAP question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc v0.10.0
Projects
None yet
Development

No branches or pull requests

1 participant