Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

refactor: apply webpack defaults #51

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

joshwiens
Copy link
Member

Intended to be merged & released as a part of 1.0.0 on a beta dist-tag once this has been finished and properly tested.

BREAKING CHANGE:

Enforces NodeJS > 4.3 via engines

Closes #43

src/index.js Outdated
}

let result;
if (query.lazy) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename lazy => async, bc of a proposed sync option (#50) and therefore for consistency? And it is semver major anyways :)

Copy link
Member Author

@joshwiens joshwiens May 2, 2017

Choose a reason for hiding this comment

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

  • Lazy references a common naming convention for loading of something.
  • Async is about order of execution or lack there of to be more specific.

Within this particular context i think lazy is the correct name for the query option. Given a bundle is either loader lazy or not I don't see the need to define a sync option given it's the only other practical alternative to lazy and the default if you don't explicitly lazy load the bundle.

Copy link
Member

Choose a reason for hiding this comment

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

If there will never be a sync option, because it doesn't make sense then leaving lazy is better yep :).

src/index.js Outdated
import loaderUtils from 'loader-utils';

export function pitch(remainingRequest) { // eslint-disable-line no-unused-vars
const query = loaderUtils.getOptions(this) || {};
Copy link
Member

Choose a reason for hiding this comment

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

nitpick 😛 query => options

@webpack-contrib webpack-contrib deleted a comment from codecov bot Jun 9, 2017
@codecov
Copy link

codecov bot commented Jun 9, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@a2ddc3e). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff           @@
##             master   #51   +/-   ##
======================================
  Coverage          ?    0%           
======================================
  Files             ?     2           
  Lines             ?    14           
  Branches          ?     4           
======================================
  Hits              ?     0           
  Misses            ?    11           
  Partials          ?     3
Impacted Files Coverage Δ
src/cjs.js 0% <0%> (ø)
src/index.js 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2ddc3e...67f4ea4. Read the comment docs.

Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

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

Just 2 nits

{
"useBuiltIns": true,
"targets": {
"node": "4.3"
Copy link
Member

Choose a reason for hiding this comment

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

4.8

' }\n',
`}${chunkNameParam});`];
}
return result.join('');
Copy link
Member

Choose a reason for hiding this comment

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

join('\n') and remove the \n foreach item? Can be follow up style PR though

@michael-ciniawsky
Copy link
Member

We need to be careful with what is exported here aswell as the main part is the named export for the pitching loader export function pitch () {...}, so we better double check :)

@joshwiens
Copy link
Member Author

I was actually just looking at that. iirc etwp is the same way? no?

@joshwiens
Copy link
Member Author

Any way it goes, i'm not merging it. I'll push a beta directly from this branch. I'm not big on majors without a supporting test suite

@michael-ciniawsky
Copy link
Member

src/cjs.js

const loader = require('./index');

module.exports = loader.default;
module.exports.pitch = loader.pitch;

? Not 💯 :)

@michael-ciniawsky
Copy link
Member

cc @evilebottnawi

@joshwiens
Copy link
Member Author

I'm 90% sure you are right about that

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@a2ddc3e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master     #51   +/-   ##
========================================
  Coverage          ?   0.00%           
========================================
  Files             ?       2           
  Lines             ?      14           
  Branches          ?       4           
========================================
  Hits              ?       0           
  Misses            ?      11           
  Partials          ?       3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2ddc3e...67f4ea4. Read the comment docs.

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

Successfully merging this pull request may close these issues.

webpack-defaults upgrade
2 participants