Skip to content
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

Emulator Package Alternative #644

Closed
FlorianRappl opened this issue Nov 14, 2023 · 1 comment
Closed

Emulator Package Alternative #644

FlorianRappl opened this issue Nov 14, 2023 · 1 comment
Assignees
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Milestone

Comments

@FlorianRappl
Copy link
Contributor

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

Right now there are two ways to start a debug process of a pilet; either a package has been installed (e.g., from an npm registry, or locally etc.) or the path / package can be resolved locally pointing to the raw source code (this is the case in a monorepo). In the latter case running piral debug on it is tried (usually successful, but this may also fail under certain conditions).

I think there is room for at least a third way: Using a website, which may run locally, but usually will run in some kind of (non-production) environment.

The provided environment must have a debug build of the application that also contains relevant parts of the package.json (dependencies / versions) and the declaration. Ideally all relevant parts are put into a special meta.json file, maybe even having an index in there with all used / exposed files.

Background

This is also the way for many single-spa and module federation projects. Quite often this has quite some drawbacks (e.g., more resources needed, local development not so easily possible, ...), but it also can have some advantages (always up-to-date, no need for a private npm registry if none available, ...).

Discussion

The emulator website would mostly be interesting for download purposes. While we could use the website directly, I think having "localhost" for it makes a lot of sense. Some parts definitely need to be downloaded, e.g., the type declarations.

What I imagine would be the best way forward:

  • In the pilet.json having a remote with an address marker for the emulator website of the respective Piral instance
  • When the Piral CLI finds such an entry it creates a package in the node_modules using the name of the Piral instance
  • The created package will contain the (snapshot of the) type declarations and cached / used files
  • If online these files will be updated regularly (i.e., in the beginning immediately), but if no connection is there / the emulator website is down then the local fallback will be used

This way the emulator is always up-to-date, but the local sources could be used as fallback in case of offline activity.

@FlorianRappl FlorianRappl added enhancement New feature or request cli Concerns the piral-cli application. labels Nov 14, 2023
@FlorianRappl FlorianRappl added this to the 1.4.0 milestone Nov 14, 2023
@FlorianRappl FlorianRappl added in-review The item is currently being reviewed. in-implementation The item is currently being implemented. in-testing The item is already out in preview and can be tested. and removed in-review The item is currently being reviewed. in-implementation The item is currently being implemented. labels Nov 14, 2023
@FlorianRappl FlorianRappl self-assigned this Nov 21, 2023
@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Nov 21, 2023
@FlorianRappl
Copy link
Contributor Author

Available and documented.

FlorianRappl added a commit that referenced this issue Jan 17, 2024
Bind `this` In Pilet API Event Functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant