deep-foundation / deep-foundation/deeplinks

deep.import aka bundler

Open
#262 1 comment 0 reactions 1 assignee Claimed by @konard View on GitHub
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

```
(Package Bundle SyncTextFile)
```

When we use

```
await deep.import('package');
```

It looks to the database for the package of specific version, if it does not exist than bundle is created and stored in `SyncTextFile` link. If it exists the JavaScript code is loaded and passed through an `eval`, that gets a way to import a package.

It should be supported in async handlers: https://github.com/deep-foundation/js-docker-isolation-provider/blob/27d585214a7110d19ae0d110463b96506c30abe7/index.ts#L28
And it also should be supported in client handlers: https://github.com/deep-foundation/deepcase/blob/f5563dd72ffabcb8cd1710a5dd43374899a7a5d0/imports/client-handler.tsx#L201

To preserve backwards compatibility it can be added only as last resort than no over ways to import the package work.

Example of bundling function can be found here: https://github.com/deep-foundation/deeplinks/tree/main/bundles

Maybe we should support it on `(Any Install PackageQuery)` instance creation.

The code to modify in that case can be placed somewhere here: https://github.com/deep-foundation/npm-packager/blob/50b860d7e40ae5c877f62512518a3add09de4b5d/handlers/install-code.ts#L1-L285

Maybe we should also support `deep.import` in sync handlers.
For sync-handlers we can install only those packages that are installed in the system.

For client and async handlers we can create a “can automatically install” permission rule.
And by default all: sync, async, client handlers can use packages that were installed by admin. And now it will be possible to install not only deep packages.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.