#Konstrukteur
1 messages · Page 1 of 1 (latest)
hi! what's an import map? not something I'm familiar with.
"Import maps let you import JavaScript modules using logical names that map to versioned/digested files – directly from the browser. So you can build modern JavaScript applications using JavaScript libraries made for ES modules (ESM) without the need for transpiling or bundling. This frees you from needing Webpack, Yarn, npm, or any other part of the JavaScript toolchain. All you need is the asset pipeline that's already included in Rails."
you probably can't use it for Stripe.js, we don't version that, you must always directly load it from our URL
looking at the docs it relies on the dependency being packaged in a certain way and declaring a version and things? if so then I don't see how they would work with stripe.js
I have to admit, that I am still working that out. I am not sure, if it is only a rails thing
Working with JavaScript in RailsThis guide covers the options for integrating JavaScript functionality into your Rails application, including the options you have for using external JavaScript packages and how to use Turbo with Rails.After reading this guide, you will know: How to use Rails without the need for a Node.js, Yarn, or a JavaScript b...
I was happy to be able to switch to the new way of including js into rails, to get everything working and stopped there. I thought I could load all external libraries or code in the same place.
I suppose I am misunderstanding something here
you could possibly add this package to the map https://github.com/stripe/stripe-js#installation
I don't know really, we don't know anything specific about Rails here I'm afraid
I think that could be it
No, problem. I asked in the Rails community too. Your suggestion really gives me direction to continue my search. I have to learn more about how modules and import maps interact with classic js code and what that means for my projects
Thank you so much for your help! And happy new year!