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

Avoid config usage at build time #94

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctjhoa
Copy link
Contributor

@ctjhoa ctjhoa commented Sep 17, 2021

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
Copy link
Contributor Author

ctjhoa commented Jan 24, 2022

@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
Copy link
Contributor Author

ctjhoa commented Jan 24, 2022

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