Skip to content

Extract all features from content.js - #793

Merged
sindresorhus merged 1 commit into
masterfrom
get-off-my-content-lawn
Nov 3, 2017
Merged

sindresorhus merged 1 commit into
masterfrom
get-off-my-content-lawn

Conversation

@fregante

@fregante fregante commented Nov 3, 2017

Copy link
Copy Markdown
Member

As discussed in: #784 (comment)

Move it to its own file? Would be nice to eventually reduce content.js to just be a router/delegator.

I also think we should create a separate directory for the features. Now they're mixed with utils, icons, domify, etc.

This first PR only extracts content.js functions. Another PR will move whatever doesn't belong to libs out of there as well (because there are conflicting open PRs)

@fregante fregante added the meta Related to Refined GitHub itself label Nov 3, 2017
@fregante
fregante force-pushed the get-off-my-content-lawn branch from a9ebe6f to d747ed5 Compare November 3, 2017 06:18
@sindresorhus sindresorhus changed the title Extra all features from content.js Extract all features from content.js Nov 3, 2017
@sindresorhus
sindresorhus merged commit 517fbbb into master Nov 3, 2017
@sindresorhus
sindresorhus deleted the get-off-my-content-lawn branch November 3, 2017 08:47
@sindresorhus

Copy link
Copy Markdown
Member

Great. I manually tested most of the moved out features and seems to work fine.

@fregante

fregante commented Nov 3, 2017 •

Copy link
Copy Markdown
Member Author

The good part is that this only increased the bundle by 1KB, even with all that repeated code.

It sure ain't pretty though, perhaps we can replace:

import doSomething from `./features/do-something';

safely(doSomething);

to

safely(require('./features/do-something'));

@sindresorhus

Copy link
Copy Markdown
Member

I think it's fine.

fregante added a commit that referenced this pull request Nov 3, 2017
fregante added a commit that referenced this pull request Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

2 participants