Skip to content

Avoid config usage at build time - #94

Draft
ctjhoa wants to merge 1 commit into
josemarluedke:masterfrom
concordnow:fix_config
Draft

Avoid config usage at build time#94
ctjhoa wants to merge 1 commit into
josemarluedke:masterfrom
concordnow:fix_config

Conversation

@ctjhoa

@ctjhoa ctjhoa commented Sep 17, 2021

Copy link
Copy Markdown
Contributor

As I understand Ember configuration files:

  • ember-cli-build.js is for build time configuration
  • config/environment is for run time configuration

My goal is to drive segment config at runtime to be able to reuse build artifact across multiple environments.

This first attempt use window variable to communicate the Ember config to the Segment snippet

@ctjhoa ctjhoa changed the title Avoid config usage on build time Avoid config usage at build time Sep 17, 2021
@ctjhoa

ctjhoa commented Jan 24, 2022

Copy link
Copy Markdown
Contributor Author

@josemarluedke reply from discord

I don't like the usage of the window.
I think we should go with injecting the script
Ember Metrics does something similar as well
https://github.com/adopted-ember-addons/ember-metrics/blob/master/addon/metrics-adapters/segment.js

@ctjhoa

ctjhoa commented Jan 24, 2022

Copy link
Copy Markdown
Contributor Author

Note: Segment now offers analytics script as npm package.
https://github.com/segmentio/analytics-next#-using-as-an-npm-package

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.

1 participant