-
Notifications
You must be signed in to change notification settings - Fork 0
feat(majc): Replace Freestar with MAJC #1421
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
Conversation
@justindarc could you take a look at this next iteration whenever you get a moment? I have brought in the latest
Again, not sure if I've missed something in terms of how to integrate this properly, or if there is an underlying bug in the sdk |
@mashalifshin what version of "react" and "react-dom" is Pocket using? |
Looks like |
92f7e9b
to
34bbc36
Compare
@justindarc I integrated the latest In the server-side logs: ![]() Take a look and lmk if anything obvious jumps out at you, and/or if you'd like to 🍐 again on this like last time |
@mashalifshin I think I see why this is happening. Can you try the code in my PR branch? https://github.com/mozilla-services/ads-sdk/pull/24 |
@justindarc @luc-lisi I pulled the latest (I do see some potential bugs/warnings/things we might want to to tune, I'll update this PR description with the deets) |
6c1fd1a
to
ab09a03
Compare
Yep! These are static pages, and then we do some injection of things on the client (like user, isPremium, etc.) that let's us show/hide ads etc. Couple of options:
I will play around with it a bit and see what looks nicest.
I think we just need to set up some hooks for this to work. We do have that viewport provider ... but full transparency, I dislike it and have wanted to remove it multiple times, I think there is a better way to manage it. I can fiddle with that as well.
So we generally rely on snapshot testing for smoke tests on rendered pages... and even more so in the realm of third party integrations (since the assumption is testing is the domain of the library). For this we would really just test that things don't fall to pieces when the lib fails and make sure we have graceful fallbacks. Testing has a long sordid history with Pocket that has been a tale of woe for me that I am happy to share if you are ever interested. |
I took a quick look at the snapshots and it seems like we snapshot test at the level of components here? So I saw that
I would like to subscribe to Testing Tales of Woe with Joel, lol. Want to 🍐 ? Or can subscribe in Slack of course |
48f2977
to
21dc191
Compare
21dc191
to
f0ccbff
Compare
bdcb9a1
to
84d1aab
Compare
84d1aab
to
ea4207a
Compare
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.
lgtm
🎉 This PR is included in version 1.160.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Goals
Integrate the MAJC into Pocket.
To Do:
To Done:
node_modules
until we can vend via npmdist
in the import paths and that resolved this issue for this build (though we'll want to check this again with a proper vend vianpm install
instead of manually adding the dep)Unhandled Runtime Error TypeError: null is not an object (evaluating 'resolveDispatcher().useState')
. This is fixed now, was due to a bundling bug where client-fetch was being required instead of being bundled.main
ate48e23f
.ReferenceError: navigator is not defined
. I think this has to do with the new logger code, and perhaps server side rendering when it shouldn't be?Justin, Luc, and I took a closer look and we think this is the reflow happening based on the
allowAds
decision which decides whether to show the component or not based on if the user has premium. Looking closely, seems like we have improved on the Freestar behavior as much as we can on our end (when the component loads, it keeps the space it needs without jumping around), so if we want to go further we could perhaps refactor some surrounding Pocket code? Will be curious to see what Joel thinks.Showing a medium rectangle ad format above and below the fold for mobile. I took a crack at it, but it doesn't request different placements when I use browser tools to emulate mobile viewports. Should I be pulling in the
useWindowDimensions
hook for this?[ ] Seeing a warning when I first start the dev server:. We poked around enough to realize the warning is coming from somewhere in Pocket, so considering this out of scope for the PR.Received
truefor a non-boolean attribute
crossOrigin. If you want to write it to the DOM, pass a string instead: crossOrigin="true" or crossOrigin={value.toString()}`Nit: @luc-lisi the
IntersectionObserver not found in the global namespace; Impressions may not be observed or this message is being shown server-side.
doesn't seem necessary to show in the server-side dev logs since that's expected in that env. Can we do a check and not show it if we're server side?Before you Submit
We have some formatting rules in place to keep things consistent and clean:
type(context): message
type/work-being-done
Valid types are: