1
0
mirror of synced 2025-12-30 03:01:36 -05:00
Commit Graph

594 Commits

Author SHA1 Message Date
Sarah Schneider
25590259f8 Merge branch 'main' into optional-toc-for-early-access-products 2022-08-23 10:45:56 -04:00
Peter Bengtsson
c9cc69ca21 Archived enterprise assets should be cached longer (#30165) 2022-08-23 02:02:31 +00:00
Sarah Schneider
f84ae785fc support earlyAccessToc frontmatter 2022-08-22 17:39:54 -04:00
Peter Bengtsson
ec302a668d simplify and improve default cache-control headers (#30162)
simply and perfect cache-control headers
2022-08-22 19:57:42 +00:00
Peter Bengtsson
8eb7898827 send errors to Failbot in SSR rendering (#30153)
* send errors to failbot in SSR rendering

* wip

* progress

* tidying up

* no point awaiting something that doens't return a promise
2022-08-22 16:50:18 +00:00
Peter Bengtsson
2ca86bcaa5 longer timeout on archived enterprise versions (#30149) 2022-08-22 13:41:12 +00:00
Peter Bengtsson
fe80f4ae4d suppress es-search if ELASTICSEARCH_URL isn't configured (#30096)
* suppress es-search if ELASTICSEARCH_URL isn't configured

* simplify

* simple 500 error instead
2022-08-19 20:54:37 +00:00
Peter Bengtsson
c260d9f04d only redirect to /$locale/search if ES is set (#30104)
* only redirect to /$locale/search if ES is set

* only redirect to /$locale/search if ES is set
2022-08-19 18:57:07 +00:00
Peter Bengtsson
8765c628ff dedicated search results page (redux) (#29902)
* dedicated search results page (redux)

* Update SearchResults.tsx

* adding pagination

* fix pagination

* say something on NoQuery

* better Flash

* tidying link

* small fixes for results

* debug info

* l18n the meta info

* inDebugMode

* basic jest rendering of the skeleton page

* basic jest rendering test

* fix content tests

* better document title

* fix tests

* quote query in page title

* use home page sidebar

* something when nothing is found

* parseInt no longer needs the 10

* fix linting tests

* fix test

* prettier

* Update pages/search.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-08-19 13:36:55 +00:00
Kevin Heis
c8ae2081b7 Remove feature flags (#29968) 2022-08-16 11:23:02 +00:00
Kevin Heis
3cb36aa99f Remove airgap mode (#29964) 2022-08-15 21:05:21 +00:00
Kevin Heis
688a274f1f Remove CSRF check (#29910)
* Use color_mode for gating "sign up" button

* Remove csrf check

* Add `res.removeHeader('set-cookie')` to cache-control

* Update static-assets.js

* Remove package

* Remove tough-cookie

* Update cache-control.js

* Update cache-control.js

* Update cache-control.js
2022-08-15 19:28:42 +00:00
Kevin Heis
ca61b3465a Use color_mode for gating "sign up" button (#29901)
* Use color_mode for gating "sign up" button

* Update useHasAccount.ts

* Update useHasAccount.ts

* Update useHasAccount.ts
2022-08-12 18:18:58 +00:00
Peter Bengtsson
126b0a9f44 find hyphenated words better (#29864)
* find hyphenated words better

* consistent about boost constants
2022-08-11 20:49:26 +00:00
Rachael Sewell
7061516b37 allow videos to be versioned on landing pages (#29781) 2022-08-10 20:06:33 +00:00
Kevin Heis
101e7155c8 userLanguage in browser instead of XHR (#29782)
* userLanguage in browser instead of XHR

* refactors on pr 29782 (#29798)

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-08-10 15:28:21 +00:00
Kevin Heis
04f38e4779 Parse color_mode cookie in browser (#29738)
* Parse color_mode cookie in browser

* Update useTheme.ts

* Update use-theme.js

* Update use-theme.js

* Add support for dark_high_contrast

Per https://primer.style/css/support/theming

I also checked all the color mode options, this is the only additional working with Primer 20 so far

* Remove gray bg

* Remove  type

* Use defaults instead of types for fn args

* Thicker types
2022-08-09 16:48:18 +00:00
Kevin Heis
d21bbbcc55 Skip upgradeInsecureRequests on localhost (#29668) 2022-08-08 15:19:46 +00:00
Peter Bengtsson
a1e3866fa5 don't get available languages from session (#29715)
* don't get available languages from session

* update useSession

* one more fix
2022-08-08 11:13:27 -04:00
Kevin Heis
928b01d1e3 Cache in fastly much longer than browser (#29682)
* Cache in fastly much longer than browser

* Update render-page.js

* Update cache-control.js
2022-08-05 22:59:14 +00:00
Peter Bengtsson
f8f20605f4 search api with elasticsearch (#29053)
* indexing records into Elasticsearch

* @elastic/elasticsearch@8.2.0

* mv

* fix the code

* pipe

* lfs

* use sha

* change how index names work

* search api with Elasticsearch

* works

* refactor client

* better snowballing

* remove dbg

* wip

* highlights and fuzzy search

* improvements and upgrade

* also upgrade

* wip

* index more explicitly

* better validation

* change max size

* popularity by ordinal ranking instead

* playing

* fix package-lock

* rearranging

* catchMiddlewareError

* fix indexing

* match_phrase_prefix on wrapped search

* refactorings

* escape html in content

* wip

* search by URL

* update lock file

* v1 api

* inroads on jest testing the search

* valid yaml hopefully

* index fixtures into local elasticsearch

* specific versions to index only

* small fixes

* feedbacked

* fix tests

* use the npm script
2022-08-05 19:40:38 +00:00
Peter Bengtsson
67c1ff3441 Remove overload protection (#29659) 2022-08-05 15:04:33 +00:00
Kevin Heis
56aa9ea094 Move use session to its own hook file (#29641)
* Move use session to its own hook file

* Trying useSWR

* Try one hour html cache

* blah blah lint

* Update to include loading state

* Update components/hooks/useSession.ts

Co-authored-by: Peter Bengtsson <peterbe@github.com>

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-08-05 14:47:10 +00:00
Kevin Heis
bb1f30a39b Update HTML cache control to 10 minutes (#29586)
* Update HTML cache control to 10 minutes

* A little clean up

* Remove quick-lru
2022-08-03 20:39:54 +00:00
Rachael Sewell
467459af7c Reactify graphql pages (#28547) 2022-08-03 10:51:21 -07:00
Kevin Heis
bee3b5c9f3 Enable up to one minute of HTML caching (#29572)
* Enable up to one minute of HTML caching

* Skip a test that isn't the level of cache control we now want
2022-08-03 16:26:53 +00:00
Kevin Heis
f8d2395960 Remove theme from HTML (#29560)
* Remove theme from HTML

* update for linting error

* Fix for overriding default color modes

Co-authored-by: Grace Park <lugraciecy@gmail.com>
Co-authored-by: Grace Park <gracepark@github.com>
2022-08-02 17:06:54 -07:00
Kevin Heis
11267f2404 Explicitly no cache on /api/events (#29549) 2022-08-02 18:22:17 +00:00
Kevin Heis
a16aeac936 Prepare render-page for re-enabling HTML caching (#29473)
* Prepare render-page for re-enabling HTML caching

* Prepare render-page for re-enabling HTML caching

* Prepare render-page for re-enabling HTML caching

* Update healthz.js

* Pre calculate cache control directives

* Update render-page.js
2022-07-29 19:49:36 +00:00
Kevin Heis
0886faddac Move language context to browser/session (#29433) 2022-07-28 18:50:46 +00:00
Kevin Heis
f79e1d2cb7 Fetch CSRF token over XHR (browser-side) (#29337)
* Client side csrf token grab

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Remove test refs to meta tag

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Fix some type issues

* Simplify api

* Update components/lib/get-session.ts

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-07-27 16:18:07 +00:00
Kevin Heis
bb3cb78dd1 Move events under api (#29298) 2022-07-26 18:00:58 +00:00
Kevin Heis
2182ff28f3 Next12 now supports ESM (#29295)
* Next12 now supports ESM

* No more michael jackson script extensions

* Fix test running

* Update jest-puppeteer.config.cjs

* Update package.json
2022-07-26 17:53:23 +00:00
Kevin Heis
564e3a5e2a Move CSRF response back to XHR (Node.js prep) (#29179)
* Move CSRF response back to XHR

* Update events.js

* Pass through cookieJar

* Enable session route test

* Skip next x csrf test

* Add other fields to endpoint for future issues

* Remove client side parts

* Revert test skip

* Use nested router pattern

* ugh forgot a file

* Update naming

* Update tests/rendering/session.js

Co-authored-by: Peter Bengtsson <peterbe@github.com>

* Updating to use cache control

* Use req.langauge and req.userLanguage

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-07-22 18:17:22 +00:00
Peter Bengtsson
cc197ccbf1 make it possible to control the rendering cache LRU sizes (#29180)
* make it possible to control the rendering cache LRU sizes

* Update middleware/cache-full-rendering.js

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>

* Update middleware/cache-full-rendering.js

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>
2022-07-20 20:45:06 +00:00
Peter Bengtsson
9dce4cd96d redirect to language url for ghes 3.0 and 3.1 (#29136)
Co-authored-by: Hector Alfaro <hectorsector@github.com>
2022-07-19 15:22:48 +00:00
Peter Bengtsson
4bff926c7e inject language for legact admin/release-notes URLs (#29082) 2022-07-15 20:28:31 +00:00
Peter Bengtsson
e0a20add31 //en/some/path should redirect to /en/some/path (#29077)
* //en/some/path should redirect to /en/some/path

* remove debugging
2022-07-15 19:16:42 +00:00
Peter Bengtsson
642c971049 morgan logging off by default in tests (#28987) 2022-07-12 20:53:34 +00:00
Peter Bengtsson
2ebfb60b4b refactor how archived frontmatter fallbacks work (#28170)
* refactor how archived frontmatter fallbacks work

* delete no-longer used file

* avoid the mention

* Update lib/redirects/README.md

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2022-07-12 20:23:05 +00:00
Matt Pollard
aa5130d3f5 Merge branch 'main' into imjohnbo-content-plan-6764 2022-07-02 12:34:14 +02:00
Peter Bengtsson
c1f0030e3a NextJS 12.1.6 (#26102)
* nextjs 12.1.0

* no idea what's going on

* desperate attempts

* wip

* lots of data is necessary for 'npm run build' now

* tidying up

* update package lock
2022-06-28 12:57:38 +00:00
Kevin Heis
f948c81038 Upgrade got (#28617)
* Upgrade got

* Update e2etest.js

* Skip following redirects on redirect tests

* Update deprecated-enterprise-versions.js
2022-06-21 16:23:51 +00:00
Peter Bengtsson
a39614fdcf remove supertest dependency (#28572)
* remove supertest dependency

* remove bad test
2022-06-16 15:56:41 +00:00
Peter Bengtsson
d4692b208e put the full plan name in the page titles (#28450)
* put the full plan name in the page titles

* fix tests
2022-06-16 13:29:23 +00:00
Peter Bengtsson
071c95a91c make miniToc pure data and no html strings (#28517)
* make miniToc pure data and no html strings

* fixups

* some types refactoring
2022-06-15 18:31:36 +00:00
Laura Coursen
799f2a5dec Merge branch 'main' into imjohnbo-content-plan-6764 2022-06-15 08:14:39 +01:00
Kevin Heis
71fedb1f31 Update to helmet 5 (#28488)
* Update to helmet 5

* Disable cross-origin-embedder-policy

* Update helmet.js

* Update helmet.js

* Add CORS on get / options

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Revert "Update helmet.js"

This reverts commit 61ad2fb641ca16a31bf148164c395f2ba91e1734.

* Open up github domains

* Include self

* Update helmet.js

* Update helmet.js
2022-06-14 21:43:25 +00:00
Sarah Schneider
157c82b09c error message tweaks for clarity 2022-06-13 16:10:40 -04:00
Peter Bengtsson
c45c378ad7 memoize reading lib/graphql/static/schema*.json files (#28443) 2022-06-13 18:21:22 +00:00