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

WORK IN PROGRESS - init nextjs UI renewal #103

Closed
wants to merge 13 commits into from

Conversation

kevincobain2000
Copy link
Member

@kevincobain2000 kevincobain2000 commented Nov 3, 2022

DONEs

  • Initiated Nextjs as npx create-next-app@latest --ts ui
  • Investigated Nextjs --turbo, unable to use, because basePath: is not supported inside next.config.js.
  • Updated Nextjs's base path in next.config.js to /vendor/request-docs/ for UI and /vendor/request-docs/api/sample for sample API. Dev environment available via npm run dev on http://localhost:3000/vendor/request-docs/. Also added sample response inside sample.ts for development of UI.
  • Updated Nextjs's export path in package.json to next export -o ../resources/dist/", which is Laravel's resource dir
  • Updated composer.json to publish static site of Nextjs to Laravel's vendor public as php artisan vendor:publish --tag=request-docs-assets --force. This step is important so that Nextjs's static js is available publicly for Laravel for the base path.
  • Added .github/nextjs.yml.
  • Updated index.blade, to render the Nextjs's static site from Laravel's public/vendor/request-docs/index.html. No impact on middleware for LRD, as everything goes through Laravel.
  • Updated LaravelRequestDocsController to have json response on json=true for Laravel. Since blade is not only going to render Nextjs.

TODOs

  • Add .github/release.yml, so that upon merging to master branch, npm run export can git push the generated static site to the resources/dist/ folder to master.

Backend

@kevincobain2000 and @kitloong

Frontend

@truongns

Features

  • Dark mode

Also fixes

@kevincobain2000 kevincobain2000 mentioned this pull request Feb 18, 2023
6 tasks
@kevincobain2000
Copy link
Member Author

kevincobain2000 commented Feb 18, 2023

We started this pull req using Nextjs 13, but it gave us hard time with the export to static as it was still under work in progress by Vercel team.
Screen Shot 2023-02-18 at 23 04 02

Since much of development was done on Nextjs 13's norm, it was hard to go back to Next 12 to just be able to export.

Using Astro.js and react instead.
This pull req spent time on design and layouts, which is taken over to Astro.js here #124

Plus with Astro the exported static has much more manageable assets, which we can serve via Laravel behind middlewares, so that users don't need to do a vendor:publish and continue to work with the base path.

PS: Will keep this branch as it is, in case we migrate from Astrojs to Nextjs, because Javascript world is the world I can never predict.

@kevincobain2000
Copy link
Member Author

Major changes in #124

Change 1: The reason to choose Ace in #124 instead of monaco editor as this pull req has, is because of the bundle size was over 1MB for monaco editor alone. Therefore, choosing a light weight.
Change 2: Instead of multiple themes, just providing light and dark should be enough

@kevincobain2000 kevincobain2000 deleted the feature/nextjs branch February 2, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants