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

fix(ripple): Adds HTMLElement shim to fix regression for SSR projects #592

Merged

Conversation

4cm4k1
Copy link
Contributor

@4cm4k1 4cm4k1 commented Jan 4, 2019

This PR fixes #581.

I did not write any tests, as writing tests for SSR use cases is under consideration at #588.

The compiled result of the changed code is as follows, which should fix the regression seen in SSR projects:

var HTMLElementShim = typeof HTMLElement === 'undefined' ? { } : HTMLElement;
var MATCHES = mdc_ripple_1.util.getMatchesProperty(HTMLElementShim.prototype);

I’m relatively new to writing TypeScript, so please let me know if any as a type should be changed.

Warm regards,
Anthony

@codecov-io
Copy link

codecov-io commented Jan 4, 2019

Codecov Report

Merging #592 into rc0.9.0 will decrease coverage by 0.03%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           rc0.9.0     #592      +/-   ##
===========================================
- Coverage    94.49%   94.45%   -0.04%     
===========================================
  Files           61       61              
  Lines         2560     2561       +1     
  Branches       371      372       +1     
===========================================
  Hits          2419     2419              
  Misses          50       50              
- Partials        91       92       +1
Impacted Files Coverage Δ
packages/ripple/index.tsx 87.82% <50%> (-0.78%) ⬇️

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 6e304a6...db16997. Read the comment docs.

packages/ripple/index.tsx Outdated Show resolved Hide resolved
@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

This looks like it fixed it, but I left one comment. I tested by using the repo linked in this issue #492. I actually found another similar issue using Drawer while testing.

ReferenceError: Element is not defined
    at Object.105 (/usr/local/google/home/mattgoo/Downloads/material-next-template-master/node_modules/@material/drawer/dist/mdc.drawer.js:809:15)
    at __webpack_require__ (/usr/local/google/home/mattgoo/Downloads/material-next-template-master/node_modules/@material/drawer/dist/mdc.drawer.js:35:30)

I will open a separate issue.

@moog16 moog16 changed the base branch from master to rc0.9.0 January 4, 2019 19:05
@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

@4cm4k1 could you please sign the pr

@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

tests passing: #595

@4cm4k1
Copy link
Contributor Author

4cm4k1 commented Jan 4, 2019

I signed it.

@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

Thanks! merging :)

@moog16 moog16 merged commit c7b64d4 into material-components:rc0.9.0 Jan 4, 2019
@4cm4k1 4cm4k1 deleted the fix/ripple/ssr-regression branch January 4, 2019 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants