SlideShare a Scribd company logo
1 of 41
Download to read offline
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
P E R F O R M A N C E D R I V E N
F R O N T E N D D E V E LO P M E N T
A N E E D F O R S P E E D
A L L E N M O O R E | F R O N T- E N D E N G I N E E R
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
W H E R E TO F I N D M E
Twitter: @creativeallen
Personal Blog: allenmoore.me
Github: http://github.com/allenmoore
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
YES, We’re Hiring!
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
H OW S O C I E T Y H AS
S H A P E D T H E W E B
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
H OW A B R OW S E R LOA D S
A W E B PAG E
New tab
Browser downloads a HTML file
Parses through the HTML
Encounters something it needs to load (image, JS file, CSS file, etc.)
Loads external resource
Parses external resource (if CSS or JS)
Continues to parse HTML until it encounters another resource that must be loaded
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
T H E C R I T I C A L R E N D E R I N G
PAT H — A B OV E T H E F O L D
“the code and resources required to render the initial
view of a web page”
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
H OW F R O N T E N D P E R F O R M A N C E
A F F E C T S U S E R E N G AG E M E N T
A N D E X P E R I E N C E
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
U N D E R S TA N D I N G U S E R
F R U S T R AT I O N
“a feeling of anger or annoyance caused by being
unable to do something”
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
P E R F O R M A N C E A N D
AC C E S S I B I L I T Y
“Web accessibility refers to the inclusive practice of
removing barriers that prevent interaction with, or
access to websites, by people with disabilities. When
sites are correctly designed, developed and edited, all
users have equal access to information and
functionality.”
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
P E R F O R M A N C E D R I V E N F R O N T
E N D D E V E LO P M E N T B E S T
P R AC T I C E S
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
I F YO U D O N ’ T N E E D I T,
D O N ’ T LOA D I T.
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E
if ( is_singular()
&& comments_open()
&& get_option( 'thread_comments' ) ) {
wp_enqueue_script(
'comment-reply'
);
}
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
WA I T T I L L L AT E R
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
T H E B A R E N E C E S S I T I E S
( T H E I N I T I A L R E N D E R I N G )
“It’s great to be on the Cutting Edge, but it’s never ok
to be on the Bleeding Edge of the Cutting Edge.”
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
LOA D C R P S T Y L E S I N L I N E , I N T H E
H E A D E R , A N D A L L E L S E I N T H E
F O OT E R
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
G R U N T- C R I T I C A LC S S
criticalcss: {
home: {
options: {
url: 'http://localdomain.dev',
width: 1200,
height: 900,
outputfile: ‘path/to/critical-home.css',
filename: 'path/to/style.css',
buffer: 800*1024,
ignoreConsole: true
}
}
}
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
G R U N T- C R I T I C A LC S S
article: {
options: {
url: 'http://localdomain.dev/article-name/',
width: 1200,
height: 900,
outputfile: 'path/to/critical-article.css',
filename: 'path/to/style.css',
buffer: 800*1024,
ignoreConsole: true
}
}
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
G R U N T- C R I T I C A LC S S
grunt.registerTask('critical', ['criticalcss']);
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
G R U N T- C R I T I C A LC S S
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - I N L I N E C R I T I C A L C S S
<style>
.header {
width: 100%;
background-color: black;
}
.nav {
width: 100%;
height: auto;
}
</style>
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - T H E M E S T Y L E S
<script>
(function () {
function loadCSS(href) {
var ss = window.document.createElement('link'),
ref = window.document.getElementsByTagName('script')[0];
ss.rel = 'stylesheet';
ss.href = href;
ss.media = 'only x';
ref.parentNode.insertBefore(ss, ref);
setTimeout(function () {
ss.media = 'all';
}, 0);
}
loadCSS('<?php echo esc_url( 'styles.css' ); ?>');
})();
</script>
<noscript>
<link rel="stylesheet" href="<?php echo esc_url( 'styles.css' ); ?>">
</noscript>
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - E N Q U E U E I N G J S
function theme_scripts_styles() {
wp_enqueue_script(
‘theme-scripts',
get_template_directory_uri() . ‘/assets/js/scripts.js’,
array(),
‘1.0’,
true
);
}
add_action( 'wp_enqueue_scripts', ‘theme_scripts_styles' );
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - ASY N C J S W I T H S C R I P T
LOA D E R TAG
function async_theme_script( $tag, $handle, $src ) {
if ( 'theme-scripts' !== $handle ) :
return $tag;
endif;
return str_replace( '<script', '<script async', $tag );
}
add_filter( 'script_loader_tag', array( __CLASS__,
'async_theme_script' ), 10, 3 );
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
TO O L S TO M E AS U R E
F R O N T E N D P E R F O R M A N C E
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
B R OW S E R D E V TO O L S
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
T E S T O N A L L T H E
T H I N G S
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
X I P. I O
• Domain name that provides wildcard DNS for any IP
Address.
• Example: yourdomain.192.168.1.100.xip.io
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - X I P. I O
server_name local.dev *.local.dev ~^local.d+.d+.d+.d+.xip.io$;
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
B R OW S E R SY N C
• Keep multiple browsers & devices in sync when building
websites.
• http://www.browsersync.io/
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - B R OW S E R SY N C
browserSync: {
dev: {
bsFiles: {
src : 'path/to/styles.css'
},
options: {
watchTask: true,
proxy: 'yourdomain.dev'
}
}
}
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
E X A M P L E - B R OW S E R SY N C
grunt.registerTask('local', ['default', 'browserSync', 'watch']);
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
O N L I N E TO O L S
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
O N L I N E TO O L S
• Google Page Speed Insights -
• WebPageTest.org
• SiteSpeed.io
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015
Q U E S T I O N S ?
Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015

More Related Content

Recently uploaded

Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 

Recently uploaded (20)

Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

A Need For Speed: Performance Driven Front End Development

  • 1. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 P E R F O R M A N C E D R I V E N F R O N T E N D D E V E LO P M E N T A N E E D F O R S P E E D A L L E N M O O R E | F R O N T- E N D E N G I N E E R
  • 2. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 W H E R E TO F I N D M E Twitter: @creativeallen Personal Blog: allenmoore.me Github: http://github.com/allenmoore
  • 3. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 YES, We’re Hiring!
  • 4. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 H OW S O C I E T Y H AS S H A P E D T H E W E B
  • 5.
  • 6. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 H OW A B R OW S E R LOA D S A W E B PAG E
  • 7. New tab Browser downloads a HTML file Parses through the HTML Encounters something it needs to load (image, JS file, CSS file, etc.) Loads external resource Parses external resource (if CSS or JS) Continues to parse HTML until it encounters another resource that must be loaded
  • 8. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 T H E C R I T I C A L R E N D E R I N G PAT H — A B OV E T H E F O L D
  • 9. “the code and resources required to render the initial view of a web page”
  • 10. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 H OW F R O N T E N D P E R F O R M A N C E A F F E C T S U S E R E N G AG E M E N T A N D E X P E R I E N C E
  • 11. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 U N D E R S TA N D I N G U S E R F R U S T R AT I O N
  • 12. “a feeling of anger or annoyance caused by being unable to do something”
  • 13. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 P E R F O R M A N C E A N D AC C E S S I B I L I T Y
  • 14. “Web accessibility refers to the inclusive practice of removing barriers that prevent interaction with, or access to websites, by people with disabilities. When sites are correctly designed, developed and edited, all users have equal access to information and functionality.”
  • 15. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 P E R F O R M A N C E D R I V E N F R O N T E N D D E V E LO P M E N T B E S T P R AC T I C E S
  • 16. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 I F YO U D O N ’ T N E E D I T, D O N ’ T LOA D I T.
  • 17. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
  • 18. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 WA I T T I L L L AT E R
  • 19. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 T H E B A R E N E C E S S I T I E S ( T H E I N I T I A L R E N D E R I N G )
  • 20. “It’s great to be on the Cutting Edge, but it’s never ok to be on the Bleeding Edge of the Cutting Edge.”
  • 21. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 LOA D C R P S T Y L E S I N L I N E , I N T H E H E A D E R , A N D A L L E L S E I N T H E F O OT E R
  • 22. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 G R U N T- C R I T I C A LC S S criticalcss: { home: { options: { url: 'http://localdomain.dev', width: 1200, height: 900, outputfile: ‘path/to/critical-home.css', filename: 'path/to/style.css', buffer: 800*1024, ignoreConsole: true } } }
  • 23. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 G R U N T- C R I T I C A LC S S article: { options: { url: 'http://localdomain.dev/article-name/', width: 1200, height: 900, outputfile: 'path/to/critical-article.css', filename: 'path/to/style.css', buffer: 800*1024, ignoreConsole: true } }
  • 24. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 G R U N T- C R I T I C A LC S S grunt.registerTask('critical', ['criticalcss']);
  • 25. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 G R U N T- C R I T I C A LC S S
  • 26. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - I N L I N E C R I T I C A L C S S <style> .header { width: 100%; background-color: black; } .nav { width: 100%; height: auto; } </style>
  • 27. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - T H E M E S T Y L E S <script> (function () { function loadCSS(href) { var ss = window.document.createElement('link'), ref = window.document.getElementsByTagName('script')[0]; ss.rel = 'stylesheet'; ss.href = href; ss.media = 'only x'; ref.parentNode.insertBefore(ss, ref); setTimeout(function () { ss.media = 'all'; }, 0); } loadCSS('<?php echo esc_url( 'styles.css' ); ?>'); })(); </script> <noscript> <link rel="stylesheet" href="<?php echo esc_url( 'styles.css' ); ?>"> </noscript>
  • 28. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - E N Q U E U E I N G J S function theme_scripts_styles() { wp_enqueue_script( ‘theme-scripts', get_template_directory_uri() . ‘/assets/js/scripts.js’, array(), ‘1.0’, true ); } add_action( 'wp_enqueue_scripts', ‘theme_scripts_styles' );
  • 29. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - ASY N C J S W I T H S C R I P T LOA D E R TAG function async_theme_script( $tag, $handle, $src ) { if ( 'theme-scripts' !== $handle ) : return $tag; endif; return str_replace( '<script', '<script async', $tag ); } add_filter( 'script_loader_tag', array( __CLASS__, 'async_theme_script' ), 10, 3 );
  • 30. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 TO O L S TO M E AS U R E F R O N T E N D P E R F O R M A N C E
  • 31. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 B R OW S E R D E V TO O L S
  • 32. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 T E S T O N A L L T H E T H I N G S
  • 33. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 X I P. I O • Domain name that provides wildcard DNS for any IP Address. • Example: yourdomain.192.168.1.100.xip.io
  • 34. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - X I P. I O server_name local.dev *.local.dev ~^local.d+.d+.d+.d+.xip.io$;
  • 35. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 B R OW S E R SY N C • Keep multiple browsers & devices in sync when building websites. • http://www.browsersync.io/
  • 36. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - B R OW S E R SY N C browserSync: { dev: { bsFiles: { src : 'path/to/styles.css' }, options: { watchTask: true, proxy: 'yourdomain.dev' } } }
  • 37. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 E X A M P L E - B R OW S E R SY N C grunt.registerTask('local', ['default', 'browserSync', 'watch']);
  • 38. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 O N L I N E TO O L S
  • 39. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 O N L I N E TO O L S • Google Page Speed Insights - • WebPageTest.org • SiteSpeed.io
  • 40. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015 Q U E S T I O N S ?
  • 41. Allen Moore • @creativeallen • #wcavl • allenmoore.me/wcavl-2015