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

chore/upgrade greenwood 0.10.0 #22

Merged
merged 22 commits into from
Apr 3, 2021

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 1, 2020

Summary

Initial effort to test ongoing integration with release/0.10.0. Many things incomplete at this point, naturally but initial results are promising. 🎉

  1. Upgrade to [email protected]
  2. Migrate to HTML based templates
  3. Use greenwood serve task for local serve
  4. Upgrade to Node v12

See last section for testing this locally since it wont build as expected since just yarn link is supported used at the moment.

TODOs

  1. Remove fs-extra dependency - running commands is broken due to missing dependency when using 0.10.0-alpha.0 release greenwood#445
  2. Convert project CSS to not be nested - tracked in remove non web standard usages of CSS #23
  3. Locally there is a webpack based 404.html file inb public/, where is that coming from? can not reproduce
  4. Need to restore "default" <meta> to Greenwood's default app.html (good first issue?) - default <meta> tags are missing from default app template in 0.10.0-alpha.0 greenwood#446
  5. Need to track being able to import an image - as this is non standard behavior, like with remove non web standard usages of CSS #23 , we should not have that as part of a Getting Started repo
  6. Rollup builds are failing in Netlify
  7. Probably needs some help with tweaking styles to match production - was just an unclosed <img> tag :)
  8. Lighthouse accessibility score
  9. favicon.ico error message - added to greenwood.config.js
     Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/src/favicon.ico'
    
  10. track rollup warning - added here Roadmap To 1.0 And Beyond greenwood#418
     @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
  11. Preload key requests

Performance

Prod

getting-started-prod-lighthouse
getting-started-prod-network

Locally

getting-started-0 10 0-lighthouse
getting-started-0 10 0-network

@thescientist13 thescientist13 added the enhancement New feature or request label Dec 1, 2020
@thescientist13 thescientist13 self-assigned this Dec 13, 2020
@thescientist13 thescientist13 added the help wanted Extra attention is needed label Dec 30, 2020
@thescientist13
Copy link
Member Author

thescientist13 commented Dec 30, 2020

Hmm... that's a new one. Netlify builds are failing on Rollup build 🤔

5:32:46 PM: TypeError: [conf.input].flat is not a function
5:32:46 PM:     at Object.options (/opt/build/repo/node_modules/rollup-plugin-multi-input/dist/plugin.js:135:15)
5:32:46 PM:     at /opt/build/repo/node_modules/rollup/dist/shared/rollup.js:19997:36
5:32:46 PM: npm ERR! code ELIFECYCLE
5:32:46 PM: npm ERR! errno 1
5:32:46 PM: npm ERR! [email protected] build: `greenwood build`
5:32:46 PM: npm ERR! Exit status 1
5:32:46 PM: npm ERR!
5:32:46 PM: npm ERR! Failed at the [email protected] build script.
5:32:46 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
5:32:46 PM: npm ERR! A complete log of this run can be found in:
5:32:46 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-12-30T22_32_46_106Z-debug.log
5:32:46 PM: ​
5:32:46 PM: ────────────────────────────────────────────────────────────────
5:32:46 PM:   "build.command" failed                                        
5:32:46 PM: ────────────────────────────────────────────────────────────────
5:32:46 PM: ​
5:32:46 PM:   Error message
5:32:46 PM:   Command failed with exit code 1: npm run build
5:32:46 PM: ​
5:32:46 PM:   Error location
5:32:46 PM:   In Build command from Netlify app:
5:32:46 PM:   npm run build
5:32:46 PM: ​
5:32:46 PM:   Resolved config
5:32:46 PM:   build:
5:32:46 PM:     command: npm run build
5:32:46 PM:     commandOrigin: ui
5:32:46 PM:     environment:
5:32:46 PM:       - REVIEW_ID
5:32:46 PM:     publish: /opt/build/repo/public

@thescientist13
Copy link
Member Author

thescientist13 commented Jan 31, 2021

Hmm, so per this StackOverflow post and this comment , that .flat is only available on Node.js >= 11, which seems corroborated by MDN as well?
Screen Shot 2021-01-30 at 8 27 02 PM

But our CI GitHub Action for the project also uses NodeJS v10.x (v10.23.1 to be exact) but it builds fine?
https://github.com/ProjectEvergreen/greenwood/runs/1755177388?check_suite_focus=true

Run actions/setup-node@v1
/opt/hostedtoolcache/node/10.23.0/x64/bin/node --version
v10.23.0
/opt/hostedtoolcache/node/10.23.0/x64/bin/npm --version
6.14.8

But the Netlify build for the release/0.10.0 branch uses v10.23.1 but it builds fine!?

12:50:29 PM: Started restoring cached node version
12:50:33 PM: Finished restoring cached node version
12:50:33 PM: v10.23.1 is already installed.
12:50:34 PM: Now using node v10.23.1 (npm v6.14.10)

For what it's worth, using Node v10.18.1 locally also reproduces the problem... so somehow this just doesn't impact GitHub Actions?

% node -v
v10.18.1
owenbuckley@Owens-MBP-2 greenwood-getting-started % npm run build

> [email protected] build /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started
> greenwood build

-------------------------------------------------------
Welcome to Greenwood ♻️
-------------------------------------------------------
Running Greenwood with the build command.
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
Serializing pages at http://127.0.0.1:1984
pages to generate
 src/pages/blog/first-post.md
 src/pages/blog/second-post.md
 src/pages/index.md
serializing page... /blog/first-post/
serializing page... /blog/second-post/
serializing page... /
Serializing complete for page /blog/first-post/.
Serializing complete for page /.
Serializing complete for page /blog/second-post/.
done serializing all pages
TypeError: [conf.input].flat is not a function
    at Object.options (/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/rollup-plugin-multi-input/dist/plugin.js:135:15)
    at /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/rollup/dist/shared/rollup.js:20048:36

I know we want to drop Node 10 support for this release anyway, but just curious why it's working in GitHub Actions? 🤔

For now I can update this project with a netlify.toml and make sure Netlify is always using v12. We should probably update this project to support the same workflows as the main project. Will tackle that once Greenwood 0.10.0 is cut and the final version support lands there.

@thescientist13
Copy link
Member Author

Some new updates after the latest update
Screen Shot 2021-03-05 at 6 15 10 PM
Screen Shot 2021-03-05 at 6 15 15 PM

@thescientist13 thescientist13 removed the help wanted Extra attention is needed label Mar 29, 2021
@thescientist13
Copy link
Member Author

thescientist13 commented Mar 29, 2021

Made some tweaks to address CLS and now we are at 💯 🎉
Screen Shot 2021-03-29 at 6 07 34 PM

@thescientist13 thescientist13 marked this pull request as ready for review March 29, 2021 22:08
@thescientist13 thescientist13 merged commit 478d7e8 into master Apr 3, 2021
@thescientist13 thescientist13 deleted the chore/upgrade-greenwood-0.10.0 branch April 3, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant