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

Add locking feature to prevent stale code #25

Merged
merged 5 commits into from
Dec 19, 2014
Merged

Add locking feature to prevent stale code #25

merged 5 commits into from
Dec 19, 2014

Conversation

rondale-sc
Copy link
Collaborator

Adds locking feature that works with ember-cli-rails-addon (the companion addon in node land)

The ember-cli-rails-addon uses the preBuild hook to write a file called preBuild.lock to the output and the postBuild hook to delete that file and write postBuild.lock

The middleware we are now injecting blocks until the preBuild file is not found and the postBuild is found before continuing the request. This results in a block until ember-cli has fully built the output.

Cheers 🍺

$ npm install --save-dev ember-cli-rails-addon@#{ADDON_VERSION}`

in you Ember application root: #{app_path}
MSG

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These heredocs are great!

@hashrocketeer
Copy link

LGTM

def check_addon!
dependencies = package_json.fetch("devDependencies", {})

unless dependencies["ember-cli-rails-addon"] == ADDON_VERSION
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to check for EmberCLI version. It must be greater than 1.3.0 in order to have the preBuild hook that the addon needs.

ember-cli/ember-cli#2411

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure that you should care too much about this here. You can make the addon check the required version var version = this.project.emberCLIVersion(); and it can be kept with a nice message. Then here (in ember-cli-rails) you just don't have to care about it.

@rwjblue rwjblue mentioned this pull request Dec 18, 2014
2 tasks
rwz added a commit that referenced this pull request Dec 19, 2014
Add locking feature to prevent stale code
@rwz rwz merged commit fe59997 into master Dec 19, 2014
@rwjblue
Copy link
Contributor

rwjblue commented Dec 19, 2014

WOOT, awesome job y'all!

@seanpdoyle seanpdoyle deleted the lock_steady branch November 19, 2015 17:05
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.

4 participants