Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Use new way of requiring Electron modules - #238

Merged
winstliu merged 5 commits into
masterfrom
wl-renderer-ipc
Dec 22, 2015
Merged

winstliu merged 5 commits into
masterfrom
wl-renderer-ipc

Conversation

@winstliu

Copy link
Copy Markdown
Contributor

Refs atom/atom#9627

I'm not sure how to make this backwards-compatible. I assume all it takes is a simple if block (if x require('ipc-renderer') else require('ipc')) but I'm not sure what the x would be.

@winstliu winstliu mentioned this pull request Nov 19, 2015
17 of 18 tasks
@as-cii

as-cii commented Nov 25, 2015

Copy link
Copy Markdown
Contributor

I think the best way we could possibly handle this is through a try/catch block. Basically, we try to require ipc-renderer and, if that fails, we go for ipc.

ipc =
  try
    require 'ipc-renderer'
  catch
    require 'ipc'

Or, on a single line, if that looks better:

ipc = try require('ipc-renderer') catch then require('ipc')

Comment thread lib/tab-bar-view.coffee Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we should drop support for previous versions because the only place where this will be included will be bumping the version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was to make specs pass. I'll remove it once a shipped version of Atom contains this.

@winstliu winstliu changed the title Require ipc-renderer to avoid deprecations Use new way of requiring Electron modules Dec 18, 2015
winstliu pushed a commit that referenced this pull request Dec 22, 2015
Use new way of requiring Electron modules
@winstliu
winstliu merged commit 2b8fcc3 into master Dec 22, 2015
@winstliu
winstliu deleted the wl-renderer-ipc branch December 22, 2015 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants