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

MWPW-137930 DCXY-18989 if snippet is loaded inline, use it #417

Merged
merged 7 commits into from
Oct 18, 2023

Conversation

peller
Copy link
Collaborator

@peller peller commented Oct 13, 2023

The edge worker will load the dc-generate-cache snippet and inline it in the HTML page in a section tag id="edge-snippet". If it's already there, use the DOM rather than fetch it over http.

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 13, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Merging #417 (046aaa2) into stage (dd38327) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            stage     #417      +/-   ##
==========================================
- Coverage   96.61%   96.58%   -0.03%     
==========================================
  Files          26       26              
  Lines        2985     2989       +4     
==========================================
+ Hits         2884     2887       +3     
- Misses        101      102       +1     
Files Coverage Δ
.../blocks/dc-converter-widget/dc-converter-widget.js 99.03% <100.00%> (+<0.01%) ⬆️
acrobat/scripts/scripts.js 96.91% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 13, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/ Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 13, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/fr/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/convert-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 13, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 13, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/fr/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 16, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/fr/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/convert-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@peller peller changed the title DCXY-18989 if snippet is loaded inline, use it MWPW-137930 DCXY-18989 if snippet is loaded inline, use it Oct 16, 2023
@aem-code-sync
Copy link

aem-code-sync bot commented Oct 17, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

@@ -37,6 +37,18 @@ describe('dc-converter-widget', () => {
expect(fetchUrl).toMatch(/^https:\/\/www.adobe.com\/dc\//);
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-undef> reported by reviewdog 🐶
'expect' is not defined.

@@ -37,6 +37,18 @@
expect(fetchUrl).toMatch(/^https:\/\/www.adobe.com\/dc\//);
});

it('handles content inserted from edge', async () => {
delete window.location;
window.location = new URL('https://www.adobe.com');
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <compat/compat> reported by reviewdog 🐶
URL is not supported in op_mini all

section.appendChild(document.createTextNode('content'));
block.appendChild(section);
const widget = await init(block);
expect(document.querySelector('#CID').dataset.rendered).toEqual("true");
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-undef> reported by reviewdog 🐶
'expect' is not defined.

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 17, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/request-signature Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

section.appendChild(document.createTextNode('content'));
block.appendChild(section);
await init(block);
expect(document.querySelector('#CID').dataset.rendered).toEqual('true');
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-undef> reported by reviewdog 🐶
'expect' is not defined.

Copy link
Collaborator

@Blainegunn Blainegunn left a comment

Choose a reason for hiding this comment

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

looks fine to me

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 18, 2023

Page Scores Audits Google
/acrobat/online/compress-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/pdf-to-ppt Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI
/acrobat/online/convert-pdf Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401) PSI

widgetContainer.dataset.rendered = 'true';
widgetContainer.appendChild(...INLINE_SNIPPET.childNodes);
widget.removeChild(INLINE_SNIPPET);
cacheLoad = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-undef> reported by reviewdog 🐶
'cacheLoad' is not defined.

@Blainegunn Blainegunn merged commit 16e4953 into stage Oct 18, 2023
3 of 7 checks passed
@Blainegunn Blainegunn deleted the edge-experiment branch November 14, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants