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

Package now consists of ES2015 and commonjs #1576

Merged
merged 9 commits into from Jan 25, 2018

Conversation

Projects
None yet
3 participants
@rosskevin
Copy link
Collaborator

rosskevin commented Jan 25, 2018

As discussed in apollo-maintainers target package creation to support main as commonjs and module as ES2015.

/cc @jaydenseric

Closes #1575

rosskevin added some commits Jan 25, 2018

@rosskevin rosskevin requested a review from jbaxleyiii Jan 25, 2018

@rosskevin rosskevin changed the title Package mjs cjs Package now consists of ES2015 and commonjs Jan 25, 2018

@rosskevin rosskevin requested a review from excitement-engineer Jan 25, 2018

@jbaxleyiii
Copy link
Member

jbaxleyiii left a comment

@rosskevin a few questions here

@@ -90,28 +104,26 @@
"babel-core": "6.26.0",
"babel-jest": "22.1.0",
"babel-preset-env": "1.6.1",
"bundlesize": "0.15.3",

This comment has been minimized.

@jbaxleyiii

jbaxleyiii Jan 25, 2018

Member

@rosskevin why are we removing bundlesize?

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

We aren't creating a UMD bundle anymore, not sure if we can size a non-compressed folder of files. I'll check.

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

Added back to test rollup-produced CJS file

"rimraf": "2.6.2",
"rollup": "0.54.1",

This comment has been minimized.

@jbaxleyiii

jbaxleyiii Jan 25, 2018

Member

do we not need this anymore? Does typescript handle all of the bundling?

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

tsc does 100% of the transpilation - no more bundles (discussed with @jaydenseric in the thread)

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

rollup added back for bundlesize only

@@ -5,37 +5,40 @@
"module": "src/index.ts",

This comment has been minimized.

@jaydenseric

jaydenseric Jan 25, 2018

Contributor

How does this work, does main and module get added to the package.json that actually gets published?

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

ugh, that's no good

This comment has been minimized.

@rosskevin

rosskevin Jan 25, 2018

Author Collaborator

wait, no, this is ok - it's there for codesandbox. Pay no attention to the /package.json, just to lib/package.json

rosskevin added some commits Jan 25, 2018

@jbaxleyiii

This comment has been minimized.

Copy link
Member

jbaxleyiii commented Jan 25, 2018

L:ooks like the bundlesize calculation is wrong but I'll fix that on master

@jbaxleyiii jbaxleyiii merged commit 18939c2 into apollographql:master Jan 25, 2018

4 checks passed

CLA Author has signed the Meteor CLA.
Details
bundlesize ./lib/bundlesize/react-apollo.js: 363B < maxSize 4.81KB gzip
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 96.284%
Details
@rosskevin

This comment has been minimized.

Copy link
Collaborator Author

rosskevin commented Jan 25, 2018

I confirmed this PR locally with a package build using ts-loader

@rosskevin rosskevin deleted the rosskevin:package-mjs-cjs branch Jan 25, 2018

@jaydenseric

This comment has been minimized.

Copy link
Contributor

jaydenseric commented Jan 29, 2018

I'm confused, I'm looking at what is published in react-apollo@^2.1.0-beta.0 and it is nothing like discussed in Slack:

screen shot 2018-01-29 at 3 51 04 pm

It should be:

{
  "main": "index",
  "module": "index.mjs"
}

We discussed minification and bundling, and agreed that it would only happen to test bundle size but no UMD or AMD would be distributed. Currently the main points to a minified react-apollo-umd.js!

Also, many of the .mjs files are invalid as they have require in them, see #1589.

I'm trying to work out what has been going on looking at the release descriptions, and they don't make sense. v2.1.0-alpha.1 and v2.1.0-alpha.2 have the exact same bullet list of changes.

No release mentions .mjs anywhere, which it should because it's a pretty big deal.

@rosskevin

This comment has been minimized.

Copy link
Collaborator Author

rosskevin commented Jan 29, 2018

@jaydenseric @jbaxleyiii changed the main in #1578.

You should look at this changeset, it is exactly as discussed.

I'll place the rest of my comments in #1589.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment