Commit Graph

39551 Commits

Author SHA1 Message Date
Daniel Lockyer
dd68fca968 Replaced lodash.{pick,union} with native JS
- this code is a hotpath for the URL service and has shown to be slow
  for sites with a lot of posts
- this is because of the overhead of lodash
- we can just do away with lodash and use native JS, which has
  a negligible performance cost
- this cuts about 5% CPU time during boot of large sites
2024-10-14 14:37:54 +02:00
Daniel Lockyer
30220aa6ef Stripped moment from BaseSiteMapGenerator
- moment calls are unbelievably heavy and we should do away with it
  where possible
- this code doesn't need moment and we can just use native JS Date here
- this saves about 5% CPU time when booting sites with a lot of posts
2024-10-14 14:37:54 +02:00
Daniel Lockyer
b376585c64 Optimized Resources constructor
- this code has shown to be chronically slow, due to the `Object.assign`
- we don't really need this, as we can just use a normal assign in this
  case
- this cuts 15% CPU from boot time for sites with a lot of resources
  (posts)
2024-10-14 14:37:54 +02:00
Daniel Lockyer
90fbbe135f Deferred URL generation until after filter
- it turns out we it the false case of this if-statement quite a lot,
  and _generateUrl is heavy enough that we should try and do it less
- by moving it into the if-statement, we cut 4% CPU time from boot on
  heavy sites
2024-10-14 14:37:54 +02:00
Daniel Lockyer
70eb96f33a Replaced lodash.each with native JS in raw_knex
- lodash adds non-negligible runtime to this loop, so we can just
  replace it with native JS and cut 3% CPU time from boot for sites
  with a large number of posts
2024-10-14 14:37:54 +02:00
Daniel Lockyer
b0cf15cb94 Refactored Resources._fetch to async-await
- aids with readability
2024-10-14 14:37:54 +02:00
Daniel Lockyer
df76883378 Optimized date + boolean deserialization code
- we have to deserialize the values from the DB to turn them into moment + boolean values
- the use of lodash adds unnecessary overhead to the function, and writing it in native JS
  is a low faster
- also fixes the naming of the functions to make it clearer in flamegraphs
2024-10-14 14:37:54 +02:00
renovate[bot]
a2afc0af75 Update dependency i18next to v23.16.0 2024-10-14 00:24:58 +00:00
renovate[bot]
346f41991f Update dependency yjs to v13.6.20 2024-10-14 00:24:37 +00:00
renovate[bot]
32419e4e07 Update dependency use-debounce to v10.0.4 2024-10-14 00:24:20 +00:00
Chris Raible
a09abaf8a5
Changed VSCode settings.json to ignore git submodules (#21286)
no issue

- This removes the `casper` and `source` submodules from the VSCode
source control sidebar to simplify the view.
- It also points all of VSCode's `git` commands in the command palette
to the root repository (Ghost), so you don't have to specify which repo
you want to commit to every time.
- With this, you can simply run the "Git commit all" command in VSCode
(and optionally map a keybinding to it), which adds all changed files to
the commit and prompts for a commit message.
2024-10-13 07:21:53 -07:00
Chris Raible
401ec7d14d
Improved pre-commit hook to automatically remove submodules (#21222)
no issue

# Before
The pre-commit hook would abort the commit if any submodules were staged
for commit, and prompt the user to manually un-stage them and retry the
commit.

# Now
The pre-commit hook automatically un-stages any staged submodules, then
allows the commit to proceed.

# Why?
This was a daily annoyance that caused many common git commands to
abort, and required manual un-staging of the submodules before retrying
the commit:
- `git commit -a`
- `git add . && git commit`
- `git add -A && git commit`

If we ever _do_ need to commit submodules, we can always add them back
and run `git commit --no-verify` to accomplish that (which we would have
needed to do before regardless). This should accomplish the same goal of
not allowing submodules to be committed, but reduce the day to day
friction of making commits in Ghost.
2024-10-12 03:40:31 -07:00
Ghost CI
b7409ff3d2 v5.96.1 2024-10-11 15:05:17 +00:00
Kevin Ansfield
54a7f70a3c Removed lodash usage from config helpers
no issue

- config helpers are required early during boot and it requiring lodash added some unnecessary require+compile time
- switched to using an inlined escapeRegExp function in place of requiring lodash
2024-10-10 17:44:24 +01:00
Kevin Ansfield
8d4d6b6516 Removed lodash usage from config utils
no issue

- config utils are required early during boot and it requiring lodash added some unnecessary require+compile time
- switched to using native JS for the few lodash methods we used
2024-10-10 17:26:19 +01:00
Kevin Ansfield
e97717a0cc Added flag to skip gscan checks during boot
no issue

- bumped gscan version to provide `skipChecks` flag to `check` function
- added `optimization:themes:skipBootChecks` config flag defaulting to `false` to maintain current behaviour
  - updated theme service initialization to use `skipChecks: true` when the config flag is set
  - we only want to skip the checks during boot in specific cases to improve performance, they are still useful for general development and any production use-cases where themes get edited directly on the server
- updated our theme validate module to accept and pass through `skipChecks` option
- switched the `isZip` positional argument of `validate.check()` to an options object property to make usage cleaner
2024-10-10 16:27:43 +01:00
Daniel Lockyer
ab4c67f2d2 Lazyloaded cheerio dependency
- this moves cheerio to be lazyloaded
- given there are many uses of cheerio in this file, I've just made a
  helper function to DRY up the code
2024-10-10 14:55:39 +01:00
Daniel Lockyer
b092929bba Lazy-minified assets at first request
- right now, we minify the assets on boot. This is wasteful because they're not even needed
- this commit implements a change which lazy-minifies these assets and
  allows for cache invalidation when the theme changes
- it also introduces some middleware that each asset calls to ensure
  that the assets are minified before serving
2024-10-10 14:36:28 +01:00
Daniel Lockyer
0862989b2e Lazyloaded dependencies
- these dependencies do not need to be eagerly loaded so we can move
  them down to where they are used
2024-10-10 13:38:56 +01:00
Daniel Lockyer
c07a884f23 Remove usage of fs-extra
- we don't need to use fs-extra here when we can use the native fs lib
2024-10-10 13:38:56 +01:00
Daniel Lockyer
e1da082329 Removed Sentry span creation from get helper
- this didn't really end up being useful and it just forces us to
  require the `@sentry/node` dependency, so we can remove it
2024-10-10 13:38:56 +01:00
Daniël van der Winden
2a5ba1c13c
Added hover states for Resource boxes (#21276)
On Post Analytics, and on the Dashboard, the resource boxes did not have
a hover state, making them look very static. They now have a hover
state.
2024-10-10 10:24:06 +00:00
Djordje Vlaisavljevic
598ce03186 Allowed search results to span multiple lines
ref https://linear.app/tryghost/issue/DES-832/admin-search-results-that-span-multiple-lines-get-cut-off
2024-10-10 11:07:48 +01:00
Djordje Vlaisavljevic
29dd2bca8d Fixed alignment of icon and text in admin search
ref https://linear.app/tryghost/issue/DES-806/fix-alignment-of-search-input-field
2024-10-10 11:07:48 +01:00
Djordje Vlaisavljevic
3c3b001df2 Made newsletter preference toggles more compact on Member details screen
ref https://linear.app/tryghost/issue/DES-818/toggles-are-huge-lets-make-them-more-elegant

- They were too big and stood out too much on this screen, the `xs` variant fits better
2024-10-10 10:55:10 +01:00
Djordje Vlaisavljevic
bce8687004
Added nicer apostrophes (#21271)
ref https://linear.app/tryghost/issue/DES-814/replace-dumb-quotes-with-smart-quotes-in-admin

- Replaced “dumb” apostrophes with “smart” (or “curly”) apostrophes, see
http://quotesandaccents.com/
2024-10-10 10:11:19 +01:00
Kevin Ansfield
2036747bef Standardised mobiledocLib renderer access
no issue

- avoid accessing `mobiledocLib.mobiledocHtmlRenderer` directly to access the `render()` method in favor of using `mobiledocLib.render()` instead
- standardising on this pattern should help avoid accidentally requiring the full library before we have a need to render
2024-10-09 17:26:05 +01:00
Kevin Ansfield
e136ecb09f Removed init of mobiledoc html renderer on boot
no issue

- the lazy-loading `mobiledocHtmlRenderer` getter was being accessed by the email renderer that gets initialized during boot
- switched the pattern to match our lexical lib where we have a `render()` method that doesn't load the renderer until it's actually needed
2024-10-09 17:26:05 +01:00
Daniel Lockyer
67278d91a1 Lazyloaded cheerio dependency
- we can move this lower in the code so it's not eagerly loaded when
  it's not needed
2024-10-09 17:03:04 +01:00
Daniel Lockyer
de5dcb8189 Fixed treeshaking and require size for date-fns
- we don't need to require the entire package and this costs 5% of our
  boot time
- this commit bumps NQL to the latest version, which fixes the requires
  to help with treeshaking and loading less code
2024-10-09 17:03:04 +01:00
Daniel Lockyer
8478a753a9 Refactored assets minification to DRY up implementation
- this moves common logic to a class that all the assets services
  extend
- this allows us to DRY up the implementation to make changes easier
2024-10-09 15:18:33 +01:00
Daniel Lockyer
5dedfbe82e Lazyloaded dependencies
- these dependencies do not need to be eagerly loaded so we can move
  them to the block of code where they are needed
2024-10-09 14:30:32 +01:00
Sag
09b4aceb64
Released Portal v2.44.1 (#21262)
no issue

- this release contains a fix for Tips & Donations for Ghost sites
hosted on subdirectories (commit:
55e415c0c7)
2024-10-09 10:17:02 +00:00
renovate[bot]
1877419939 Update dependency express-session to v1.18.1 2024-10-08 21:05:01 +00:00
renovate[bot]
62d7b7ea52 Update dependency express to v4.21.1 2024-10-08 21:53:17 +01:00
Fabien O'Carroll
72d46a4706 Bumb admin-x-activitypub to 0.1.3 2024-10-08 20:09:32 +01:00
Fabien O'Carroll
18f900f38b Filtered replies out from activities
This is a temporary fix until we're able to work out what's going on in the
backend.
2024-10-08 20:09:32 +01:00
Michael Barrett
20cb63b9c6
Bump admin-x-activitypub to 0.1.2 (#21257)
no refs
2024-10-08 17:52:11 +01:00
Michael Barrett
4058fa2794
Added reply filtering to the activities tab of the activitypub app (#21254)
refs
[TryGhost/ActivityPub#63](https://github.com/TryGhost/ActivityPub/pull/63)
2024-10-08 17:26:59 +01:00
Daniel Lockyer
b49210f4dd Removed duplicate calls to moment()
- the return type of `getLastModifiedForDatum` is a moment object, and
  we're just wrapping it again in another moment call
- moment is very heavy so we shouldn't do it unnecessarily
- this makes boot time 1% quicker of heavy sites
2024-10-08 17:22:50 +01:00
Michael Barrett
f798955bc9
Tweaked feed item when in inbox view (#21255)
no refs
2024-10-08 17:03:14 +01:00
sateshcharan
638e7d8d1a
Added Indian-Tamil translations (#21239)
no issue

--
Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2024-10-08 14:39:32 +00:00
Daniel Lockyer
e5d8294f71 Delayed ember-template-lint warnings
- these have started flagging up again but we don't currently want to
  fix them, so I've regenerated the file to fix linting
2024-10-08 14:34:11 +01:00
Daniel Lockyer
8aa34fcf38 ️ Improved performance of several checks in GScan
ref f57ab075c6

- this commit bumps the GScan version in Ghost to include a commit that
  implements partial caching
2024-10-08 14:34:11 +01:00
Daniel Lockyer
e2d0c2f138 Remove docker-compose version
- this is apparently not needed anymore
2024-10-08 14:34:11 +01:00
Cathy Sarisky
55e415c0c7
🐛Fixed 404 error for Tips & Donations on subdirectory sites (#21250)
closes #21123 

- There was an error in the calculation of the site's url for sites setup
as subdirectories (yoursite/blog instead of just yoursite/).
- Fixed and tested with a manual build of portal. There's apparently a gap
in test coverage here, as it passed both before and after...
2024-10-08 14:38:53 +02:00
renovate[bot]
747632bf45 Update dependency nx to v19.8.4 2024-10-08 07:40:09 +01:00
renovate[bot]
084022a30d Update dependency html-validate to v8.24.1 2024-10-07 15:13:31 +02:00
Fernando Ochoa
3244cb2e22
Updated Spanish translations in portal.json (#21231)
no issue
2024-10-07 12:07:53 +00:00
Duy
4288232bdb
🌐 Updated Vietnamese translation (#21230)
no issue

- improved Vietnamese translations
- improved i18n support for Portal error messages
(cf. https://github.com/TryGhost/Ghost/pull/21190)
2024-10-07 12:56:01 +02:00