1
0
mirror of synced 2025-12-21 19:06:49 -05:00
Commit Graph

25 Commits

Author SHA1 Message Date
Mike Surowiec
964aa9977e update logic for whether to render a page with nextjs 2021-05-19 08:27:40 -07:00
Kevin Heis
08ec46d0d1 Render color mode settings from github/github cookie (#19275)
* Add color mode selector in footer

* Interpret color mode from cookie

* Update render-page.js

* Delete color-mode.js

* Update render-page.js

* Make this more resilient to HTML tag changes

* Update scroll-button.scss
2021-05-13 14:45:11 +00:00
Mike Surowiec
e92e11888c feat: add code examples, cleanup and minor fixes 2021-05-11 10:13:15 -07:00
Mike Surowiec
9036301ad1 feat: add CommunityExamples, enable /discussions 2021-05-11 09:10:49 -07:00
Mike Surowiec
b2561a170f fix: run lint 2021-05-05 22:13:31 -07:00
Mike Surowiec
34dcba51f1 feat: add DefaultLayout, add to sponsors landing page 2021-05-05 14:54:49 -07:00
Mike Surowiec
eaddbc5db7 feat: add nextjs middleware handling (#19139)
* feat: add nextjs middleware handling split

* fix: eslint errors

* fix: filter boolean from csp list

* fix: feature flag nextjs server start

* feat: add prettier rules for ts,tsx files

* fix: remove unnecessary async from next middleware

* fix: next middleware name

* Update tsconfig.json

Co-authored-by: James M. Greene <JamesMGreene@github.com>

* Update next-env.d.ts

Co-authored-by: James M. Greene <JamesMGreene@github.com>

* fix: add typescript linting to lint command

* add comment for unsafe-eval, update webpack to use eval in development

* fix: feature flag typo

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-05-05 15:23:46 +00:00
Sarah Schneider
03ee839af6 Merge branch 'main' into add-layouts-middleware 2021-04-13 16:03:36 -04:00
Sarah Schneider
1623191243 extract layout handling into separate middleware 2021-04-13 14:24:06 -04:00
Mike Surowiec
9185eb3c2a pre-render graphql input-objects
resolves #18269
2021-04-09 08:32:42 -07:00
James M. Greene
22e8d75c91 RedisAccessor tolerance for GET failures (#18586)
* Update RedisAccessor to allow for graceful GET failures, too
* Add unit tests for allowGetFailures behavior
2021-04-05 16:26:46 +00:00
James M. Greene
84547e54c7 Use node-redis for page cache (#18421)
* Use [node-]redis as a direct dependency

* Extract Redis client creation to its own module

* Attach extensive logging in the Redis client creation module

* Allow the rate limiter to pass requests when Redis is disconnected

* Update rate-limit-redis

* Default error input to empty object for formatRedisError method

* Provide a name for the rate limiter's Redis client

* Include redis-mock, exclude ioredis/ioredis-mock

* Remove unused RedisAccessor#exists method

* Switch RedisAccessor to use redis/redis-mock

* Provide a name for logging on the Redis page cache

* Remove extraneous trailing space from Redis logging prefix

Our updated use of console.* will already be adding a space after the prefix

* Replace ioredis-mock with redis-mock in tests

* Revert removal of ioredis dependency

* Bind Redis client to async promisified methods

* Extract former RedisAccessor constructor tests to new create-client tests

* Update RedisAccessor tests to work with the callback-based redis client

* Handle formatting Redis errors (or not) with more resiliency
2021-03-29 17:34:22 +00:00
James M. Greene
fd7d0eeb1a Add timeout and abort middleware and processing halts (#18177)
* Add middleware to timeout requests after a period

* Add halt-on-dropped-connection middleware to stop the middleware processing stack if the connection was already dropped

* Add a few strategic bail-out spots for dropped connections during the render-page middleware

* Handle 404s and HEAD requests earlier in the page rendering flow

* Add a few more strategic bail-out spots for dropped connections during the render-page middleware

* Add middleware to notice aborted requests

* Add a check for aborted requests into the isConnectionDropped logic

* Reformat comment for consistency

* Handle aborted requests correctly in the error handler

* Explicit returns for consistency
2021-03-09 19:14:02 +00:00
Kevin Heis
1918d2ea14 Inline CSRF token in HTML (#17748)
* Inline CSRF token

* Fix tests
2021-02-09 22:08:24 +00:00
James M. Greene
4dea2779f3 More explicit terminations of middleware (#17666)
* Be more explicit about next/res.send ending middleware functions

* Add note explaining the one exception
2021-02-03 16:38:41 -06:00
Vanessa Yuen
9bc90cd932 Learning Track navigation banner (#17440)
* add middleware to handle `learn` query param

* add exception to query-less cache key

* add querystring to learning track guides
2021-01-25 16:57:32 +00:00
James M. Greene
9171d17d23 Ignore query strings and fragment identifiers for Redis cache keys (#17205)
* Ignore query strings and fragment identifiers for Redis cache keys

* Don't serve cached responses if developer is requesting JSON debugging info
2021-01-07 09:42:53 -06:00
James M. Greene
068c472084 Cache rendered pages in Redis (#17106)
* Explicitly set the Redis database number used for rate limiting

* Switch to using ioredis as the Redis client for rate limiting

* Install ioredis-mock as a primary dependency

* Create a Redis BasicAccessor class and tests

* Switch rendered page caching to use Redis for storage

* Add support for additional Redis SET options like TTLs

* Remove currently unused methods

* Rename redis-accessors/basic to redis-accessor and remove extra fluff

* Change default behavior for cache setting to throw if an error occurs

Add option allowSetFailures to facilitate graceful failures

* Allow SET failures to fail gracefully for the rendered page cache

* Remove as-yet unneeded serialization options from RedisAccessor

* Move Redis client construction into RedisAccessor constructor, just pass in databaseNumber as option

* Remove rendered-page-cache in favor of direct RedisAccessor use

* Add tests for RedisAccessor constructor param validations

* Eliminate one roundtrip to Redis for the cached HTML existence check

Are we fast yet?

* Set a rendered page cache TTL of 24 hours
2021-01-06 15:30:51 -06:00
Kevin Heis
dd02bfa007 Merge main 2020-11-16 10:07:53 -08:00
Jason Etcovitch
0730158918 Datadoge (#16464)
* Install hot-shots

* Add statsd client

* Add some metrics

* Add a comment

* Comment typo fix

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2020-11-13 15:49:50 -05:00
James M. Greene
f410fd175c Mostly reverting github/docs-internal#15313 2020-11-09 13:07:04 -06:00
Laura Coursen
a3e1733aa1 GitHub AE (GHAE) (#16090) 2020-11-02 15:12:44 -06:00
Chiedo John
3600e4d9ee Don't enable cache on CI (#16180)
Co-authored-by: Chiedo <chiedo@users.noreply.github.com>
2020-10-22 15:10:19 -04:00
Chiedo John
73559d914e Add a in-memory page cache for renderings (#16173)
* Add a in-memory page cache for renderings

* Update render-page.js

* Update render-page.js

* Update render-page.js

* Make the render page cache more intelligent

Co-authored-by: Chiedo <chiedo@users.noreply.github.com>
2020-10-22 14:35:19 -04:00
Vanessa Yuen
3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00