Monday, May 31, 2021

Example Request For Comment

The second task for the week was to create our own example RFC.

Write the outline of an RFC for something you worked on previously at 99. Doesn’t need to be a full blown RFC, just give us the gist of it. You may find it helpful to write about a task that perhaps didn’t go as smoothly as you wished, or explore alternative implementations of something you were happy with.

I think the best way to tackle this is to create an RFC for a current ticket I'm working on as there were a couple of different approaches I could have taken. I'll again be using the framework that's set out in this RFC help document.

[RFC] Add Facebook Project Selection Page

The partners and products team is adding a new package selection page for Facebook. The page should replicate one that already exists for Square. As this is a new page a route also needs to be created. After some discussion with the team the decision was made to use the /briefs/facebook/create route but I'm open to some feedback around this.

The motivation behind this change is to display new Facebook products on our platform. Currently the page will display a Facebook Ad Campaign package as well as a generic package. Without this page there wouldn't be an easy way for customers to see all available packages and kick start briefs.

The implementation of the page itself is pretty basic as it will almost exactly take the form of the CreateSquareOnlineStore component. However, there are a couple of different options around duplication:

Option 1

  • Have two components (Facebook, Square) with duplication
  • This isn't optimal but it's the easiest way to get something into production and working as soon as possible

Option 2

  • Have one component that combines the functionality needed for both Facebook and Square
  • The same usePackagesByCategoryQuery is used to fetch the package options
  • The variation exists where props need to be passed though to the StartProjectBriefProvider that are specific to the package, there are 3 different types for Square
  • We need to find a way to dynamically pass these props for the given components

The current recommended approach is to go with Option 1 to ensure that we have the page working. The team has some upcoming kick off meetings in the next few weeks that will run through decoupling briefs and packages. My hope is that some of that work may help here.

There is some uncertainty about relying on these meetings to fix code that isn't clean however this is something we need to be strong about coming back to! It will be filed as a ticket in the backlog.