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 module.exports from client bundles #5093

Merged
merged 2 commits into from
Sep 4, 2018

Conversation

timneutkens
Copy link
Member

@timneutkens timneutkens commented Sep 4, 2018

Removes module.exports so that module is no longer required

Ref: #4943 (comment)

This saves 15 bytes from every client bundle + 9 bytes from the initial HTML.

@timneutkens timneutkens changed the title Removes module.exports from client bundles Remove module.exports from client bundles Sep 4, 2018
Copy link
Contributor

@HaNdTriX HaNdTriX left a comment

Choose a reason for hiding this comment

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

Nice! ♥️

@timneutkens timneutkens mentioned this pull request Sep 4, 2018
14 tasks
@HaNdTriX
Copy link
Contributor

HaNdTriX commented Sep 4, 2018

On the long term it would be nice to remove the amount of globals we inject in the window.

e.g.:

window.__NEXT = {
	registerPage: ...,
	data: ...,
	...
}

https://github.com/zeit/next.js/blob/8e2c199ea7d5c9d27090e6b405ae1ff2f0b1b6b8/client/next-dev.js#L20

@timneutkens
Copy link
Member Author

This PR was just the first step in changing the way pages are loaded 👍

@timneutkens timneutkens merged commit d6c7050 into vercel:canary Sep 4, 2018
@timneutkens timneutkens deleted the fix/remove-module-exports branch September 4, 2018 15:30
@lock lock bot locked as resolved and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants