Skip to content

Commit

Permalink
chore: added validations to render scripts only in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarcosp committed Jul 11, 2022
1 parent a66f0da commit aac4163
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
15 changes: 8 additions & 7 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
const lightCodeTheme = require("prism-react-renderer/themes/nightOwl");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const productionScripts = [
{
src: "https://scripts.simpleanalyticscdn.com/latest.js",
defer: true,
async: true,
},
];

module.exports = {
title: "ReForm",
Expand All @@ -11,13 +18,7 @@ module.exports = {
favicon: "img/favicon.ico",
organizationName: "@rescriptbr",
projectName: "reform",
scripts: [
{
src: "https://scripts.simpleanalyticscdn.com/latest.js",
defer: true,
async: true,
},
],
scripts: process.env.NODE_ENV === "production" ? productionScripts : [],
themeConfig: {
colorMode: {
defaultMode: "light",
Expand Down
26 changes: 20 additions & 6 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ export default function Home() {
description="Reasonably making forms sound good"
>
<main>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>
{process.env.NODE_ENV === "production" && (
<noscript>
<img
src="https://queue.simpleanalyticscdn.com/noscript.gif"
alt=""
referrerpolicy="no-referrer-when-downgrade"
/>
</noscript>
)}
<div className={clsx(styles["main-wrapper"])}>
<div className={clsx(styles.hero)}>
<h1 className={styles["hero-title"]}>Powerful and type-safe</h1>
<p className={styles["hero-text"]}>
Reasonably making forms with <span>ReScript</span> and{" "}
React sound good
Reasonably making forms with <span>ReScript</span> and React sound
good
</p>
<div>
<Link
Expand All @@ -38,7 +46,9 @@ export default function Home() {
<div className={clsx("row", styles.highlights)}>
<section className="col margin-bottom--xl">
<img src="/img/focus.svg" />
<h2 className={styles["highlight-title"]}>Focused in ReScript</h2>
<h2 className={styles["highlight-title"]}>
Focused in ReScript
</h2>
<p className=" padding-horiz--md">
We created ReForm to be both deadly simple and to make forms
sound good leveraging ReScript's powerful typesytem. Even the
Expand All @@ -48,7 +58,9 @@ export default function Home() {
</section>
<section className="col margin-bottom--xl">
<img src="/img/powerful.svg" />
<h2 className={styles["highlight-title"]}>Powerful and type-safe</h2>
<h2 className={styles["highlight-title"]}>
Powerful and type-safe
</h2>
<p className=" padding-horiz--md">
ReForm is a powerful, type-safe and fully-featured form
library that includes hooks api, schema api, context provider,
Expand All @@ -57,7 +69,9 @@ export default function Home() {
</section>
<section className="col margin-bottom--xl">
<img src="/img/activity.svg" />
<h2 className={styles["highlight-title"]}>Actively maintained</h2>
<h2 className={styles["highlight-title"]}>
Actively maintained
</h2>
<p className=" padding-horiz--md">
ReForm is used in production projects. This incentivizes us to
regularly improving the library and to keep breaking changes
Expand Down

0 comments on commit aac4163

Please sign in to comment.