Skip to content

Commit

Permalink
Revert javascript assets via URL - Fixes #161
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Sep 20, 2019
1 parent 18b86fc commit ca8bd43
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `ignition` will be documented in this file

## 1.8.1 - 2019-09-20

- Revert javascript assets via URL - Fixes #161

## 1.8.0 - 2019-09-18

- added solution for running Laravel Dusk in production (#121)
Expand Down
3 changes: 1 addition & 2 deletions resources/views/errorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<?php endforeach; ?>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css">

<script src="<?=$housekeepingEndpoint?>/assets"></script>
</head>
<body class="scrollbar-lg">

Expand All @@ -44,6 +42,7 @@

<div id="app"></div>

<script><?= $getAssetContents('ignition.js') ?></script>
<script>
window.Ignition = window.ignite(window.data);
</script>
Expand Down
8 changes: 8 additions & 0 deletions src/ErrorPage/ErrorPageViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ public function jsonEncode($data): string
return json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR | $jsonOptions);
}

public function getAssetContents(string $asset): string
{
$assetPath = __DIR__."/../../resources/compiled/{$asset}";

return file_get_contents($assetPath);
}

public function styles(): array
{
return array_keys(Ignition::styles());
Expand Down Expand Up @@ -151,6 +158,7 @@ public function toArray(): array
'scripts' => $this->scripts(),
'tabs' => $this->tabs(),
'jsonEncode' => Closure::fromCallable([$this, 'jsonEncode']),
'getAssetContents' => Closure::fromCallable([$this, 'getAssetContents']),
];
}
}
17 changes: 0 additions & 17 deletions src/Http/Controllers/IgnitionAssetsController.php

This file was deleted.

2 changes: 0 additions & 2 deletions src/IgnitionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use Illuminate\View\Engines\PhpEngine as LaravelPhpEngine;
use Facade\Ignition\Http\Controllers\HealthCheckController;
use Facade\Ignition\Http\Controllers\ShareReportController;
use Facade\Ignition\Http\Controllers\IgnitionAssetsController;
use Facade\Ignition\Http\Controllers\ExecuteSolutionController;
use Facade\Ignition\SolutionProviders\SolutionProviderRepository;
use Facade\Ignition\SolutionProviders\ViewNotFoundSolutionProvider;
Expand Down Expand Up @@ -131,7 +130,6 @@ protected function registerHousekeepingRoutes()
Route::post('execute-solution', ExecuteSolutionController::class);
Route::post('share-report', ShareReportController::class);

Route::get('assets', IgnitionAssetsController::class);
Route::get('scripts/{script}', ScriptController::class);
Route::get('styles/{style}', StyleController::class);
});
Expand Down

0 comments on commit ca8bd43

Please sign in to comment.