Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

feat: Use intersection-observer polyfill to support IntersectionObserver#222

Merged
sagirk merged 6 commits into
nodejs:masterfrom
BeniCheni:intersection-observer-polyfill
Apr 15, 2019
Merged

feat: Use intersection-observer polyfill to support IntersectionObserver#222
sagirk merged 6 commits into
nodejs:masterfrom
BeniCheni:intersection-observer-polyfill

Conversation

@BeniCheni

Copy link
Copy Markdown
Contributor

Description

After researching polyfill for IntersectionObserver, trying out the intersection-observer polyfill from w3c in this PR.

Navigation Title color looks okay in local testing with the XCode iOS Simulator (usually pretty native to real iPhone). Looking forward to review & testing more in staging.

Related Issues

Fixes #207

observer-polyfill

@sagirk

sagirk commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

/gcbrun

Eventual staging example will be on https://storage.googleapis.com/staging.nodejs.dev/7344727/index.html

Comment thread src/templates/learn.tsx Outdated
@codecov-io

codecov-io commented Apr 6, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@d1208ff). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #222   +/-   ##
=========================================
  Coverage          ?   38.81%           
=========================================
  Files             ?       20           
  Lines             ?      237           
  Branches          ?       56           
=========================================
  Hits              ?       92           
  Misses            ?      144           
  Partials          ?        1
Impacted Files Coverage Δ
src/components/layout.tsx 3.22% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1208ff...085f345. Read the comment docs.

@BeniCheni

Copy link
Copy Markdown
Contributor Author

nit: Can we use a dynamic import in the Layout.tsx component instead?

@sagirk, the Layout.tsx is indeed a much more appropriate place to do dynamic import of the polyfill within useEffect. Updated. PTAL? Looking forwards to testing in staging again.

Observed a TS syntax message in quote below. Tied to resolve w. npm install @types/intersection-observer, but intersection-observer type is not available. What are your thoughts? Since this is just a TS script warning, I'd vote to do a follow-up to address it.

Error:(26, 14) TS7016: Could not find a declaration file for module 'intersection-observer'. '/nodejs.dev/node_modules/intersection-observer/intersection-observer.js' implicitly has an 'any' type.
  Try `npm install @types/intersection-observer` if it exists or add a new declaration (.d.ts) file containing `declare module 'intersection-observer';`

P.S.: Can I try /gcbrun too? Not sure how the access stuff works.

@sagirk

sagirk commented Apr 8, 2019

Copy link
Copy Markdown
Contributor

/gcbrun

Eventual staging example will be on https://storage.googleapis.com/staging.nodejs.dev/085f345/index.html

@BeniCheni

Copy link
Copy Markdown
Contributor Author

@sagirk et al, friendly FYI that I’ve tested the staging on iPhone and confirmed the nav menu title color is transitioning correctly on my test.

@BeniCheni

Copy link
Copy Markdown
Contributor Author

Ping / @sagirk

@sagirk sagirk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey Ben, sorry for going AWOL in the past few days. 🙈

LGTM! 🎉

Observed a TS syntax message in quote below. Tied to resolve w. npm install @types/intersection-observer, but intersection-observer type is not available. What are your thoughts? Since this is just a TS script warning, I'd vote to do a follow-up to address it.

+1 to follow-up later when types become available.

Can I try /gcbrun too? Not sure how the access stuff works.

I wasn't not too sure, either. But considering that your comment did not trigger a build, I think you need to be a collaborator to do so.

Comment thread src/components/layout.tsx
@sagirk sagirk merged commit 465287f into nodejs:master Apr 15, 2019
@BeniCheni BeniCheni deleted the intersection-observer-polyfill branch April 15, 2019 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation title color bug on iOS Safari (Phone Only, no Emulator)

4 participants