question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split module into `main` and `core`

See original GitHub issue

We could split the bundle into a core module and the normal main one.

We can structure the library so that main, native and no-parser use core, so that the no-parser module doesn’t conflict with main and people can use both alongside each other.

~Furthermore we can make main have the domElements and support styled.div, while the styled export on core could only support styled('div'). This way people can decide to make a really tiny bundle, if they need to.~

This would also solve the problem that libraries might not use no-parser and the user does, or vice versa.

/cc @mxstbr @geelen

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
geelencommented, Apr 13, 2017

Hmm, I don’t mind breaking things apart and I certainly like smaller bundles, but I’d like to keep things grounded a bit. Splitting things in half where there’s a natural division (like core/main) is good, and if that results in a smaller bundle then great, but I don’t think we should be prioritising bundle size over DX, performance, or maintenance complexity. 11kb is fine for a lot of cases, the no-parser one will be even better, and anywhere we can improve weight without compromising the others then go for it. But just keep an eye on the broader goals of the project as you look for opportunities to split things up/slim things down.

That said, core vs main sounds like a good split. I definitely wouldn’t do the styled("div") thing though, but hoisting styled.div into import { div } from 'styled/elements' could make sense (and will be important for my current whitelisting stuff)

1reaction
kittencommented, Apr 13, 2017

@geelen in that case let’s do an elements file first, which should be simple, and a main/core with the goal of no-parser interoperability.

Sounds good? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

split applications into features, shared and core modules
Organizing an Angular project into ngModules has always been an obstacle for many beginners so I created this short guide to explain and ......
Read more >
Dev modules only in dev environments | Configuration Split
Select your development modules from the list in Complete Split. Their configuration will not be included in the main configuration.
Read more >
Split into CS and BL | OutSystems
This BL sub-layer will allow you to implement a logic that aggregates these different CS modules. This split is not entirely necessary, it...
Read more >
Lern how to split your Angular App into Modules ... - malcoded
Here is a basic AppModule generated by the angular-cli. To generate your own module, open a terminal at the root of your application-project. ......
Read more >
python - Recommended ways to split some functionality into ...
Modules are generally grouped somehow, by purpose or functionality. You could try each implementation of an interface, or other connections. Share.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found