Skip to content

Instantly share code, notes, and snippets.

View joaocarloscabral's full-sized avatar

João Carlos Cabral joaocarloscabral

View GitHub Profile
@joaocarloscabral
joaocarloscabral / gatsby-ssr.js
Created March 29, 2021 13:20
gatsby-ssr.js removing all javascript files
let pageScripts;
/*
* The "scripts" variable is not documented by Gatsby, https://www.gatsbyjs.org/docs/ssr-apis/#onRenderBody, and that is probably for a good
* reason. The variable contains the scripts the Gatsby internals, https://github.com/gatsbyjs/gatsby/blob/d9cf5a21403c474846ebdf7a0508902b9b8a2ea9/packages/gatsby/cache-dir/static-entry.js#L270-L283,
* puts into the head and post body. We will be relying on this undocumented variable until it does not work anymore as the alternative is
* to read the webpack.stats.json file and parse it ourselves.
*/
export function onRenderBody({ scripts }) {
if (process.env.NODE_ENV !== 'production') { // During a gatsby development build (gatsby develop) we do nothing.
return;
@joaocarloscabral
joaocarloscabral / tripfaces.example.xhtml
Last active August 29, 2015 14:17
tripfaces xhtml example
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:trip="http://tripfaces.org/components"
template="../templates/template.xhtml">
...
<trip:tour widgetVar="trip" >
@joaocarloscabral
joaocarloscabral / tripfaces.pom.xml
Last active August 29, 2015 14:17
tripfaces' pom.xml
<dependencies>
...
<dependency>
<groupId>org.tripfaces</groupId>
<artifactId>components</artifactId>
<version>1.0.0</version>
<type>war</type>
</dependency>
</dependencies>