-
Notifications
You must be signed in to change notification settings - Fork 16
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
Updated Artifacts Folder Structure #1843
base: main
Are you sure you want to change the base?
Conversation
Why do we still have these internal_script and internal_widget? We've been criticizing the Firebase structure for having these collections, and now we're expanding it to new features? Shouldn't the folder structure for both Electron and the starter be something like this?
CC: @kmahmood74 @evshi |
Just a had a convo with @evshi we will be renaming these to proper structure |
Sure |
final manifestContent = | ||
await rootBundle.loadString(path + '.manifest.json'); | ||
final Map<String, dynamic> manifestMap = json.decode(manifestContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @evshi,
This function is taking a lot amount of time to load and decode. Its whole job is to extract widget/script names, which are needed to fetch the content. But, the manifest file, for apps with around 100 screens and 100 widgets, can go up to 4-5 MB in size and takes 3-5 seconds to load and decode.
Why are we storing the YAML directly in the manifest file. When we remove the content keys/values from it, it works fine. The large content data is really slowing things down.
From the Electron app, could we either:
- Remove the content keys/values from the manifest file, or
- Provide a separate file containing only the widget and scripts names, which we can use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should not include the YAML in the manifest. @anserwaseem we discussed this previously can you address this now since it is causing this performance issue?
@mehsaandev @sharjeelyunus - is this ready to be merged? |
this needs a lil bit of cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure this is not breaking the ensemble
or server
provider. Also update the example helloApp
structure with the updated structure.
modules/ensemble/lib/util/utils.dart
Outdated
String path = EnsembleConfigService.config["definitions"]?['local']?["path"]; | ||
return '${path}/asset/${stripQueryParamsFromAsset(asset)}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be assets? instead of asset?
also the assets are stored locally in ensemble/assets
folder in case of ensemble provider. wouldn't this break the assets for ensemble provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it should be assets
and for Ensemble provider, No it won't because for ensemble provider source of each assets is cloud-based. we are not storing assets locally in case of ensemble provider, so in case of ensemble provider this function will not be called to create a local path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO, we are storing local assets in ensemble provider as well, for studio yes we provide the cloud-based urls, but when user creates a build, we store the assets in the old assets folder for ensemble provider
final secretsString = | ||
await rootBundle.loadString('${path}/config/secrets.json'); | ||
final Map<String, dynamic> appSecretsMap = json.decode(secretsString); | ||
// await dotenv.load(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this unnecessary comment
String path = | ||
EnsembleConfigService.config["definitions"]?['local']?["path"]; | ||
final secretsString = | ||
await rootBundle.loadString('${path}/config/secrets.json'); | ||
final Map<String, dynamic> appSecretsMap = json.decode(secretsString); | ||
appSecretsMap["secrets"].forEach((key, value) { | ||
secrets![key] = value; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this will work for ensemble provider? why is this static to local only?
function sayHello(name) { | ||
console.log('sayHello:'+name); | ||
} | ||
|
||
function saveName(first,last) { | ||
ensemble.storage.helloApp = {name: {first: first, last: last}}; | ||
} | ||
|
||
function getName() { | ||
if ( ensemble.storage.helloApp != null ) { | ||
return ensemble.storage.helloApp.name; | ||
} | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a JS file??? why scripts files are .yaml
files?
@sharjeelyunus Updated scripts extension to js, PTAL |
…nfig' into artifacts-folder-config
New folder structure for Local ensemble Apps:-
inside
ensemble/apps/yourAppName
, you should have the following structure for your app data:Currently Working Items:
Please change the following files in order to run this new structure:
Update
pubspec.yaml
of starter App:Add all your apps folder in the
assets
section at the very bottom. For example if the name of your app ishelloApp
then add the following underassets
CC: @amin-nas