Skip to content

Commit 3161762

Browse files
authoredFeb 3, 2020
Merge pull request #24 from htulipe/js-lib-versions
Support React v16 and fetch v3
2 parents ab18c41 + 600ef65 commit 3161762

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎Resources/views/GraphiQL/index.html.twig

+12-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@
1313
</style>
1414
<link href="https://unpkg.com/graphiql@{{ versions.graphiql }}/graphiql.css" rel="stylesheet">
1515
{% endblock style %}
16-
<script src="https://unpkg.com/whatwg-fetch@{{ versions.fetch }}/fetch.js"></script>
17-
<script src="https://unpkg.com/react@{{ versions.react }}/dist/react.min.js"></script>
18-
<script src="https://unpkg.com/react-dom@{{ versions.react }}/dist/react-dom.min.js"></script>
16+
{% if versions.fetch matches '/^[~^]?2/' %}
17+
<script src="https://unpkg.com/whatwg-fetch@{{ versions.fetch }}/fetch.js"></script>
18+
{% else %}
19+
<script src="https://unpkg.com/whatwg-fetch@{{ versions.fetch }}/dist/fetch.umd.js"></script>
20+
{% endif %}
21+
{% if versions.react matches '/^[~^]?15/' %}
22+
<script src="https://unpkg.com/react@{{ versions.react }}/dist/react.min.js"></script>
23+
<script src="https://unpkg.com/react-dom@{{ versions.react }}/dist/react-dom.min.js"></script>
24+
{% else %}
25+
<script src="https://unpkg.com/react@{{ versions.react }}/umd/react.production.min.js"></script>
26+
<script src="https://unpkg.com/react-dom@{{ versions.react }}/umd/react-dom.production.min.js"></script>
27+
{% endif %}
1928
<script src="https://unpkg.com/graphiql@{{ versions.graphiql }}/graphiql.min.js"></script>
2029
<title>{% block title %}GraphiQL{% endblock title %}</title>
2130
{% endblock head %}

0 commit comments

Comments
 (0)