Need Liferay 7.1+ and the com.liferay.frontend.js.portlet.extender module
- Navigate to portlet
- Install:
npm install - Set
liferayDirin .npmbuildrc - Set
contentSpaceIdin liferay-config - Deploy:
npm run deploy
- Navigate to standalone
- Install:
npm install - Create OAuth2 application in Portal. Portal OAuth2 Setup
- Set
clientId(from OAuth app) andcontentSpaceIdin liferay-config - Start:
npm run start
- Have to disable SPA module (Liferay Frontend JS SPA Web)
- Had to use hash routing because browser history routing breaks after page reload.
- It'd be great if there was some sort of manifest that the module could provide that would determine which routes portal should ignore.
- Unable to use custom webpack loaders or custom build process
- Unable to use dynamic imports and code splitting
- Requires some internal knowledge of
liferay-npm-build-supportandliferay-npm-bundler
- No CORS support means we need a proxy server (Might be fixed by JIRA: OAUTH2-207)
- Authentication for images required ajax requests. See AsyncImage Component
- There might be another way around this.
/o/apiwas great for GET requests and reading resources but wasn't fully baked out enough for POSTing and PUTing./o/apiwas easy to discover by navigating through the urls/api/jsonwsfilled in for the gaps that/o/apiwas missing- Adding a file via
Liferay.Servicedidn't work, which means I had to create a separate axios request. See Upload Page - There were a lot of required parameters that I didn't find helpful when using
/api/jsonws. - I couldn't get create-react-app working in the portlet context.I tried adding the proper packages to the package.json so that it deployed as a portlet but the build version of CRA seemed inconsistant with what liferay and the bundler wanted.