Webflow Site Configuration
Sygnal DevProxy works by swapping out <script>
and <link>
source references at the reverse-proxy level.
Code Constructions ( CCs )
We specify the setup we want using code constructions ( CCs ).
Here is a typical CSS link and script reference that you might have in your Webflow site. It happens to be for Sygnal's new SA5 Modals feature.
When we want to support DEV, TEST and PROD mode distinctions here, we adjust these to code constructions that look like this;
Note the differences;
There are now additional attributes named
dev-src
anddev-href
.And attributes named
test-src
andtest-href
.
The line breaks and indents shown here are not necessary, but they make the CC easier to read and adjust.
How DevProxy Works
Generally speaking, DevProxy is setup to be in one of three modes;
DEV mode, in which source code is running on the developer's local machine or development server.
TEST mode, in which source code is running from a test server.
PROD mode, in which source code is running as usual from the production environment.
When DevProxy is in DEV mode;
It will look for
<link>
elements that have adev-href
attribute. When found, it will overwrite thehref
attribute with the value from thedev-href
one.It will look for
<script>
elements that have adev-src
attribute. When found, it will overwrite thesrc
attribute with the value from thedev-src
one.
The same process occurs when DevProxy is in TEST mode, but using the test-
prefixed attriutes.
In PROD mode, DevProxy does nothing, and leaves the attributes untouched.
We typically use dev-
and test-
, but in fact DevProxy can have any number of different modes you want, if you have a use case for it.
DevProxy Groups
CC's can also be grouped into control sets, using another attribute, dpx-group
.
Early incarnations of DevProxy had a global on/off state, but we found that wasn't practical for more complex sites. In some cases we might need some CC's to be in a PROD state while others are in DEV and still others in TEST.
A common example is when we are using both SSE and Sygnal Attributes 5 ( SA5 ) together in the same site, both with DevProxy CC's. In those cases, a global switch didn't work.
This is the purpose of groups.
When a CC contains the dpx-group
attribute, DevProxy adds the ability to set the DevProxy state at the group level.
Let's suppose your page has various DevProxy CC's on it, some which have group group1
, some which have group2
and some which lack the dpx-group
attribute and therefore have no group.
DevProxy configuration will recognize 3 different settings, for a total of 9 possible configurations.
group1
elements can be in DEV, TEST, or PROD mode.group2
elements can be in DEV, TEST, or PROD mode.All other elements can be in DEV, TEST, or PROD mode.
This makes it easy to isolate your development and testing to different parts of your infrastructure.
Here a real-world example where we use this;
These CC's have a group of sa5
.
While this one has a group of sse
.
In this way, we can develop just one part in isolation, or both concurrently.
Last updated