Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 4ccafef

Browse files
authored
Merge pull request #113 from exoego/deprecated-in-0.9.0
Remove items deprecated in v0.9.0
2 parents 7a0d375 + 4c26c85 commit 4ccafef

File tree

21 files changed

+8
-879
lines changed

21 files changed

+8
-879
lines changed

app/current/src/main/scala/io/scalajs/nodejs/Global.scala

Lines changed: 0 additions & 51 deletions
This file was deleted.

app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor
8686
*
8787
* @see [[https://nodejs.org/api/buffer.html#buffer_buf_entries]]
8888
*/
89-
def entries(): io.scalajs.collection.Iterator[js.Array[Int]] = js.native
89+
def entries(): js.Iterator[js.Array[Int]] = js.native
9090

9191
/**
9292
* Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise.
@@ -139,7 +139,7 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor
139139
* @return an [[Iterator]]
140140
* @example buf.keys()
141141
*/
142-
def keys(): io.scalajs.collection.Iterator[Int] = js.native
142+
def keys(): js.Iterator[Int] = js.native
143143

144144
/**
145145
* The largest size allowed for a single Buffer instance.
@@ -486,7 +486,7 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor
486486
* @return an iterator for buf values (bytes)
487487
* @example buf.values()
488488
*/
489-
def values(): io.scalajs.collection.Iterator[Int] = js.native
489+
def values(): js.Iterator[Int] = js.native
490490

491491
/**
492492
* Writes string to buf at offset according to the character encoding in encoding. The length parameter is

app/current/src/main/scala/io/scalajs/nodejs/console_module/Console.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class Console protected () extends js.Object {
226226
}
227227

228228
/**
229-
* A global `Console` instance configured to write to [[io.scalajs.nodejs.process.stdout]] and [[io.scalajs.nodejs.process.stderr]].
229+
* A global `Console` instance configured to write to [[io.scalajs.nodejs.process.Process.stdout]] and [[io.scalajs.nodejs.process.Process.stderr]].
230230
*/
231231
@js.native
232232
@JSGlobal("console")

app/current/src/main/scala/io/scalajs/nodejs/fs/package.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ package object fs {
3838
* @param instance the given [[Fs file system]] instance
3939
*/
4040
implicit final class FsExtensions(private val instance: Fs) extends AnyVal {
41-
@deprecated("Use Fs directly instead of Fs.fs", "0.9.0")
42-
@inline
43-
def fs: Fs = instance
44-
4541
@inline
4642
def accessFuture(path: Buffer | String): Future[Unit] = {
4743
promiseWithError0[FileIOError](instance.access(path, _))

app/current/src/main/scala/io/scalajs/nodejs/package.scala

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package io.scalajs
33
import com.thoughtworks.enableIf
44
import io.scalajs.nodejs.timers._
55

6-
import scala.concurrent.duration.FiniteDuration
76
import scala.scalajs.js
87
import scala.scalajs.js.annotation.JSGlobal
98
import scala.scalajs.js.|
@@ -17,12 +16,6 @@ package object nodejs {
1716
// Type Definitions
1817
/////////////////////////////////////////////////////////////////////////////////
1918

20-
@deprecated("use process.Process instead", "0.9.0")
21-
type Process = process.Process
22-
23-
@deprecated("use process.Environment instead", "0.9.0")
24-
type Environment = process.Environment
25-
2619
type EventType = String
2720

2821
/**
@@ -56,14 +49,6 @@ package object nodejs {
5649
/////////////////////////////////////////////////////////////////////////////////
5750
// Built-in Properties
5851
/////////////////////////////////////////////////////////////////////////////////
59-
@deprecated("Use console_module.Console. Every module stays each own package.", "0.9.0")
60-
type Console = console_module.Console
61-
62-
@deprecated("Use console_module.Console. Every module stays each own package.", "0.9.0")
63-
type ConsoleDirOptions = console_module.ConsoleDirOptions
64-
65-
@deprecated("Use console_module.Console. Every module stays each own package.", "0.9.0")
66-
val console = console_module.Console
6752

6853
/**
6954
* The directory name of the current module. This the same as the path.dirname() of the [[__filename]].
@@ -77,11 +62,6 @@ package object nodejs {
7762
*/
7863
def __filename: String = js.Dynamic.global.__filename.asInstanceOf[String]
7964

80-
@js.native
81-
@JSGlobal("global")
82-
@deprecated("Use objects in io.scalajs.nodejs", "0.9.0")
83-
object global extends Global
84-
8565
@js.native
8666
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
8767
@JSGlobal("queueMicrotask")
@@ -116,33 +96,4 @@ package object nodejs {
11696
@js.native
11797
@JSGlobal("setTimeout")
11898
object setTimeout extends SetTimeout
119-
120-
/////////////////////////////////////////////////////////////////////////////////
121-
// Implicit Conversions
122-
/////////////////////////////////////////////////////////////////////////////////
123-
124-
/**
125-
* Implicit conversion to translate durations into an integer
126-
* @param duration the given [[FiniteDuration duration]]
127-
* @return the time in milliseconds as an integer
128-
*/
129-
@deprecated("Use io.scalajs.util.DurationHelper", "0.9.0")
130-
implicit def duration2Int(duration: FiniteDuration): Int = duration.toMillis.toInt
131-
132-
/**
133-
* Implicit conversion to translate durations into a double
134-
* @param duration the given [[FiniteDuration duration]]
135-
* @return the time in milliseconds as a double
136-
*/
137-
@deprecated("Use io.scalajs.util.DurationHelper", "0.9.0")
138-
implicit def duration2Double(duration: FiniteDuration): Double = duration.toMillis.toDouble
139-
140-
/**
141-
* Implicit conversion to transform Node [[Error]]s to [[Exception]]s
142-
* @param error the given [[Error]]
143-
* @return the resulting [[Exception]]
144-
*/
145-
@deprecated("Use toException extension method from io.scalajs.util.NodeJSConverters._", "0.9.0")
146-
implicit def error2Exception(error: Error): Exception =
147-
io.scalajs.util.NodeJSConverters.ErrorExtension(error).toException()
14899
}

app/current/src/main/scala/io/scalajs/nodejs/process/Environment.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,3 @@ trait Environment extends js.Object {
3333
@JSBracketAccess
3434
def update(key: String, value: String): Unit = js.native
3535
}
36-
37-
object Environment {
38-
implicit final class EnvironmentExtension(private val env: Environment) extends AnyVal {
39-
@deprecated("Use env(key)", "0.9.0")
40-
@inline def get(key: String): Option[String] = env(key).toOption
41-
42-
@deprecated("Use env(key)", "0.9.0")
43-
@inline def contains(key: String): Boolean = env(key).isDefined
44-
}
45-
}

app/current/src/main/scala/io/scalajs/nodejs/process/package.scala

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.scalajs.nodejs
22

33
import com.thoughtworks.enableIf
4-
import io.scalajs.nodejs.tty.{ReadStream, WriteStream}
54
import io.scalajs.util.PromiseHelper.promiseWithError1
65

76
import scala.concurrent.Future
@@ -14,120 +13,6 @@ package object process {
1413
type ExitCode = Int
1514
type SendHandle = net.Socket | net.Server
1615

17-
@deprecated("use Process object instead", "0.9.0")
18-
def allowedNodeEnvironmentFlags: EnvironmentFlags = Process.allowedNodeEnvironmentFlags
19-
@deprecated("use Process object instead", "0.9.0")
20-
def arch: String = Process.arch
21-
@deprecated("use Process object instead", "0.9.0")
22-
def argv: js.Array[String] = Process.argv
23-
@deprecated("use Process object instead", "0.9.0")
24-
def argv0: String = Process.argv0
25-
@deprecated("use Process object instead", "0.9.0")
26-
def channel: js.UndefOr[js.Object] = Process.channel
27-
@deprecated("use Process object instead", "0.9.0")
28-
def config: ProcessConfig = Process.config
29-
@deprecated("use Process object instead", "0.9.0")
30-
def connected: js.UndefOr[Boolean] = Process.connected
31-
@deprecated("use Process object instead", "0.9.0")
32-
def debugPort: Integer = Process.debugPort
33-
@deprecated("use Process object instead", "0.9.0")
34-
def env: Environment = Process.env
35-
@deprecated("use Process object instead", "0.9.0")
36-
def execArgv: js.Array[String] = Process.execArgv
37-
@deprecated("use Process object instead", "0.9.0")
38-
def execPath: String = Process.execPath
39-
@deprecated("use Process object instead", "0.9.0")
40-
def exitCode: Int = Process.exitCode
41-
@deprecated("use Process object instead", "0.9.0")
42-
def features: js.Dictionary[Boolean] = Process.features
43-
@deprecated("use Process object instead", "0.9.0")
44-
def mainModule: js.UndefOr[js.Any] = Process.mainModule
45-
@deprecated("use Process object instead", "0.9.0")
46-
def moduleLoadList: js.Array[String] = Process.moduleLoadList
47-
@deprecated("use Process object instead", "0.9.0")
48-
def pid: Int = Process.pid
49-
@deprecated("use Process object instead", "0.9.0")
50-
def platform: String = Process.platform
51-
@deprecated("use Process object instead", "0.9.0")
52-
def release: ReleaseInfo = Process.release
53-
@deprecated("use Process object instead", "0.9.0")
54-
def stderr: WriteStream = Process.stderr
55-
@deprecated("use Process object instead", "0.9.0")
56-
def stdin: ReadStream = Process.stdin
57-
@deprecated("use Process object instead", "0.9.0")
58-
def stdout: WriteStream = Process.stdout
59-
@deprecated("use Process object instead", "0.9.0")
60-
def title: String = Process.title
61-
@deprecated("use Process object instead", "0.9.0")
62-
def version: String = Process.version
63-
@deprecated("use Process object instead", "0.9.0")
64-
def versions: ComponentVersion = Process.versions
65-
66-
@deprecated("use Process object instead", "0.9.0")
67-
def abort(): Unit = Process.abort()
68-
@deprecated("use Process object instead", "0.9.0")
69-
def chdir(directory: String): Unit = Process.chdir(directory)
70-
@deprecated("use Process object instead", "0.9.0")
71-
def cwd(): String = Process.cwd()
72-
@deprecated("use Process object instead", "0.9.0")
73-
def disconnect(): js.Any = Process.disconnect()
74-
@deprecated("use Process object instead", "0.9.0")
75-
def emitWarning(warning: String, name: String = null, code: String = null, ctor: js.Function = null): Unit =
76-
Process.emitWarning(warning, name, code, ctor)
77-
@deprecated("use Process object instead", "0.9.0")
78-
def exit(code: Int = 0): Unit = Process.exit(code)
79-
@deprecated("use Process object instead", "0.9.0")
80-
def getegid(): Int = Process.getegid()
81-
@deprecated("use Process object instead", "0.9.0")
82-
def geteuid(): Int = Process.geteuid()
83-
@deprecated("use Process object instead", "0.9.0")
84-
def getgid(): Int = Process.getgid()
85-
@deprecated("use Process object instead", "0.9.0")
86-
def getgroups(): js.Array[Int] = Process.getgroups()
87-
@deprecated("use Process object instead", "0.9.0")
88-
def getuid(): Int = Process.getuid()
89-
@deprecated("use Process object instead", "0.9.0")
90-
def hrtime(time: js.Array[Int] = null): js.Array[Int] = Process.hrtime(time)
91-
@deprecated("use Process object instead", "0.9.0")
92-
def initgroups(user: String, extra_group: String): js.Array[Int] = Process.initgroups(user, extra_group)
93-
@deprecated("use Process object instead", "0.9.0")
94-
def kill(pid: Int, signal: String = null): Unit = Process.kill(pid, signal)
95-
@deprecated("use Process object instead", "0.9.0")
96-
def memoryUsage(): MemoryUsage = Process.memoryUsage()
97-
@deprecated("use Process object instead", "0.9.0")
98-
def nextTick(callback: js.Function0[Any], args: js.Any*): Unit = Process.nextTick(callback, args)
99-
@deprecated("use Process object instead", "0.9.0")
100-
def openStdin(): ReadStream = Process.openStdin()
101-
@deprecated("use Process object instead", "0.9.0")
102-
def send(message: js.Any, sendHandle: SendHandle, options: TransferOptions, callback: js.Function): Boolean =
103-
Process.send(message, sendHandle, options, callback)
104-
@deprecated("use Process object instead", "0.9.0")
105-
def send(message: js.Any, sendHandle: SendHandle, options: TransferOptions): Boolean =
106-
Process.send(message, sendHandle, options)
107-
@deprecated("use Process object instead", "0.9.0")
108-
def send(message: js.Any, sendHandle: SendHandle, callback: js.Function): Boolean =
109-
Process.send(message, sendHandle, callback)
110-
@deprecated("use Process object instead", "0.9.0")
111-
def send(message: js.Any, callback: js.Function): Boolean = Process.send(message, callback)
112-
@deprecated("use Process object instead", "0.9.0")
113-
def send(message: js.Any): Boolean = Process.send(message)
114-
@deprecated("use Process object instead", "0.9.0")
115-
def setegid(id: Int): Unit = Process.setegid(id)
116-
@deprecated("use Process object instead", "0.9.0")
117-
def seteuid(id: Int): Unit = Process.seteuid(id)
118-
@deprecated("use Process object instead", "0.9.0")
119-
def setgid(id: Int): Unit = Process.setgid(id)
120-
@deprecated("use Process object instead", "0.9.0")
121-
def setgroups(groups: js.Array[Int] | js.Array[String] | js.Array[String | Int]): Unit = Process.setgroups(groups)
122-
@deprecated("use Process object instead", "0.9.0")
123-
def setuid(id: Int): Unit = Process.setuid(id)
124-
@deprecated("use Process object instead", "0.9.0")
125-
def umask(mask: Int): Int = Process.umask(mask)
126-
@deprecated("use Process object instead", "0.9.0")
127-
def umask(): Int = Process.umask()
128-
@deprecated("use Process object instead", "0.9.0")
129-
def uptime(): Int = Process.uptime()
130-
13116
/**
13217
* Process Object Extensions
13318
* @param process the given [[Process process]]

app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,6 @@ sealed trait IReadable extends LegacyStream {
152152
*/
153153
def push(chunk: Uint8Array): Boolean = js.native
154154

155-
/**
156-
* The read() method pulls some data out of the internal buffer and returns it. If there is no data available,
157-
* then it will return null.
158-
* <p/>If you pass in a size argument, then it will return that many bytes. If size bytes are not available,
159-
* then it will return null, unless we've ended, in which case it will return the data remaining in the buffer.
160-
* <p/>If you do not specify a size argument, then it will return all the data in the internal buffer.
161-
* <p/>This method should only be called in paused mode. In flowing mode, this method is called automatically
162-
* until the internal buffer is drained.
163-
* @example readable.read([size])
164-
*/
165-
@deprecated("Use readAsXXXX instead", "0.9.0")
166-
def read[T](size: Int = js.native): T = js.native
167-
168155
@JSName("read")
169156
def readAsString(size: Int = js.native): String = js.native
170157
@JSName("read")
@@ -335,24 +322,6 @@ object IReadable {
335322
}
336323
}
337324

338-
@inline
339-
@deprecated("Use iteratorAsXXXX instead", "0.9")
340-
def iterator[T]: scala.Iterator[T] = new scala.Iterator[T] {
341-
var result: T = readable.read[T]()
342-
343-
override def hasNext: Boolean = result != null
344-
345-
override def next(): T = {
346-
val value = result
347-
result = readable.read[T]()
348-
value
349-
}
350-
}
351-
352-
@inline
353-
@deprecated("Use readAsXXXXOption instead", "0.9")
354-
def readOption[A](): Option[A] = Option(readable.read[A]())
355-
356325
@inline
357326
def readAsObjectOption(): Option[js.Any] = Option(readable.readAsObject())
358327

app/current/src/main/scala/io/scalajs/nodejs/url/URLSearchParams.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class URLSearchParams() extends js.Object {
6767
* a JavaScript Array. The first item of the Array is the name, the second item of the Array is the value.
6868
* @return an iterable of an array of results
6969
*/
70-
def entries(): io.scalajs.collection.Iterator[js.Tuple2[String, String]] = js.native
70+
def entries(): js.Iterator[js.Tuple2[String, String]] = js.native
7171

7272
/**
7373
* Iterates over each name-value pair in the query and invokes the given function.
@@ -96,7 +96,7 @@ class URLSearchParams() extends js.Object {
9696
*/
9797
def has(name: String): Boolean = js.native
9898

99-
def keys(): io.scalajs.collection.Iterator[String] = js.native
99+
def keys(): js.Iterator[String] = js.native
100100

101101
/**
102102
* Sets the value in the URLSearchParams object associated with name to value. If there are any pre-existing
@@ -116,6 +116,6 @@ class URLSearchParams() extends js.Object {
116116
/**
117117
* Returns an ES6 Iterator over the values of each name-value pair.
118118
*/
119-
def values(): io.scalajs.collection.Iterator[String] = js.native
119+
def values(): js.Iterator[String] = js.native
120120

121121
}

0 commit comments

Comments
 (0)