From 0c719f33f7dd3f127d6f67084bb1857af0d8b4de Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 17 Jul 2023 12:45:16 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20memberlinks=20return?= =?UTF-8?q?ing=20undefined=20in=20autocomplete.=20(#17385)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Ghost/pull/17327 - Added an additional condition to avoid the new memberLinks function from returning undefined, which may lead to nothing being returned at all in the autocomplete. --- Improved `memberLinks` function in `koenig-lexical-editor.js` to support optional links and fix a bug. --- ghost/admin/app/components/koenig-lexical-editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/koenig-lexical-editor.js b/ghost/admin/app/components/koenig-lexical-editor.js index f4df027de2..7963ad19b0 100644 --- a/ghost/admin/app/components/koenig-lexical-editor.js +++ b/ghost/admin/app/components/koenig-lexical-editor.js @@ -264,8 +264,9 @@ export default class KoenigLexicalEditor extends Component { }); const memberLinks = () => { + let links = []; if (this.membersUtils.paidMembersEnabled) { - return [ + links = [ { label: 'Paid signup', value: this.config.getSiteUrl('/#/portal/signup') @@ -275,6 +276,8 @@ export default class KoenigLexicalEditor extends Component { value: this.config.getSiteUrl('/#/portal/account/plans') }]; } + + return links; }; return [...defaults, ...offersLinks, ...memberLinks()]; }; From 53096e214cd69310c026199a936d2846af7714d0 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 17 Jul 2023 14:42:55 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20poor=20performance?= =?UTF-8?q?=20when=20rendering=20beta=20editor=20posts=20(#17388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - bumps `@tryghost/kg-lexical-html-renderer` which includes a change to drastically reduce the number of `jsdom` instantiations made when rendering text content --- ghost/admin/package.json | 6 ++--- ghost/core/package.json | 4 ++-- yarn.lock | 50 +++++++++++++++------------------------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 4d3884de95..bc4f9e5210 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -44,9 +44,9 @@ "@tryghost/color-utils": "0.1.24", "@tryghost/ember-promise-modals": "2.0.1", "@tryghost/helpers": "1.1.77", - "@tryghost/kg-clean-basic-html": "3.0.19", + "@tryghost/kg-clean-basic-html": "3.0.21", "@tryghost/kg-converters": "0.0.7", - "@tryghost/kg-parser-plugins": "3.0.18", + "@tryghost/kg-parser-plugins": "3.0.22", "@tryghost/kg-simplemde": "1.11.2", "@tryghost/limit-service": "1.2.6", "@tryghost/members-csv": "0.0.0", @@ -184,4 +184,4 @@ "path-browserify": "1.0.1", "webpack": "5.88.1" } -} \ No newline at end of file +} diff --git a/ghost/core/package.json b/ghost/core/package.json index f6851c692c..efa72c6c66 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -102,8 +102,8 @@ "@tryghost/kg-card-factory": "4.0.8", "@tryghost/kg-default-atoms": "4.0.1", "@tryghost/kg-default-cards": "9.1.0", - "@tryghost/kg-default-nodes": "0.1.7", - "@tryghost/kg-lexical-html-renderer": "0.3.2", + "@tryghost/kg-default-nodes": "0.1.8", + "@tryghost/kg-lexical-html-renderer": "0.3.4", "@tryghost/kg-mobiledoc-html-renderer": "6.0.8", "@tryghost/limit-service": "1.2.6", "@tryghost/link-redirects": "0.0.0", diff --git a/yarn.lock b/yarn.lock index e6dc9df750..cf859e762a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6746,15 +6746,10 @@ resolved "https://registry.yarnpkg.com/@tryghost/kg-card-factory/-/kg-card-factory-4.0.8.tgz#3799e256ce67f926ad5045a63c2c241b1b6ede5a" integrity sha512-mQNs5gw63U26HPsOtlZ8U3jmUHTRMWXECTjIaP1QKWGFcsbAZqNHIGDCbJSqskCqwsrdi8PibZckfYLKozYCCw== -"@tryghost/kg-clean-basic-html@3.0.19": - version "3.0.19" - resolved "https://registry.yarnpkg.com/@tryghost/kg-clean-basic-html/-/kg-clean-basic-html-3.0.19.tgz#52c18089acfc56ac8a20f0048f5fb99c47c6b4b4" - integrity sha512-6mheKCHAD7TLvFl3BEOZpMenc5lv/+/k6rq49OCYBJISWIbW8SkyqG3Yqgu1BB4cSyMFsprGr7yuOTIHSJPREw== - -"@tryghost/kg-clean-basic-html@^3.0.17", "@tryghost/kg-clean-basic-html@^3.0.20": - version "3.0.20" - resolved "https://registry.yarnpkg.com/@tryghost/kg-clean-basic-html/-/kg-clean-basic-html-3.0.20.tgz#dffc432648eb67604f2f019ae6da62648e26883d" - integrity sha512-JEZuLqgNIL6CNdPf5CGBRf27Qzc/GpNRmYyf449XxtzK6sb9XOrsuNczY6dpjiJxkMSA/1Wtq7gkQmBX1xfdJg== +"@tryghost/kg-clean-basic-html@3.0.21", "@tryghost/kg-clean-basic-html@^3.0.21": + version "3.0.21" + resolved "https://registry.yarnpkg.com/@tryghost/kg-clean-basic-html/-/kg-clean-basic-html-3.0.21.tgz#27f90937c2bbd2db6c51d879533179c517a44531" + integrity sha512-M3yfVtd3wo8GhOZI3s3OxT/y2susVtGfqiE/6v7o0GAxTTORil4zrAywkxkKfuHJzFd1Nq2ZYuwvQhhv6VlvNA== "@tryghost/kg-converters@0.0.7": version "0.0.7" @@ -6781,12 +6776,12 @@ lodash "^4.17.21" luxon "^3.0.0" -"@tryghost/kg-default-nodes@0.1.7", "@tryghost/kg-default-nodes@^0.1.7": - version "0.1.7" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.1.7.tgz#715f4c2bc8b6c44228a97c410ebb312d476673b8" - integrity sha512-O869lR+irVWEAj3XP+RPX4v+UYyH1HjlC/ZtFsjMnE5+vRg1SxFthPV/ZoVEeegCgIGs/UXfYsGHbl2ok4cWjg== +"@tryghost/kg-default-nodes@0.1.8", "@tryghost/kg-default-nodes@^0.1.8": + version "0.1.8" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.1.8.tgz#3fb2b3f73f06dce05d078662de44a704b52e1254" + integrity sha512-vF5wT6elrxV5sGBNIxC+vXTnFFNXwwUlsrv75xFF0yfj6fqYTbz8R9fvhBK33WSl2f/2jER1+ArMoyFmYgRYiA== dependencies: - "@tryghost/kg-clean-basic-html" "^3.0.20" + "@tryghost/kg-clean-basic-html" "^3.0.21" "@tryghost/kg-markdown-html-renderer" "^6.0.8" html-minifier "^4.0.0" jsdom "^21.0.0" @@ -6794,10 +6789,10 @@ lodash "^4.17.21" luxon "^3.3.0" -"@tryghost/kg-lexical-html-renderer@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.3.2.tgz#207e5220d667c5219834155ff562c17637983bd1" - integrity sha512-sGbSpb+Bs9wHA5/4J/xe7MZR/3hi9GMJ29OT2dl6PKstfohkoWFewx2ZQlFmbjneBp+Z0g+yWivvnkSC8Nkyvg== +"@tryghost/kg-lexical-html-renderer@0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.3.4.tgz#a347b9ca776996dfd123f679618276a6695afe85" + integrity sha512-NJin4vkBa+779hQuwWjf5ULsO197DPC84VTkmbHcPqoJeMS5cPCwGGS0hmKLMw0jmZaBVtK7iunXh495GhwpxQ== dependencies: "@lexical/clipboard" "^0.11.0" "@lexical/code" "^0.11.0" @@ -6805,7 +6800,7 @@ "@lexical/link" "^0.11.0" "@lexical/list" "^0.11.0" "@lexical/rich-text" "^0.11.0" - "@tryghost/kg-default-nodes" "^0.1.7" + "@tryghost/kg-default-nodes" "^0.1.8" jsdom "^22.1.0" lexical "^0.11.0" prettier "^2.7.1" @@ -6834,19 +6829,12 @@ mobiledoc-dom-renderer "^0.7.0" simple-dom "^1.4.0" -"@tryghost/kg-parser-plugins@3.0.18": - version "3.0.18" - resolved "https://registry.yarnpkg.com/@tryghost/kg-parser-plugins/-/kg-parser-plugins-3.0.18.tgz#b5ec1db355c5f9668d140be4cbf9231b972d49b2" - integrity sha512-vF4uvT277iFNMHPZq2omvRyq/kDtZT7sTpd3iVWgKS5bxLDUwOghKFTzcBfeZrBcIOwDpnY411Ss4afQtIvhzg== +"@tryghost/kg-parser-plugins@3.0.22", "@tryghost/kg-parser-plugins@^3.0.21": + version "3.0.22" + resolved "https://registry.yarnpkg.com/@tryghost/kg-parser-plugins/-/kg-parser-plugins-3.0.22.tgz#6c0c773080aeccb5f20fa51b11a543ce4a4dc56b" + integrity sha512-KPY1izG1Z14SzvIzFO3jdV24w8azbbpZpXylPH9xsnny0j5LP9iOkb96DyIFWw63CBTidmW6eic2c76dfC5j6Q== dependencies: - "@tryghost/kg-clean-basic-html" "^3.0.17" - -"@tryghost/kg-parser-plugins@^3.0.21": - version "3.0.21" - resolved "https://registry.yarnpkg.com/@tryghost/kg-parser-plugins/-/kg-parser-plugins-3.0.21.tgz#dd79cdbeb951096197e3288f401f3b3c9e8f41b7" - integrity sha512-JmZAsXdwEYPulvWTJ2ZYKU8j2Urab1OzPwQO9mG0RVJ9B1EHpjFO+eXK+bk46jgFIw2YV9iefADiUe19ugpC+w== - dependencies: - "@tryghost/kg-clean-basic-html" "^3.0.20" + "@tryghost/kg-clean-basic-html" "^3.0.21" "@tryghost/kg-simplemde@1.11.2": version "1.11.2" From 27d8441098b127a0ebb36f304819f1bf719fa9c8 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 17 Jul 2023 15:22:31 +0200 Subject: [PATCH 3/6] Reverted "Enabled Sentry Replay within Admin" refs https://ghost.slack.com/archives/C02G9E68C/p1689599266267649 - this reverts commit bb6deda10edfe4ae85c989d6d2110b906b7edb3e - we're seeing some weird errors when Admin boots otherwise --- ghost/admin/app/routes/application.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/ghost/admin/app/routes/application.js b/ghost/admin/app/routes/application.js index a5eb126732..849429bc65 100644 --- a/ghost/admin/app/routes/application.js +++ b/ghost/admin/app/routes/application.js @@ -1,9 +1,9 @@ -import * as Sentry from '@sentry/ember'; import AuthConfiguration from 'ember-simple-auth/configuration'; import Route from '@ember/routing/route'; import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route'; import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd'; import windowProxy from 'ghost-admin/utils/window-proxy'; +import {InitSentryForEmber} from '@sentry/ember'; import {inject} from 'ghost-admin/decorators/inject'; import { isAjaxError, @@ -161,7 +161,7 @@ export default Route.extend(ShortcutsRoute, { // init Sentry here rather than app.js so that we can use API-supplied // sentry_dsn and sentry_env rather than building it into release assets if (this.config.sentry_dsn) { - Sentry.init({ + InitSentryForEmber({ dsn: this.config.sentry_dsn, environment: this.config.sentry_env, release: `ghost@${this.config.version}`, @@ -171,18 +171,6 @@ export default Route.extend(ShortcutsRoute, { event.tags.grammarly = !!document.querySelector('[data-gr-ext-installed]'); return event; }, - - // Enable collecting Replay events - integrations: [ - new Sentry.Replay() - ], - - // Don't collect any Replays for general users - replaysSessionSampleRate: 0, - - // Collect all Replays coming from errors - replaysOnErrorSampleRate: 1.0, - // TransitionAborted errors surface from normal application behaviour // - https://github.com/emberjs/ember.js/issues/12505 ignoreErrors: [/^TransitionAborted$/] From dc2c8330af84efad8899ba2a3e52bcb9ebbb7c63 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 17 Jul 2023 10:48:08 +0200 Subject: [PATCH 4/6] Configured Admin to use CDN URLs for lazy-loaded assets refs https://github.com/TryGhost/DevOps/issues/47 - this allows Ghost to use a different URL for lazy-loaded assets, so it can be loaded from a CDN --- ghost/admin/app/services/lazy-loader.js | 6 ++---- ghost/admin/config/environment.js | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ghost/admin/app/services/lazy-loader.js b/ghost/admin/app/services/lazy-loader.js index 454141f323..0f1f14a4c0 100644 --- a/ghost/admin/app/services/lazy-loader.js +++ b/ghost/admin/app/services/lazy-loader.js @@ -32,12 +32,10 @@ export default class LazyLoaderService extends Service { } let scriptPromise = new RSVP.Promise((resolve, reject) => { - let {adminRoot} = this.ghostPaths; - let script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; - script.src = `${adminRoot}${url}`; + script.src = `${config.cdnUrl || this.ghostPaths.adminRoot}${url}`; let el = document.getElementsByTagName('script')[0]; el.parentNode.insertBefore(script, el); @@ -65,7 +63,7 @@ export default class LazyLoaderService extends Service { let link = document.createElement('link'); link.id = `${key}-styles`; link.rel = alternate ? 'alternate stylesheet' : 'stylesheet'; - link.href = `${this.ghostPaths.adminRoot}${url}`; + link.href = `${config.cdnUrl || this.ghostPaths.adminRoot}${url}`; link.onload = () => { link.onload = null; if (alternate) { diff --git a/ghost/admin/config/environment.js b/ghost/admin/config/environment.js index 47d5498668..adf7305e19 100644 --- a/ghost/admin/config/environment.js +++ b/ghost/admin/config/environment.js @@ -5,6 +5,7 @@ module.exports = function (environment) { let ENV = { modulePrefix: 'ghost-admin', environment, + cdnUrl: process.env.GHOST_CDN_URL || '', rootURL: '', locationType: 'trailing-hash', EmberENV: { @@ -33,7 +34,7 @@ module.exports = function (environment) { 'ember-simple-auth': { }, - 'ember-websockets': { + 'ember-websockets': { socketIO: true }, From 999425ccf64f9139651e7df14327076ec7dc0d97 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 17 Jul 2023 13:44:50 +0200 Subject: [PATCH 5/6] Fixed loading CDN assets via lazy loading refs https://github.com/TryGhost/DevOps/issues/47 - in the event we supply a CDN URL, don't prefix the URL with anything as this will get auto-prefixed - if not, add the Ghost Admin root because the assets sit under there --- ghost/admin/app/services/lazy-loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/services/lazy-loader.js b/ghost/admin/app/services/lazy-loader.js index 0f1f14a4c0..ab990f4f39 100644 --- a/ghost/admin/app/services/lazy-loader.js +++ b/ghost/admin/app/services/lazy-loader.js @@ -35,7 +35,7 @@ export default class LazyLoaderService extends Service { let script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; - script.src = `${config.cdnUrl || this.ghostPaths.adminRoot}${url}`; + script.src = `${config.cdnUrl ? '' : this.ghostPaths.adminRoot}${url}`; let el = document.getElementsByTagName('script')[0]; el.parentNode.insertBefore(script, el); @@ -63,7 +63,7 @@ export default class LazyLoaderService extends Service { let link = document.createElement('link'); link.id = `${key}-styles`; link.rel = alternate ? 'alternate stylesheet' : 'stylesheet'; - link.href = `${config.cdnUrl || this.ghostPaths.adminRoot}${url}`; + link.href = `${config.cdnUrl ? '' : this.ghostPaths.adminRoot}${url}`; link.onload = () => { link.onload = null; if (alternate) { From b74e29aa703819118bb2805065caffbeee146647 Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:18:33 +0000 Subject: [PATCH 6/6] v5.54.3 --- ghost/admin/package.json | 4 ++-- ghost/core/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index bc4f9e5210..e490c7fca7 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.54.2", + "version": "5.54.3", "description": "Ember.js admin client for Ghost", "author": "Ghost Foundation", "homepage": "http://ghost.org", @@ -184,4 +184,4 @@ "path-browserify": "1.0.1", "webpack": "5.88.1" } -} +} \ No newline at end of file diff --git a/ghost/core/package.json b/ghost/core/package.json index efa72c6c66..570ae1f01e 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.54.2", + "version": "5.54.3", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",