Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

serve sourcemap for socket.io-client #2482

Merged
merged 4 commits into from
Nov 24, 2016

Conversation

paradite
Copy link
Contributor

This fix allows server to serve the sourcemap of socket.io-client generated by webpack builder using gulp build task.

The corresponding PR for socket.io-client is socketio/socket.io-client#953

Tested in Chrome and Firefox using a custom package of socket.io-client with sourcemap file. It also catches the error when there is not sourcemap available in socket.io-client.

Screenshots of how the generated source map looks in browsers:
screen shot 2016-03-10 at 4 00 40 pm
screen shot 2016-03-10 at 4 00 29 pm

@darrachequesne
Copy link
Member

@paradite hi! could you rebase after #2603 and #2567 please?

}

debug('serve client sourcemap');
res.setHeader('Content-Type', 'application/javascript');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, according to this, it seems the content-type should rather be application/json.

@paradite
Copy link
Contributor Author

sure. i will check what to do.

@darrachequesne
Copy link
Member

@paradite thanks a lot, sorry for the delay (...)

@paradite
Copy link
Contributor Author

Ah, sorry I did merge instead of rebase, is that okay?

I've updated the code based on #2603 and #2567 and I retained the try catch block in case of inconsistent versions between server and client resulting in no sourcemap file.

@darrachequesne darrachequesne merged commit 0ef55b2 into socketio:master Nov 24, 2016
@darrachequesne
Copy link
Member

@paradite thanks!

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

Successfully merging this pull request may close these issues.

2 participants