public function registerJsFile($url, $options = [], $key = null)
    {
        $url = \Reaction::$app->getAlias($url);
        $key = $key ?: $url;
        $helpers = $this->app->helpers;

        $depends = ArrayHelper::remove($options, 'depends', []);

        if (empty($depends)) {
            $position = ArrayHelper::remove($options, 'position', self::POS_END);
            $this->jsFiles[$position][$key] = $helpers->html->jsFile($url, $options);
        } else {
            $this->getAssetManager()->bundles[$key] = Reaction::create([
                'class' => AssetBundle::class,
                'baseUrl' => '',
                'js' => [strncmp($url, '//', 2) === 0 ? $url : ltrim($url, '/')],
                'jsOptions' => $options,
                'depends' => (array)$depends,
            ]);
            $this->registerAssetBundle($key);
        }
    }