* added new function inside parse js actions for view moe * fixing test cases * added evaluateSync with isTriggered false * Add types Add switch case for diff.event Add function get back app mode * Change foreach loops to for of * Dont return jsUpdates from view mode save resolved since no operation is happening Change viewModeSaveResolvedFunctionsAndJSUpdates -> viewModeSaveResolvedFunctions to reflect what it's functionality is * Refactor JSObject code * Refactor code for JSobject * remove any * export parsed object's type from ast * create function for deleteResolvedFunctionsAndCurrentJSCollectionState * Code review changes * Fix tests * Change returns in for of loops to continue Remove try for evaluate sync Js updates return * Fix bug * Fix bug Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: Aishwarya UR <aishwarya@appsmith.com> |
||
|---|---|---|
| .. | ||
| ast | ||
| .gitignore | ||
| build-shared-dep.js | ||
| install-dependencies.js | ||
| package.json | ||
| Readme.md | ||
| run-tests.js | ||
| shared-dependencies.json | ||
| verify-shared-dep.js | ||
Shared Dependencies
We wanted to share common logic with different applications within our repo, so we picked yarn symlinks as our approach to tackle this problem. Following are the way in which you can take advantage of the module sharing architecture.
Creation of a Shared Module
- Create a directory inside
shareddirectory with name eg.abc - Inside
package.jsonof module, keep the name like@shared/abc - Add a rollup config to generate
package.jsonafter the module is build
Installation of Shared Modules
- Add an entry for an application inside
shared-dependencies.jsoneg. forclientthere should be an entry"client": [] - Add the name of the shared module in the entry of the application in the above file eg.
"client": ["@shared/abc"] - If the application does not have any postinstall or preinstall scripts for shared modules then add the two commands described below in the application's (eg.
client)package.json:"postinstall": "CURRENT_SCOPE=client node ../shared/install-dependencies.js""preinstall": "CURRENT_SCOPE=client node ../shared/build-shared-dep.js"CURRENT_SCOPE is the environment variable that's being used in the scripts
Verifying the Installed Shared Modules
- Run
yarn run verifyinsideshareddirectory to verify shared dependencies for an application.
Command link-package
yarn install: installs packagesrollup -c: Module bundler bundles the package and creates a buildcd build: Change the present working directorycp -R ../node_modules ./node_modules: copies its own node_modules directory to its build directory to make sure its own version dependencies do not mismatch when its installed in other directories as shared moduleyarn link: Creates a link for the package to make it available for other directories to use.