Repository navigation
Sync finished code with modernized guide - #369
Conversation
56b24d4 to
b8aaadd
Compare
- Restore the "test" script so `npm test` works again. - populatedb.js: log progress with console.log (as the guide describes), report failures with a non-zero exit code, and show a usage message with a local MongoDB URL example instead of Atlas credentials. - Add demo.js and `npm run demo`, which runs the site against a temporary in-memory database filled with the sample data. - README: describe the demo, the local MongoDB default (install, Docker or Atlas via MONGODB_URI), consistent start commands, the MDN-hosted data model diagram, and current MDN links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Format dates in UTC so they display as entered in every time zone (they were a day early west of UTC, and disagreed with the edit form). - authorDeletePost deletes the author in the URL (req.params.id) rather than an id from the form body, so a forged request can't delete a different author who still has books. Remove the unused hidden field and add a regression test. - bookUpdatePost redirects to book.url, so it doesn't crash if the book was deleted while the form was open. - Restore the guide's lowercase "Delete author"/"Update author" and genre link text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the example code (mdn/express-locallibrary-tutorial#369): - Format BookInstance dates in UTC, so they aren't shown a day early west of UTC, and remove the note about that limitation. - Delete the author identified in the URL rather than an id from a hidden form field, and correct the explanation. - Redirect to book.url after updating a book. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"1932-11-8" isn't a valid ISO date string, so it was parsed as local midnight. With UTC date formatting, it displayed as Nov 7 on machines east of UTC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hamishwillee
left a comment
There was a problem hiding this comment.
Thanks @Josh-Cena
Merging this with the companion. I did some minor changes that came out of the review, including to the README.md to keep the instructions that allow easy testing (mostly by me).
|
@dipikabh Can you please merge this and make me code-owner. |
…45596) * Yank Express Application Generator, migrate Express tutorial to ESM * Make dev env set up the starter template * Starter template creation instructions * Update Mongoose * Update routes * Migrate Displaying_data * Migrate forms * Migrate deployment * Express tutorial: fix dates, author delete id and book update redirect Match the example code (mdn/express-locallibrary-tutorial#369): - Format BookInstance dates in UTC, so they aren't shown a day early west of UTC, and remove the note about that limitation. - Delete the author identified in the URL rather than an id from a hidden form field, and correct the explanation. - Redirect to book.url after updating a book. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Express tutorial: review fixes - Fix stale text left over from the generator and starter project - Fix typo in Book detail page - Update sample npm version and output, and the version prefix note - Reword the PowerShell note - Match the demo's viewport meta and Helmet comment - Fix indentation of the Delete author snippet and explain it - Fix date format in the BookInstance challenge - Retake and compress the BookInstance list and Author detail screenshots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Express tutorial: fix inaccurate statements found in review - Describe what server.js and routes/index.js actually do - Clarify what the DEBUG variable turns on - Correct the GraphQL description and match the ORM list form - Drop the unsupported claim that CommonJS is legacy - Use the due_back field name, not due_date - Explain which dates are stored as midnight UTC Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Express tutorial: fix dead Express documentation links The Express 5 API reference is now split into subpages, so the expressjs.com/en/5x/api/#... anchors no longer work. Also fix the express-router guide anchor and point the changelog link at the GitHub releases page that it now redirects to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Express tutorial: fix outdated statements on unchanged lines - Replace the Mongoose callback error-handling example, which no longer works in Mongoose 7+, with a Node readFile() callback example - Say what express.urlencoded() and express.json() each parse - Point the users route note at the running instructions, now later - Remove "required" left over from CommonJS in the forms overview - Explain the debug namespace in the deployment logging example - Say that model modules export the model itself - Link the MDN and Node ES modules pages in See also Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @hamishwillee, you're already a code owner:
Since this PR also touched package files, it required approval from |
|
Thanks for the clarification @dipikabh ! That restriction is a little annoying since updating the packages is the most common thing I'm likely to want to do! |
I see. I'll bring it up with the team to see if we can make an exception in this case |
|
Also ask for the Django example if you don't mind please @dipikabh - not the end of the world if I have to ask you guys every time. |
|
Hi @hamishwillee, we discussed this - we'll be leaving the ownership rules as they are for now. For now, you can continue to ping us if you’re blocked from merging a PR. |
|
Thanks for checking |
Accompanies mdn/content#45596