Account created on 12 March 2018, almost 7 years ago
#

Merge Requests

Recent comments

Hi @kingdutch,
I can confirm that web worker prevents the page freezes.
Nevertheless, I did some research, and found the reason of those freezes, it is related mainly to findKeywordInFirstParagraph and KeywordDensityAssessment stuff.

In getSentences.js there is a code:

exports.default = function (text) {
	text = (0, _unifyWhitespace.unifyNonBreakingSpace)(text);
	let blocks = (0, _html.getBlocks)(text);

	// Split each block on newlines.
	blocks = (0, _lodashEs.flatMap)(blocks, function (block) {
		return block.split(newLineRegex);
	});

It takes sometime for it to execute on long strings.
I have no freezes even with 600kb body text, but have ones if set in SEO widget to use the default display mode, which also parses header and footer because of Layout Builder.

So if there is any base64 image it will freeze in order to do some operations by researcher. In my case it was 78kb long base64 string, making the researcher stuck.
Replacing it with svg ~10kb resolves the issue, but still a small delay is present.
So, without web worker the only solution to fix it without having preview button - use pre-defined display mode for SEO.

I have resolved the same issue with the help of this hook:

function hook_components_namespaces_alter(array &$namespaces, string $theme) {
  if ('FRONT_END_THEME' === $theme) {
    return;
  }

  $theme_handler = \Drupal::service('theme_handler');
  $registry = \Drupal::service('components.registry');
  $namespaces = $registry->getNamespaces($theme_handler->getDefault());
}

So every other than the default front-end theme will use the same namespaces defined inside front-end-theme.info.yml.

I have tested it with ui_patterns and views and now all components are loaded with no issues under the admin theme.

@stBorchert But your entity type manager just replaces the handler of User entity:

$entity_type = 'user'
$class = 'Drupal\pach\Entity\EntityAccessControlHandler';
$this->handlers[$handler_type][$entity_type] = $this->createHandlerInstance($class, $definition);

Yes, you don't override those methods, but you also don't use core UserAccessControlHandler class anymore, instead, your own $class is used.

Hi @stBorchert

I didn't work on that project recently, so I tried to update Drupal up to latest 10.2.5 version so I could use latest 10.0.0 pach module.
Unfortunately, I still see the issue here.

So the issue is that your module decorates all entities with the same Handler, see the function EntityTypeManager::getHandler line
$class = 'Drupal\pach\Entity\EntityAccessControlHandler';
then class EntityAccessControlHandler extends CoreEntityAccessControlHandler
but if u check User entity, it has own UserAccessControlHandler which u totally skip:
class UserAccessControlHandler extends EntityAccessControlHandler

That leads us to the issue when for instance we can see disabled profile fields, see my screen:

Production build 0.71.5 2024