🤖 Release PR#1
Open
github-actions[bot] wants to merge 2375 commits into
Open
Conversation
refactor: add abstractions for howto forms
…s-component feat: add generic error rendering component
…amp, default sort - Modified
…-roles-not-authorizing-in-dev fix: roles required checked in dev view correctly
chore(ci): verify security rules
refactor: remove unnecessary argument and add unit tests
…kelaar docs: add benkelaar as a contributor for code
…gins fix: replace margins with paddings in research comments box section
…-platform into 2709-research
…esearch_listing feat: add tooltips to research and howto cards
…ents feat: display MapPin moderator comments
…ion-comments feat(components): display moderation comments on MapMemberCard
…und-testijg docs: update guidance around testing
…tion-verified feat: adds email notification when verified badge added
…ts-emails feat(emails): needs improvements emails
test: add error handling and testing for getEmailTemplate
…limit-moderation-emails fix: memory and file path
fix: prevent slug collision on draft
fix: updated filter and sort inputs
…hurtyukayev docs: add arthurtyukayev as a contributor for code
chore: disable codecov/patch status
…to_footer Feat: remove howto footer, add comment focus
chore: empty commit
…id-char-signup fix: prevent signup if username contains invalid characters
docs: add jgable as a contributor for code
Comment on lines
+35
to
+72
| app.use('*', async (req, res, next) => { | ||
| const url = req.originalUrl | ||
| try { | ||
| // 1. Read index.html | ||
| let template = fs.readFileSync( | ||
| path.resolve(__dirname, 'index.html'), | ||
| 'utf-8', | ||
| ) | ||
|
|
||
| // 2. Apply Vite HTML transforms. This injects the Vite HMR client, | ||
| // and also applies HTML transforms from Vite plugins, e.g. global | ||
| // preambles from @vitejs/plugin-react | ||
| template = await vite.transformIndexHtml(url, template) | ||
|
|
||
| // 3. Load the server entry. ssrLoadModule automatically transforms | ||
| // ESM source code to be usable in Node.js! There is no bundling | ||
| // required, and provides efficient invalidation similar to HMR. | ||
| const { render } = await vite.ssrLoadModule( | ||
| path.resolve(__dirname, './entry-server.mjs'), | ||
| ) | ||
|
|
||
| // 4. render the app HTML. This assumes entry-server.js's exported | ||
| // `render` function calls appropriate framework SSR APIs, | ||
| // e.g. ReactDOMServer.renderToString() | ||
| const appHtml = await render(url) | ||
|
|
||
| // 5. Inject the app-rendered HTML into the template. | ||
| const html = template.replace(`<!--ssr-outlet-->`, appHtml) | ||
|
|
||
| // 6. Send the rendered HTML back. | ||
| res.status(200).set({ 'Content-Type': 'text/html' }).end(html) | ||
| } catch (e) { | ||
| // If an error is caught, let Vite fix the stack trace so it maps back | ||
| // to your actual source code. | ||
| vite.ssrFixStacktrace(e) | ||
| next(e) | ||
| } | ||
| }) |
Check failure
Code scanning / CodeQL
Missing rate limiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.