Note: This is a cumulative upgrade notes file, that provides detailed instructions on how to migrate your previously generated Falcon-based project to a newer version.
Make sure you remove your
node_modules
folders from bothclient
andserver
apps to ensure a proper installation of NPM packages before any upgrade between Falcon versions.
There are 2 ways of upgrading - first one is simpler and updates only dependencies, second updates also your application with new features we added to our example app.
Update versions of packages in both client/package.json
and server/package.json
so all packages from @deity
scope match the newest versions - that way you get the newest changes in the libraries but you don't alter your existing application code. To do so you have to:
- update both files mentioned above (
client/package.json
,server/package.json
) - you can check the newest version in our repository - client/package.json, server/package.json - remove
client/yarn.lock
andserver/yarn.lock
- remove
client/node_modules
andserver/node_modules
- run
yarn install
inclient
andserver
folders
That's a bit more complex but it adds new features to your application that we added to our example. Keep in mind that it's not always possible to do so, i.e. if you have changed a lot of things in the code generated via create-falcon-app.
To apply such update you instead of 1st step from the list above you have to:
- download the patch for the specific update (links for all updates are placed below)
- apply that patch in the root directory of your application by executing the following command:
git apply falcon-update-xxxxxx.patch
where xxxxxx
should be changed to a proper name of the patch.
- solve potential conflicts between your changes and our new code
Next, follow steps 2, 3 and 4 to install required dependencies.
Full patch for this update can be found here.
If you don't want to include all the changes from this release but you want to keep Falcon Server and Falcon Client at the latest version then please follow the guide below to adjust your application.
In your falcon-client project - check apolloClient.httpLink.uri
and graphqlUrl
(your project may not have this key) config values
(in config/default.json
file). If apolloClient.httpLink.uri
uses a full GraphQL URL and you would like to enable proxying for
GraphQL server - make the following changes to your config file:
{
+ "graphqlUrl": "http://localhost:4000/graphql",
"apolloClient": {
"httpLink": {
- "uri": "http://localhost:4000/graphql"
+ "uri": "/graphql"
}
}
}
If you wish to use your generated application without GraphQL proxy:
{
+ "graphqlUrl": false,
"apolloClient": {
"httpLink": {
"uri": "http://localhost:4000/graphql"
}
}
}
client/bootstrap.js
now must return an async callback that initiates the bootstrap
config:
const config = require('config');
- export default {
+ export default async () => ({
config: { ...config }
- };
+ });
To enable endpoints proxy (for handling Payment callbacks) - you need to modify your
client/bootstrap.js
file to fetch a list of endpoints from Falcon-Server and
enable them for Falcon-Client:
const config = require('config');
const { fetchRemoteConfig, configureProxy } = require('@deity/falcon-client/src/bootstrap/configureServer');
export default async () => {
const redirects = {
payment: {
success: '/checkout/confirmation',
failure: '/checkout/failure',
cancel: '/cart'
}
};
const serverUrl = config.graphqlUrl || config.apolloClient.httpLink.uri;
const serverConfig = await fetchRemoteConfig(serverUrl);
return {
config: { ...config },
onRouterCreated: async router => configureProxy(router, serverUrl, serverConfig.endpoints, redirects)
};
};
Patch for this update can be found here.
Patch for this update can be found here.
Patch for this update can be found here.
- Change your
apis
andextensions
config keys to the following structure:
{
...,
- "apis": [
- {
- "name": "api-wordpress",
+ "apis": {
+ "api-wordpress": {
"package": "@deity/falcon-wordpress-api",
"config": {
"host": "wordpress.deity.io",
"protocol": "https",
"apiPrefix": "/wp-json",
"apiSuffix": "/wp/v2"
}
},
},
- If you were using "endpoints" within your ApiDataSource class - you have to move them to a separate config section (read more about Endpoints here)
Events
enum object has been moved to@deity/falcon-server-env
package:
- const { Events } = require('@deity/falcon-server');
+ const { Events } = require('@deity/falcon-server-env');
- Rename
client/razzle.config.js
toclient/falcon-client.build.config.js
- const { razzlePluginFalconClient } = require('@deity/falcon-client');
module.exports = {
- plugins: [
- razzlePluginFalconClient({
- i18n: {
- resourcePackages: ['@deity/falcon-i18n'],
- filter: { lng: ['en'] }
- }
- })
- ]
+ clearConsole: true,
+ useWebmanifest: true,
+ i18n: {
+ resourcePackages: ['@deity/falcon-i18n'],
+ filter: { lng: ['en'] }
+ }
};