CruGlobal / conf-registration-web

Event Registration Tool
https://www.eventregistrationtool.com
MIT License
2 stars 1 forks source link

NextJS #784

Closed TheNoodleMoose closed 2 years ago

TheNoodleMoose commented 2 years ago

Thanks to @OzzieOrca's help, we have NextJS running inside of AngularJS! 🥳

One of the main blockers was that Next.js tries to server render/pre render which doesn't work at all with angular. Scotty added the React.lazy function to wait to run any Angular code until we're on the client. That didn't work with React serverside rendering so an upgrade to the rc for v18 was needed.

There's still some work to be done, but this is a good starting point to continue to work from and experiment with.

gitguardian[bot] commented 2 years ago

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Details of the secret
| Secret | Commit | Filename | Detected At | | | ------------------------- | ---------------- | --------------- | -------------------- | -------------------- | | Generic High Entropy Secret | 0f085720110be1cbc7690cc44f7f87ffb95a7d87 | app/index.ejs | 00:40 February 5th, 2022 | [View secret](https://github.com/CruGlobal/conf-registration-web/commit/0f085720110be1cbc7690cc44f7f87ffb95a7d87#diff-286ef8575ee7bf6dc645ba6de08ab880b2d88d1d522f53557da80886878210cbL114) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/internal-repositories-monitoring/integrations/git_hooks/pre_commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.
GitGuardian is an automated secrets detection service.We help developers and security teams secure the modern software development process.

 

Our GitHub checks need improvements? Share your feedbacks
OzzieOrca commented 2 years ago

@TheNoodleMoose Your changes to bootstrap in the App component weren't working for me. It seems like all AngularJS components have to be defined before bootstrapping and then all angular2react calls have to happen after bootstrapping.

I moved the component config into the AngularJS part of the app and changed how it bootstraps (there's more of a description in my commit message). I think this will work better as we add more pages and navigate between them. I guess each one will still need to have import 'app/scripts/main';. I tried moving that up to the App component with another React.lazy function but it appears to load both lazy components at the exact same which means the bootstrap hasn't happened before the angular2react call.

Let me know what you think. :)

TheNoodleMoose commented 2 years ago

Staging doesn't appear to have been broken so I'll go ahead and move forward with merging this in!