forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Snyk] Upgrade react-relay from 0.0.0-experimental-8cc94ddc to 0.10.0 #283
Open
snyk-bot
wants to merge
1
commit into
canary
Choose a base branch
from
snyk-upgrade-cecbfd5e5a2d45753ba3eb2aadc26e26
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snyk has created this PR to upgrade react-relay from 0.0.0-experimental-8cc94ddc to 0.10.0. See this package in npm: https://www.npmjs.com/package/react-relay See this project in Snyk: https://app.snyk.io/org/nexuscompute/project/cbc133c2-5c0e-4dc2-a979-5dced39b8254?utm_source=github&utm_medium=referral&page=upgrade-pr
This was referenced Sep 23, 2022
This was referenced Oct 11, 2022
This was referenced Oct 11, 2022
This was referenced Oct 12, 2022
This was referenced Nov 10, 2022
This was referenced Dec 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade react-relay from 0.0.0-experimental-8cc94ddc to 0.10.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: react-relay
babel-relay-plugin
to usegraphql@0.8.2
, which supports the latest revision of the GraphQL specification.RelayGraphQLMutation
to public API.rollback
method toRelayGraphQLMutation
.BabelPluginGraphQL
).graphiqlPrinter
argument to theRelayNetworkDebug
constructor that can be used to print a link to view the request in GraphiQL.setVariables
, specifically when using array/object variables (closes #1357).Relay.disableQueryCaching
API (closes #754), which may be useful running Relay in a server context.IGNORE
as arangeBehavior
(closes #1337).RelayQuery.cloneWithRoute
(see commit de954992), making logging and analytics that relies on query names more accurate.RelayNetworkDebug
now prints an estimated request size (see commit b94ba409).callsToGraphQL
/callsFromGraphQL
, fixing issues withnull
(closes #1256).injectCacheManager
onRelayEnvironment
(closes #1320).Relay.QueryConfig
(closes #1279).GraphQLRange
get correctly deserialized (closes #1293).errors
attributes and non-200 responses (#1163).client:
ID, necessitating the use of a path when a refetchable ID would be preferable in order to produce a correct result (commit 928411df).useFakeData
that you can use to silence the warning when using aRelayContainer
with fake data.Relay.QL
string. See #896RelayStoreData#toJSON
.this.props.relay.pendingVariables
which can be used to access variables from in-flight queries (to e.g. display a component-specific loading spinner).npm run update-schema
inside the Relay repo works again.GraphQLQueryRunner
(only relevant to users of the non-public cache manager API).rangeBehaviors
function to allow non-string calls.subtractRelayQuery
is removed.Subscription
nodes.RelayNetworkDebug
is won't do anything unlessconsole.groupCollapsed
is available, because otherwise the output is too noisy to be useful.RelayContainer
now uses more descriptive names for stateless functional components, instead ofRelay(props => ReactElement)
.graphql-js
0.6.0. Developers interestedin upgrading to
graphql-js
0.6.0 might have to make some changes to theirexisting GraphQL schemas. Read the migration guide for more information:
https://gist.github.com/steveluscher/ffc1dfefbb10ad280c8a4c520a5c201c
the console when
DEV
is true, andconsole.groupCollapsed
andconsole.groupEnd
are available.this.props.relay
prop passed into components byRelay.Container
nowexposes
applyUpdate
andcommitUpdate
methods for dispatching mutationsin the context of the current
Relay.Environment
.RANGE_DELETE
mutations can now remove multiple nodes from a connection,because
deletedIDFieldName
can now point to a plural field.rangeBehaviors
as a function that receives the connectionarguments and returns one of
GraphQLMutatorConstants.RANGE_OPERATIONS
.RelayNetworkDebug#init
now lets you pass in aRelayEnvironment
againstwhich you would like to debug. This does not yet allow you to debug more than
one environment at a time, but at least you can make the choice of which one.
RelayReadyState
now contains anevents
array; a stream of events that canbe accessed from a
RelayReadyStateCallback
. You can reduce over this list ofevents to implement any kind of custom rendering logic you like.
this.props.variables
now reflects the variables after being processed withprepareVariables
. The fact that variables were the un-prepared values wasa source of confusion for many.
prepareVariables
could be called twice, breakingcomponents with non-idempotent
prepareVariables
functions.setVariables
, orproduce one through
prepareVariables
, that you have not declared ininitialVariables
upfront.stale
prop of areadyState
to change even ifthere was previously an
error
present.at column 0.
shouldComponentUpdate: () => boolean
function. If specified, this functionalways overrides the default implementation (ie. there is no fall-through to
the default).
RelayNetworkDebug
now logs query variables.RelayNetworkDebug
is now added as a subscriber instead of replacing anyexisting network layers. It also no longer replaces the global
fetch
.Relay.Environment#injectNetworkLayer
(and, by extensionRelay#injectNetworkLayer
) will now warn if injecting would overwrite apreviously injected layer.
RelayGraphQLMutation
API (still beingfinalized and not yet documented, so use at your own risk).
The following APIs are early versions and are as of yet undocumented so please
use them with caution.
Relay.Environment
.Relay.Store
is now simply a global instance ofRelayEnvironment
. To create your own isolated store and network subsystem,create a
new RelayEnvironment()
and make use of it whereverenvironment
is required.
Relay.Environment#injectNetworkLayer
to inject a custom network layerfor use within the context of a particular
Relay.Environment
instance.Relay.ReadyStateRenderer
. This component takes in an instance ofRelay.Environment
, aqueryConfig
that conforms to theRelayQueryConfigInterface
, and a Relaycontainer
. It renderssynchronously based on the supplied
readyState
. This primitive enables youto create alternatives to
Relay.Renderer
that fetch and handle data in acustom way (eg. for server rendered applications).
Relay.Renderer
– a replacement forRelay.RootContainer
thatcomposes a
Relay.ReadyStateRenderer
and performs data fetching.Relay.RootContainer
is now a wrapper aroundRelay.Renderer
thatsubstitutes
Relay.Store
forenvironment
.RelayRendererRenderCallback
toRelayRenderCallback
.RelayQueryConfigSpec
toRelayQueryConfigInterface
.RelayContainer.setVariables
will no longer check if the variables arechanged before re-running the variables. To prevent extra work, check the
current variables before calling
setVariables
.COMMIT_QUEUED
state usingRelayMutationTransaction#rollback
.NODE_DELETE
orRANGE_DELETE
mutation config, you canomit
parentID
if your parent, in fact, does not have an ID.Relay will now write
null
into the store for that field. This allows you toreturn smaller payloads over the wire by simply omitting a key in the JSON
response, rather than to write an explicit
fieldName: null
.relay
prop does not change between renders, we now recycle the sameobject. This should enable you to make an efficient
this.props.relay === nextProps.relay
comparison inshouldComponentUpdate
.arguments (first/last/after/before) so long as the values of those arguments
are variables and not concrete values (eg.
friends(first: $first, last: $last)
will no longer cause the Relay Babel plugin to throw).Relay.Mutation
.RelayNetworkDebug
. Invokerequire('RelayNetworkDebug').init(Relay.DefaultNetworkLayer)
to enjoy simpleto read logs of your network requests and responses on the console. Substitute
your own network layer if you use one.
rangeBehaviors
:IGNORE
means the range should not be refetched at all.REFETCH
will refetch the entire connection.information about edges that have already been fetched. This can be enabled by
adding
@ relay(variables: ['variableNames'])
to a connection fragment.npm run build
now works on Windowsuri
fromRelayQueryConfigSpec
. Theuri
property was part ofRelayRoute
, but neverRelayQueryConfig
. This revision simply cleans up the Flow shape inRelayContainer
.RelayRenderer
does not run queries during synchronous server-side rendering.