Skip to content

Commit 2302a7b

Browse files
committed
Remove .js from manifest.js paths
When migrating to Webpack v5, we'll be generating rev-manifest.json from the Webpack stats object, which doesn't include .js in the asset name keys.
1 parent 6a4ffad commit 2302a7b

File tree

16 files changed

+19
-16
lines changed

16 files changed

+19
-16
lines changed

lib/MusicBrainz/Server/Data/FileCache.pm

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ sub path_to {
7979
my ($self, $manifest) = @_;
8080

8181
$manifest =~ s/^\///;
82+
$manifest =~ s/\.js(on)?$//;
8283
return DBDefs->STATIC_RESOURCES_LOCATION . '/' .
8384
($self->manifest_signature($manifest) // $manifest);
8485
}

root/account/applications/Register.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const RegisterApplication = (props: Props): React.Element<typeof Layout> => (
2828
form={props.form}
2929
submitLabel={l('Register')}
3030
/>
31-
{manifest.js('account/applications/register.js', {async: 'async'})}
31+
{manifest.js('account/applications/register', {async: 'async'})}
3232
</Layout>
3333
);
3434

root/area/AreaIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const AreaIndex = ({
4040
entity={area}
4141
/>
4242
<Relationships source={area} />
43-
{manifest.js('area/index.js', {async: 'async'})}
43+
{manifest.js('area/index', {async: 'async'})}
4444
</AreaLayout>
4545
);
4646

root/area/AreaPlaces.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const AreaPlaces = ({
4040
{DBDefs.MAPBOX_ACCESS_TOKEN ? (
4141
<>
4242
<div id="largemap" />
43-
{manifest.js('area/places-map.js', {'data-args': mapDataArgs})}
43+
{manifest.js('area/places-map', {'data-args': mapDataArgs})}
4444
</>
4545
) : (
4646
<p>

root/artist/ArtistIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const ArtistIndex = ({
339339
/>
340340
)}
341341

342-
{manifest.js('artist/index.js', {async: 'async'})}
342+
{manifest.js('artist/index', {async: 'async'})}
343343
</ArtistLayout>
344344
);
345345
};

root/event/EventIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const EventIndex = ({
5858
</p>
5959
</>
6060
) : null}
61-
{manifest.js('event/index.js', {async: 'async'})}
61+
{manifest.js('event/index', {async: 'async'})}
6262
</EventLayout>
6363
);
6464
};

root/instrument/InstrumentIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const InstrumentIndex = ({
5151
entity={instrument}
5252
/>
5353
<Relationships source={instrument} />
54-
{manifest.js('instrument/index.js', {async: 'async'})}
54+
{manifest.js('instrument/index', {async: 'async'})}
5555
</InstrumentLayout>
5656
);
5757

root/label/LabelIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const LabelIndex = ({
7777
) : (
7878
<p>{l('This label does not have any releases.')}</p>
7979
)}
80-
{manifest.js('label/index.js', {async: 'async'})}
80+
{manifest.js('label/index', {async: 'async'})}
8181
</LabelLayout>
8282
);
8383

root/place/PlaceIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const PlaceIndex = ({
4646
entity={place}
4747
/>
4848
<Relationships source={place} />
49-
{manifest.js('place/index.js', {async: 'async'})}
49+
{manifest.js('place/index', {async: 'async'})}
5050
</PlaceLayout>
5151
);
5252

root/place/PlaceMap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const PlaceMap = ({
3434
DBDefs.MAPBOX_ACCESS_TOKEN ? (
3535
<>
3636
<div id="largemap" />
37-
{manifest.js('place/map.js', {'data-args': mapDataArgs})}
37+
{manifest.js('place/map', {'data-args': mapDataArgs})}
3838
</>
3939
) : (
4040
<p>

root/recording/RecordingMerge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const RecordingMerge = ({
7373
</EnterEdit>
7474
</form>
7575
</div>
76-
{manifest.js('recording/merge.js', {async: 'async'})}
76+
{manifest.js('recording/merge', {async: 'async'})}
7777
</Layout>
7878
);
7979

root/relationship/linktype/RelationshipTypePairTree.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const RelationshipTypePairTree = ({
174174
{type0: formattedType0, type1: formattedType1},
175175
)}
176176
>
177-
{manifest.js('edit.js')}
177+
{manifest.js('edit')}
178178
<div id="content">
179179
<RelationshipsHeader />
180180

root/release_group/ReleaseGroupIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const ReleaseGroupIndex = ({
186186
</div>
187187
</>
188188
)}
189-
{manifest.js('release-group/index.js', {async: 'async'})}
189+
{manifest.js('release-group/index', {async: 'async'})}
190190
</ReleaseGroupLayout>
191191
);
192192

root/series/SeriesIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const SeriesIndex = ({
153153
)}
154154

155155
<Relationships source={series} />
156-
{manifest.js('series/index.js', {async: 'async'})}
156+
{manifest.js('series/index', {async: 'async'})}
157157
</SeriesLayout>
158158
);
159159
};

root/static/manifest.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ function js(
3939
manifest: string,
4040
extraAttrs?: {+'async'?: 'async', +'data-args'?: mixed} | null = null,
4141
): React.Element<'script'> {
42-
if (!jsExt.test(manifest)) {
43-
manifest += '.js';
42+
if (jsExt.test(manifest)) {
43+
throw new Error(
44+
'Do not include .js in the manifest path name',
45+
);
4446
}
4547
return (
4648
<script

root/work/WorkIndex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const WorkIndex = ({
6060
pagedLinkTypeGroup={pagedLinkTypeGroup}
6161
pager={pager}
6262
/>
63-
{manifest.js('work/index.js', {async: 'async'})}
63+
{manifest.js('work/index', {async: 'async'})}
6464
</WorkLayout>
6565
);
6666

0 commit comments

Comments
 (0)