The Wayback Machine - https://web.archive.org/web/20210122063509/https://github.com/atom/tabs/pull/238
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

Use new way of requiring Electron modules #238

Merged
merged 5 commits into from Dec 22, 2015
Merged

Use new way of requiring Electron modules #238

merged 5 commits into from Dec 22, 2015

Conversation

@50Wliu
Copy link
Member

@50Wliu 50Wliu commented Nov 19, 2015

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.

@50Wliu 50Wliu added the needs-review label Nov 19, 2015
@50Wliu 50Wliu mentioned this pull request Nov 19, 2015
17 of 18 tasks complete
@as-cii
Copy link
Contributor

@as-cii as-cii commented Nov 25, 2015

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')
@@ -1,5 +1,5 @@
BrowserWindow = null # Defer require until actually used
RendererIpc = require 'ipc'
ipc = try require 'ipc-renderer' catch then require 'ipc'

This comment has been minimized.

@steelbrain

steelbrain Dec 18, 2015

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

This comment has been minimized.

@50Wliu

50Wliu Dec 18, 2015
Author Member

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

50Wliu added 2 commits Dec 18, 2015
Hopefully this works.
@50Wliu 50Wliu changed the title Require ipc-renderer to avoid deprecations Use new way of requiring Electron modules Dec 18, 2015
50Wliu added a commit that referenced this pull request Dec 22, 2015
Use new way of requiring Electron modules
@50Wliu 50Wliu merged commit 2b8fcc3 into master Dec 22, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@50Wliu 50Wliu deleted the wl-renderer-ipc branch Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants