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

ga.jspm.io never updates #244

Closed
mhenrixon opened this issue Feb 9, 2024 · 3 comments
Closed

ga.jspm.io never updates #244

mhenrixon opened this issue Feb 9, 2024 · 3 comments

Comments

@mhenrixon
Copy link

mhenrixon commented Feb 9, 2024

Steps to reproduce:

  1. Check for outdated packages
~/Code/mhenrixon/cosmos · (chore/bump-dependencies ✓)
➜  importmap outdated                                                                                                                                                                                                                       02/09/24 -  9:15 AM
| Package               | Current | Latest |
|-----------------------|---------|--------|
| @turbo-boost/commands | 0.0.16  | 0.0.18 |
| hotkeys-js            | 3.13.5  | 3.13.7 |
| trix                  | 2.0.9   | 2.0.10 |
  3 outdated packages found

That is phenomenal, now let's update these packages:

~/Code/mhenrixon/cosmos · (chore/bump-dependencies ✓)
➜  importmap pin @turbo-boost/commands hotkeys-js trix                                                                                                                                                                                      02/09/24 -  9:17 AM
Pinning "@turbo-boost/commands" to vendor/javascript/@turbo-boost/commands.js via download from https://ga.jspm.io/npm:@turbo-boost/[email protected]/app/assets/builds/@turbo-boost/commands.js
Pinning "hotkeys-js" to vendor/javascript/hotkeys-js.js via download from https://ga.jspm.io/npm:[email protected]/dist/hotkeys.esm.js
Pinning "trix" to vendor/javascript/trix.js via download from https://ga.jspm.io/npm:[email protected]/dist/trix.esm.min.js

WAT!!?? It re-downloaded the existing versions? Ok, it has to be some caching issue. No, the files still need to be uploaded...

@KonnorRogers helped me point out that the correct versions exist on unpkg so let's use that one instead:

~/Code/mhenrixon/cosmos · (chore/bump-dependencies ±)
➜  bin/importmap pin --from unpkg @turbo-boost/[email protected]                                                                                                                                                                              02/09/24 -  9:18 AM
Couldn't find any packages in ["@turbo-boost/[email protected]"] on unpkg

¿Que Pasa?

So maybe I got the package-name@version part wrong; let's pull the latest version from unpkg instead:

~/Code/mhenrixon/cosmos · (chore/bump-dependencies ±)
➜  bin/importmap pin --from unpkg @turbo-boost/commands                                                                                                                                                                                     02/09/24 -  9:24 AM
Pinning "@turbo-boost/commands" to vendor/javascript/@turbo-boost/commands.js via download from https://unpkg.com/@turbo-boost/[email protected]/app/assets/builds/@turbo-boost/commands.js`
@guybedford
Copy link
Contributor

I'd be interested to follow if this is still an issue here?

@mhenrixon
Copy link
Author

mhenrixon commented Feb 12, 2024

Today, trix and hotkeys-js were updated, but @hopsoft is having issues getting his js accepted by jspm. They want to build the precompiled JS and fail.

First of all, why does it take so long? Secondly, why am I not protected against this happening?

If I try to pin the version from the gem:

pin "@turbo-boost/commands", to: "@turbo-boost/commands.js", preload: false

I get the following error:

web    | Sprockets::Rails::Helper::AssetNotPrecompiledError (Asset `@turbo-boost/commands.js` was not declared to be precompiled in production.
web    | Declare links to your assets in `app/assets/config/manifest.js`.
web    |
web    |   //= link @turbo-boost/commands.js
web    |
web    | and restart your server):

How does one mark the JS as precompiled? According to Nate, this problem is similar to the one he saw with JSPM; it wants to precompile the file. How do we mark the file as precompiled for both rails and JSPM?

hopsoft/turbo_boost-streams#51 fixes the problem and allows me to load the code properly.

@mhenrixon
Copy link
Author

So the final nail in the coffin of this particular problem was solved in: hopsoft/turbo_boost-commands#124 so I go ahead and close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants