Comments (2)
@guybedford Thanks, it sounds like I'm not missing anything obvious. I'll continue to set meta tags for Rails.env
and relevant Rails.application.config
values until I come across something better.
And to document some use cases for others searching:
- Stripe Publishable keys to differentiate production from test
- Error reporting based on environment
- Tagging releases for Sentry monitoring
- Access to canonical host names based on environment
from importmap-rails.
@jmckible process.env
is a CommonJS specific feature, and the process
global isn't available in browsers.
Simply defining globals is one option - globalThis.RAILS_ENV = ...
- they are exactly the shared global state.
There have been discussions around custom namespaces here like a import.meta.env
dictionary or similar, but this is just hypothetical and there are currently no standards or common conventions for environment variables in both Node.js and the browser, short of the global.
from importmap-rails.
Related Issues (20)
- Firefox fails to load module pinned to HTTP path when using CSP-nonce HOT 4
- javascript_importmap_tags should allow to set up importmap without importig entrypoint HOT 1
- Add an option to include the shim script as `defer` instead of `async` HOT 2
- `javascript_importmap_tags` method undefined after `importmap:install` HOT 1
- Class `Importmap` undefined (constant uninitiated) after gem installed and bundled HOT 1
- Import_maps going to wrong directory
- Importmap:install loads rakefile twice
- asset_path('es-module-shims.min') does not work in production HOT 1
- files ending in `_index.js` have `index` replaced with an empty string HOT 3
- Why do certain pins disappear in production? HOT 2
- Unpin command causing net error HOT 3
- Confusing message on 'update'
- Unable to unpin HOT 1
- Persistent 404 error when pinning HOT 11
- Package works when pinned from JSPM but not when downloaded HOT 2
- Break in iOS 16.2 when upgrading from 1.2.3 to 2.0.1 HOT 4
- turbo:load event not fired anymore in test environment after upgrade from 1.2.3 to 2.0.1 HOT 3
- Feature suggestion: optional `process.env` polyfill
- Multiple importmaps HOT 6
- Importmap update removes pins via http HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from importmap-rails.