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

Remove unwanted semicolon in assets files #2280

Merged
merged 1 commit into from
Sep 1, 2020
Merged

Remove unwanted semicolon in assets files #2280

merged 1 commit into from
Sep 1, 2020

Conversation

nlssn
Copy link
Contributor

@nlssn nlssn commented Aug 31, 2020

Fixes #2120

Changes proposed in this pull request:
Removes an unnecessary / unwanted semicolon that is generated in /assets/forum-<hash>.js and /assets/admin-<hash>.js.

As mentioned by @clarkwinkelmann the problem is found here:
https://github.com/flarum/core/blob/d492579638fb52dafbfe65f1f36a95eb6047f7f3/src/Frontend/Compiler/JsCompiler.php#L72

I simply removed the extra semicolon. No errors showing.

Confirmed

- [ ] Frontend changes: tested on a local Flarum installation.
- [ ] Backend changes: tests are green (run composer test).

@askvortsov1 askvortsov1 merged commit 384edfa into flarum:master Sep 1, 2020
@clarkwinkelmann
Copy link
Member

Note for the future: this PR actually changed more than I expected, but it's not creating any issue.

What was before

var module={};

modules.export = /* extension code*/;
;

flarum.extensions['extensionName']=module.exports;

is now

var module={}

modules.export = /* extension code*/;

flarum.extensions['extensionName']=module.exports

The semicolumn after module=[} and =module.exports was never part of the Frontend extender, instead it was an artifact because Flarum was adding a sourcemap for each individual source. Which means one extension was actually 3 sources, each with a sourcemap being replaced and with a semicolumn added at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unwanted semicolon in assets files
4 participants