Skip to content

Instantly share code, notes, and snippets.

@Arique1104
Last active September 20, 2023 16:03
Show Gist options
  • Save Arique1104/c4c7f3cc5a69ea2c580d1d45cd9b69e6 to your computer and use it in GitHub Desktop.
Save Arique1104/c4c7f3cc5a69ea2c580d1d45cd9b69e6 to your computer and use it in GitHub Desktop.

Thirteen Point Oh Code Along

Once you have forked the your forked respository, run the following commands in your terminal

  • Enter your directory cd .. Spoke
  • Here are the commands for setting up your environment in order:

Here are the commands for setting up your environment in order:

  1. nvm install
  2. nvm use
  3. yarn
  4. yarn install
  5. docker-compose up -d
  6. ./dev-tools/create-test-database
  7. yarn dev

Debugging thirteen point oh! notes:

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
1 source
prepareInjection.js:1
Learn more: User-Agent String Reduction
  • Check prepareInjection.js line 1
  • I can only see it in Sources. There a wepackBootstrap, but I can't find this document in the code base. HOw do I understand this?
  • What I do see that is familiar is the 4069 number. I can search for that number and provide the document that needs editting from there.
  • it was in the workflows .yaml files. But I can't find it.
  • Javascript Heap out of memory
  • In the jest-tests.yaml, I updated the max old space size to 8192. Let's see what the tests say on this new branch thirteen-point-oh

Thirteen-Point-Oh test results

  • So far, these tests aren't failing.

  • Could that have been the fix? We needed to raise the workflow max.

  • How to ensure I am using the correct shortcuts to find words in VisualStudios, because I should've been able to find this document when typing in NODE_OPTIONS

    • PRO-TIP: VS Code allows you to quickly find text and replace in the currently opened file. Press Ctrl+F to open the Find Widget in the editor, search results will be highlighted in the editor, overview ruler and minimap.
  • Was able to locate all mentionings of NODE_OPTIONS on the yaml file. It's super useful to ensure consistant updates to the codebase.

  • Am waiting for the results of these tests to see what my next error message is. Let's see if I can log onto Spoke! Kathy was able to get her Spoke working.

    • Integration test 16x is passing?! Interesting
    • We've got major tests passing! I'm so grateful for Kathy's help on this! I was able to retrace some steps and figure out what needed updating. And also learned a detail of how to utilize the find option on VS Studio.

Lessons on Version Control

  • This felt very near and dear to my heart, because we had to learn it the hard way. And being stuck on errors as a team is sometimes not the most effective strategy. Especially when we can't replicate the errors. Agreeing to move forward with 13.0 was a fantastic posture.
  • Interesting, the redis cashe test failed. Let's check it out.

Test 16.x

  • It looks like a classic I'm missing some variables for settings up there.
  • Looks like there is a missing environment variable for the van. src/extensions/contact-loaders/ngpvan/index.js:66:13
  • Okay, here's my most recent git history - git commit -m "Updates all Node Options on jest-test yaml file" - git push origin thirteen-point-oh - yarn dev - docker-compose down -d - docker-compose down - nvm use - nvm install - yarn - yarn install
    • docker-compose up -d

Now I have this new error coming up in my console

  • non-JS module files deprecated.
  • it's tell me to run npm start
  • Also telling me to change 8080 to 3000 on the launch.json file.
  • I looked in VS CODE where localhost was being hused, and there are some major flunks on the localhosts consistancy. So I'm adding localhost/3000
  • Let's see how the tests do now.
  • Going to come back after the test results show.

Returning results

That was a huge success, onward to the errors about missing environment variables. See if this command can help

  • cp .env.example .env
  • That did nothing
  • I have to go add a required environment variable for real, buit the file I need to focus on is src/extensions/contact-loaders/ngpvan/index.js:66
  • I added the following environment variables to the .env.example file and pushed those changes up.
  • Let's see the results!

Terminal History of all edits

10022  gh repo clone MoveOnOrg/Spoke
10023  cd Spoke
10024  nvm install
10025  nvm use
10026  yarn
10027  yarn install
10028  docker-compuse up -d
10029  docker-compose up -d
10030  ./dev-tools/create-test-database
10031  yarn dev
10032  docker-compose up -d
10033  yarn dev
10034* sudo lsof -iTCP:3000 -sTCP:LISTEN
10035* kill 51366
10036* sudo lsof -iTCP:3000 -sTCP:LISTEN
10037  yarn dev
10038* git checkout -b thirteen-point-oh
10039* git status
10040* git add .
10041* git push origin thirteen-point-oh
10042* git status
10043* git add .
10044* git commit -m "updates node options max old space size to 8192"
10045* git push origin thirteen-point-oh
10046* git status
10047* git add .
10048* git commit -m "Updates all Node Options on jest-test yaml file"
10049* git push origin thirteen-point-oh
10050  yarn dev
10051  docker-compose down -d
10052  docker-compose down
10053  nvm use
10054  nvm install
10055  yarn
10056  yarn install
10057  docker-compose up -d
10058  git history
10059  history
10060  git status
10061  git add .
10062  git commit -m "Updates jest config to have testURL be http://localhost/3000"
10063  git push origin thirteen-point-oh
10064  git status
10065  git add .
10066  git commit -m "updates testURL to localhost:3000"
10067  git push origin thirteen-point-oh
10068  cp .env.example .env
10069  git status
10070  git add .
10071  git commit -m "Adds ngpvan environment variables to the .env.example file."
10072  git push origin thirteen-point-oh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment