r/javascript • • Jul 26 '17

React 16 beta

https://github.com/facebook/react/issues/10294
36 Upvotes

26 comments sorted by

View all comments

11

u/gajus0 Jul 26 '17

A fair warning: I did not manage to get a basic React v16 application to be index by Google. It looks like something in their code-base is breaking the Google crawler. The same issue can be replicated using old Chrome version, e.g. Chrome v24. I've sent a message about it to a member of the React team, but haven't heard back yet.

3

u/brianvaughn Jul 27 '17

Is this something specific to version 16?

If so, do you have a repro?

If so, will you add info as a comment on the issue this post links to?

2

u/gajus0 Jul 27 '17

It is specific to v16. Repro would be a simple ReactDOM.render(<div>Hello, World</div>, [..]) and then just try to render the page using Fetch as Google (see https://medium.com/@gajus/react-application-seen-as-a-blank-page-via-fetch-as-google-afb11dff8562).

As to why I have not created an issue, to quote my original message (07/12/2017):

Didn't post on social media/ public as it would cause unnecessary FUD, esp. if unconfirmed by Google

1

u/Capaj Jul 27 '17

Gajus just curious-did you include the Map/Set polyfills when you tried that?

2

u/gajus0 Jul 27 '17

I was using https://polyfill.io/v2/ when testing this, i.e. yes.

1

u/gaearon Jul 27 '17

Did you try UMD builds or did you bundle the app? Can you provide a full reproducing example please?

1

u/gajus0 Jul 28 '17

I've bundled the app using webpack. I've tried to setup a simple demo, but for some reason this build is failing entirely; some error about usage of "use strict".

https://github.com/gajus/react-webpack-babel-tutorial

Will look into it tomorrow morning.

1

u/gaearon Aug 03 '17

Can you please try again with 16.0.0-beta.3?

We fixed the use strict issue, and the crawler issue might also have been caused by it.

2

u/gajus0 Aug 04 '17

I can confirm that with 16.0.0-beta.3 I was able to render the application using both Chrome v25 and Fetch as Google.

1

u/gajus0 Aug 04 '17 edited Aug 04 '17

I've tried again updating to v16, but I am getting some really weird behaviour https://youtu.be/jsG9_gC5cy4. CC /u/brianvaughn Sorry for a video instead of a replicable test case. I can try to isolate this, but it is no small task.

Whatever is going on here, I am able to replicate it using v15.

1

u/gajus0 Sep 09 '17 edited Sep 09 '17

The issue exists afterall. I have noticed drop in traffic after updating production to React 16.0.0-rc.2. Turns out it is due to new pages not being indexed.

http://imgur.com/a/L4DTc

You can see it live here https://go2cinema.com/.

You will need to use an old browser such as Chrome v25.

That error:

Uncaught TypeError: cannot set property 'nextEffect' of undefined

Is coming from react code base.

The same issue is affecting Fetch as Google.

I am not able to replicate the same issue using "Hello, World" example. I am guessing it might be something to do with setState or context being using in the real world app.

Opened React issue: https://github.com/facebook/react/issues/10656

2

u/imguralbumbot Sep 09 '17

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/mVKpVUI.jpg

Source | Why? | Creator | ignoreme | deletthis

1

u/gaearon Sep 11 '17

Update: we figured out it's due to a bug in Polyfill.io: https://github.com/Financial-Times/polyfill-service/issues/1299