SharePoint/PnP-JS-Core

A call to contextInfo is being made by each spfx webpart.

Closed this issue · 1 comments

Category

  • Enhancement

  • Bug

  • Question

Version

Please specify what version of the library you are using: [3.0.8 ]

Observed Behavior

I have 3 SPFX Webparts in a Classic Page.

I see 3 calls to /_api/contextinfo in the network traces when the page load.

image

It seems familiar to this bug #345 .

Expected / Desired Behavior / Question

Only one call if it's possible?

Each webpart in SPFX exists within its own closure, so they don't know each other exist, hence the multiple calls. The issue you reference was a previous issue where we were making the contextinfo call for every request - which isn't the behavior your are seeing.


Thank you for your interest in the sp-pnp-js library. We wanted to mention that this library is being deprecated in July, 2018 in favor of the new scoped pnpjs libraries. You should begin transitioning your existing projects when possible, or start new projects with the new libraries. Please see the transition guide for more details on migrating and be sure to let us know if you have any questions. Thanks!