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

Ensure the matching version of the assets package is installed #3285

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

thatbudakguy
Copy link
Member

@thatbudakguy thatbudakguy commented Aug 22, 2024

Because the "latest" npm package version is not related to the newest semver version, doing a yarn add blacklight-frontend with no version specifier currently results in retrieving v7.38.0, even though versions for v8.x are published.

This means a new Blacklight 8 app with propshaft will not retrieve the correct asset package.

This ensures that we get the npm asset version that matches Blacklight's version by asking for it explicitly, even if it has not been marked latest. If there is a mismatch between npm package versions and Blacklight gem versions, we'll get an error.

Because new npm package versions can be published without setting them to "latest", doing a `yarn add blacklight-frontend`  with no version specifier currently results in retrieving v7.38.0, even though versions for v8.x are published.

This ensures that we get the npm asset version that matches Blacklight's version by asking for it explicitly, even if it has not been marked `latest`. If there is a mismatch between npm package versions and Blacklight gem versions, we'll get an error.
@thatbudakguy thatbudakguy merged commit e9680bb into main Aug 22, 2024
13 checks passed
@thatbudakguy thatbudakguy deleted the npm-assets-version branch August 22, 2024 17:58
@jrochkind
Copy link
Member

Are you going to run this generator past initial app generation?

I think I've seen other things do a run-time check on startup by shelling out to yarn to make sure that that npm installation matches the rubygems installation. I think ruby-vite might do that for instance.

I wonder if that would be better than pinning on generation -- with a pin that needs to be updated manually on every upgrade. The pin on generation only produces a different result than before if you are installing a non-latest BL.

@thatbudakguy
Copy link
Member Author

with a pin that needs to be updated manually on every upgrade

Isn't this what you want? I think you don't want the frontend asset package version changing under you unless you also change the gem version, right?

@jrochkind
Copy link
Member

Yes, I guess that makes sense! I was thinking of the case where you forget to update the package.json pin, which I think people will frequently forget to do, and get no warning of it. But perhaps this solves a different problem!

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

Successfully merging this pull request may close these issues.

3 participants