Engineering

Our engineering is underpinned by principles that celebrate both the integrity of code and the ambition to innovate. This manifesto champions excellence, advocates for the adoption of cutting-edge technologies, and fosters an environment of continuous intellectual growth.

Onmount behaviors

When injecting JavaScript into pages, prefer to use React custom elements whenever possible. For cases when this approach may not be feasible, consider trying RSJS-style behaviors using onmount.

About RSJS

The RSJS guidelines outlines some rules on sorting your JavaScript for non-SPA applications. • Think of DOM pieces as "components," much as you would with RSCSS or React. • Think of your JavaScript as "behaviors" that you attach to components. • Label your behavior targets with data-js-* attributes.

Example

In this example, we'll attach a data-js-hint-text attribute to a DOM element in our markup.

<span class="sample-text" data-js-hint-text="This is awesome">Hover on me</span>

We can then define the behavior to be attached to this component using Onmount. Here's an example behavior that will bind a DOM event to invoke a custom 3rd-party tooltip plugin:

import onmount from 'onmount' onmount('[data-js-hint-text]', function() { const el = this const text = this.dataset.jsHintText this.addEventListener('mouseover', e => { e.preventDefault() CustomTooltip.show(el, text) }) })
Next: Design Playbook

Connect.

Mashup Garage, a premier software development team, specialises in crafting exceptional products for startups and enterprises. With expertise in React, Elixir/Phoenix, and Ruby on Rails, we deliver solutions that meet your unique needs. Our mission is to bring value backed by decades of technical expertise and global co-founding experience.

What do you need help with?

Build a project

Build a team

Consult

Speak to someone

Expect a guaranteed response from us in 1-2 business days.

United Kingdom

London

Islington, London

+44 738 777 3405

LDN

Philippines

Manila

3F Topy IV Building, 3 Economia Road, Bagumbayan, Quezon City, 1110

+63 917 3084089

MNL