Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove importance="high" #1014

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions modules/backend/layouts/_head.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
]);
?>

<?php foreach ($styles as $style): ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<?php foreach ($styles as $style) : ?>
<link rel="preload" href="<?= $style . '?v=' . $coreBuild; ?>" as="style">
<link rel="stylesheet" href="<?= $style . '?v=' . $coreBuild; ?>">
<?php endforeach; ?>

<?php foreach ($scripts as $script): ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<?php foreach ($scripts as $script) : ?>
<link rel="preload" href="<?= $script . '?v=' . $coreBuild; ?>" as="script">
<script src="<?= $script . '?v=' . $coreBuild; ?>"></script>
<?php endforeach; ?>

<?php if (!Config::get('cms.enableBackendServiceWorkers', false)): ?>
Expand Down
12 changes: 6 additions & 6 deletions modules/backend/layouts/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
];
?>

<?php foreach ($styles as $style): ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<?php foreach ($styles as $style) : ?>
<link rel="preload" href="<?= $style . '?v=' . $coreBuild; ?>" as="style">
<link rel="stylesheet" href="<?= $style . '?v=' . $coreBuild; ?>">
<?php endforeach; ?>

<?php foreach ($scripts as $script): ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-cfasync is still required AFAIK is it not? It's to prevent CloudFlare's Rocket Loader from breaking the backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to be doing anything, nothing is broken without it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will break sites for people who use CloudFlare Rocket Loader, but ideally, I would like for us to not have platform-specific fixes in core code and delegate it to a plugin, if it all possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we do handle it via a plugin (https://github.com/wintercms/wn-cloudflare-plugin/blob/main/Plugin.php#L43-L54) but these are different because they're manually included instead of going through the AssetMaker trait.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth us changing these to go through AssetMaker then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bennothommo if you feel like doing that, sure 😉

<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<?php foreach ($scripts as $script) : ?>
<link rel="preload" href="<?= $script . '?v=' . $coreBuild; ?>" as="script">
<script src="<?= $script . '?v=' . $coreBuild; ?>"></script>
<?php endforeach; ?>

<?php if (!Config::get('cms.enableBackendServiceWorkers', false)): ?>
Expand Down
Loading