Skip to content
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

Adding GoogleMaps and Youtube embed components #52909

Merged
merged 70 commits into from
Aug 7, 2023

Conversation

janicklas-ralph
Copy link
Contributor

@janicklas-ralph janicklas-ralph commented Jul 19, 2023

Adding GoogleMapsEmbed and YoutubeEmber components into @next/third-parties
Adding tests and README
Each component is tagged with data-ntpc attribute

cc: @kara @housseindjirdeh @huozhi @gnoff

janicklas-ralph and others added 30 commits June 12, 2023 12:45
const Page = () => {
return (
<div class="container">
<h1>Youtube Embed</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h1>Youtube Embed</h1>
<h1>Google Maps Embed</h1>

const Page = () => {
return (
<div class="container">
<h1>Youtube Embed</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h1>Youtube Embed</h1>
<h1>Google Maps Embed</h1>

import { YoutubeEmbed } from '@next/third-parties/google'

export default function Page() {
return <YoutubeEmbed videoid="ogfYd705cRs" height={400} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicklas-ralph Are we planning on changing this in this PR or a follow-up?

<ThirdPartyScriptEmbed
height={args.height || null}
width={args.width || null}
content={`<iframe loading="lazy" src="https://www.google.com/maps/embed/v1/${args.mapMode}?key=${args.apiKey}&${args.parameters}" width=${args.width} height=${args.height} style=${args.style} loading=${args.loading} allowfullscreen=${args.allowfullscreen} referrerpolicy="no-referrer-when-downgrade"></iframe>`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are duplicate loading attributes defined in the HTML here - one is "lazy" and one comes from "args.loading". I imagine we should combine the logic into one attribute so we fallback to the "lazy" if there isn't an override value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicklas-ralph Yeah this shouldn't be an issue anymore once you've upgraded to 1.0.19. I've separated out all the attributes instead of having everything in one single content property which should make adding overrides easier.

Copy link
Collaborator

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We'll have to modify some of this logic a bit to support the new Third Party Capital schema in v1.0.19 but like we discussed, we can do that in a follow-up PR :)

<ThirdPartyScriptEmbed
height={args.height || null}
width={args.width || null}
content={`<iframe loading="lazy" src="https://www.google.com/maps/embed/v1/${args.mapMode}?key=${args.apiKey}&${args.parameters}" width=${args.width} height=${args.height} style=${args.style} loading=${args.loading} allowfullscreen=${args.allowfullscreen} referrerpolicy="no-referrer-when-downgrade"></iframe>`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicklas-ralph Yeah this shouldn't be an issue anymore once you've upgraded to 1.0.19. I've separated out all the attributes instead of having everything in one single content property which should make adding overrides easier.

import { YoutubeEmbed } from '@next/third-parties/google'

export default function Page() {
return <YoutubeEmbed videoid="ogfYd705cRs" height={400} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we downgraded back to 1.0.17 in this PR. I think the plan is to do this in a follow-up PR once upgrading to the latest version.

@janicklas-ralph janicklas-ralph requested a review from kara August 2, 2023 20:10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems not being used and can be deleted?

@@ -0,0 +1,32 @@
import { createNextDescribe } from 'e2e-utils'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change this test file to typescript like others to avoid potential mistakes in test files

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also skip the next config file as it's using the default config

Copy link
Member

@huozhi huozhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@kodiakhq kodiakhq bot merged commit 033732a into vercel:canary Aug 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants