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

Allow Rapid to work in sandbox (no CDN) #1482

Closed
bhousel opened this issue Jul 3, 2024 · 1 comment
Closed

Allow Rapid to work in sandbox (no CDN) #1482

bhousel opened this issue Jul 3, 2024 · 1 comment
Assignees
Labels
chore Improvements to the code or development stack, cleanups
Milestone

Comments

@bhousel
Copy link
Contributor

bhousel commented Jul 3, 2024

We've had a request to make Rapid work in a sandbox kind of environment behind a corporate firewall where it won't have access to fetch resources from the CDN. We should support this way of running Rapid.

I'm working on fixes now to get the Translations working again #206 , so while changing around how we package up all our data files, I'll see if I can get this in too.

@bhousel bhousel self-assigned this Jul 3, 2024
@bhousel bhousel added the chore Improvements to the code or development stack, cleanups label Jul 3, 2024
@bhousel bhousel added this to the v2.4 milestone Jul 12, 2024
bhousel added a commit that referenced this issue Jul 12, 2024
(re: #1482)

This system will need to do more than just load data..
It will need to keep track of the different ways that assets can be loaded:
1. Local (everything must be in `dist/`)
2. CDN (some assets like imagery, presets, nsi, oci, can get releases independent of Rapid)
3. Rails Asset Pipeline (for embed on osm.org or similar sites)
bhousel added a commit that referenced this issue Jul 16, 2024
(re: #1482)

This is to support running Rapid only loading files from local dist folder, no CDN
@bhousel
Copy link
Contributor Author

bhousel commented Jul 18, 2024

This landed in #1490
The way it works is that:

  • Our old DataLoderSystem is now renamed to AssetSystem
  • The AssetSystem can not track multiple "origins" to fetch assets from. We now support:
    • local - will only load assets from the local folder.
    • latest - may load latest assets from a CDN which match the expected semantic version
  • You can control which origin the assets are fetched from prior to calling initAsync like this:

    Rapid/index.html

    Lines 45 to 48 in 82caae8

    const context = new Rapid.Context();
    context.containerNode = container;
    context.assetPath = 'dist/';
    // context.assetOrigin = 'local'; // test no CDN

bhousel added a commit that referenced this issue Sep 16, 2024
(re: #1561)

- No sourcemaps for legacy builds
- Exclude `dist/data/modules`

This returns the package back to a reasonable size.
`npm publish --dry-run` results in:
  npm notice package size: 24.5 MB
  npm notice unpacked size: 94.8 MB

We can figure out another way to publish a package that includes everything
re: #1482
bhousel added a commit that referenced this issue Sep 16, 2024
(re: #1482, closes: #1561)

This was added to support running Rapid in a sandox environment, see #1482.
However it made our published package too big, so we need to remove it, see #1561.

I created https://github.com/rapideditor/rapid-standalone
for anyone that actually needs a version of Rapid that works this way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Improvements to the code or development stack, cleanups
Projects
None yet
Development

No branches or pull requests

1 participant