-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Triptych app changes #2038
Conversation
Coverage of commit
|
Coverage of commit
|
@@ -25,7 +25,10 @@ export const formatTimeString = (timeString: string) => | |||
moment(timeString).tz("America/New_York").format("h:mm"); | |||
|
|||
export const imagePath = (fileName: string): string => | |||
isOFM() ? `images/${fileName}` : `/images/${fileName}`; | |||
isOFM() ? outfrontImagePath(fileName) : `/images/${fileName}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're still using imagePath
for OFMs in addition to import
ing images into components, in which scenarios do we use which one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import
should only have to be done once in outfront_evergreen_content.tsx
. It gives webpack the ability to preload the images and save them to the correct folder. Because this folder only exists in the packaged app, we only need to reference that path on live triptychs. Eventually, DUPs should be treated similarly, but I wanted to leave them alone for now.
Coverage of commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentative thumbs-up, let's see if it works on the real thing!
Oh, it looks like this has some conflicts, since unfortunately it branched off before my linting changes 😓 Sorry for the extra work! |
Coverage of commit
|
ah... "WIP" commit on main 😅 |
Dangit. I even looked right at those letters and thought "Yeah looks good"... |
Asana task: [Timebox] Investigate babel config to possibly transpile from react to plain JS
Working on some webpack changes for getting the packaged triptych app compiled down to something the hardware can handle. Will update PR as OFM gives app feedback.App has been running well on OFM lab screens so this may be the best we can do at the moment. Some key changes:
A new webpack entry has been created for Triptych packaging. This eliminates the need to change webpack when we are packaging up the app. The babel config for the new entry targets the oldest browsers possible (this is done by default when no targets are provided).
All images in Triptych widgets are imported by default so that webpack preloads them in specific folders. We then only zip those folders up in the OFM package. This helps keep package size down.
Any changes made to the existing webpack entry are there to allow backwards compatibility. This should only be a
file-loader
config for images. I found that if one entry configuredfile-loader
for images, others needed to as well. Regardless, it seemed like a good idea to explicitly configure them.Tests added?