Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Conversation

EverlastingBugstopper
Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper commented Nov 5, 2019

This PR will fix #745 and is blocked by the following action items:

  1. Publishing of binary-install to the npm registry
  2. Publishing of wasm-pack to the npm registry
  3. Merging this PR that allows the wasm-pack-plugin to install wasm-pack via npm by itself without needing Wrangler to handle that installation

@EverlastingBugstopper
Copy link
Contributor Author

@xtuc - would love feedback on the test fixture I've put in here. I plan on making it so that wasm_pack is only installed if the plugin is included in the webpack config.

This logic may need to live in wranglerjs itself, but we will need to pass the conditional off to wrangler.

Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

Make sense so far

tests/fixtures/webpack_wasm_pack/webpack.config.js Outdated Show resolved Hide resolved
src/commands/build/wranglerjs/mod.rs Outdated Show resolved Hide resolved
@xtuc
Copy link
Member

xtuc commented Nov 6, 2019

https://github.com/cloudflare/wrangler/blob/master/wranglerjs/index.js#L58 fullConfig should contains the computed list of plugins. We'll need to communicate this information to wrangler, via the bundle https://github.com/cloudflare/wrangler/blob/master/wranglerjs/index.js#L92.

@EverlastingBugstopper EverlastingBugstopper changed the title [WIP] Don't install tools on every build [WIP] Only install wasm_pack when the wasm-pack-plugin is loaded Nov 6, 2019
@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch from e7c8084 to d2ce52a Compare November 6, 2019 16:50
@EverlastingBugstopper EverlastingBugstopper added this to the 1.6.0 milestone Nov 6, 2019
@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch from 4b916ba to b8601c5 Compare November 7, 2019 21:27
@EverlastingBugstopper EverlastingBugstopper changed the base branch from master to avery/clean-up-clean-up-everybody-contribute-to-shareholder-value November 7, 2019 21:27
@EverlastingBugstopper
Copy link
Contributor Author

EverlastingBugstopper commented Nov 7, 2019

So it seems like the webpack config plugin section looks like this:

 plugins: [ 
  {
    "_ranInitialCompilation": false,
    "crateDirectory": "/Users/averyharnish/Documents/work/_tmp/webpack-rust-worker-template/crate",
    "extraArgs": [],
    "outDir": "pkg",
    "outName": "index",
    "watchDirectories": [
      "/Users/averyharnish/Documents/work/_tmp/webpack-rust-worker-template/crate/src"
    ],
    "watchFiles": [
      "/Users/averyharnish/Documents/work/_tmp/webpack-rust-worker-template/crate/Cargo.toml"
    ],
    "wp": {
      "_events": {},
      "_eventsCount": 0,
      "options": {
        "aggregateTimeout": 200
      },
      "watcherOptions": {},
      "fileWatchers": [],
      "dirWatchers": [],
      "mtimes": {},
      "paused": false,
      "aggregatedChanges": [],
      "aggregatedRemovals": [],
      "aggregateTimeout": 0
    },
    "isDebug": false,
    "error": null
  }
]

unfortunately this doesn't really give me too much identifiable information to work with.

Additionally - it seems like the output from wranglerjs is only created once you actually run the build, and we want to install wasm_pack before the build happens, making this difficult. Would appreciate pointers on this.

@EverlastingBugstopper EverlastingBugstopper changed the title [WIP] Only install wasm_pack when the wasm-pack-plugin is loaded [WIP] Do not install wasm-pack for webpack projects Nov 13, 2019
@EverlastingBugstopper EverlastingBugstopper changed the base branch from avery/clean-up-clean-up-everybody-contribute-to-shareholder-value to master November 13, 2019 19:48
@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.6.0, 1.7.0 Nov 14, 2019
@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch from 013adb1 to 6e4ff8e Compare December 13, 2019 22:23
@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch from 6e4ff8e to 4e2fc39 Compare December 13, 2019 22:33
…off-half-of-his-workforce' of github.com:cloudflare/wrangler into avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce
@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch from be5c7ea to 063ab9b Compare December 13, 2019 23:21
@ashleymichal ashleymichal modified the milestones: 1.7.0, 1.8.0 Dec 17, 2019
@EverlastingBugstopper
Copy link
Contributor Author

This is currently blocked on rustwasm/wasm-pack#760

@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.7.0, 1.8.0 Feb 5, 2020
@ashleygwilliams ashleygwilliams modified the milestones: 1.8.0, 1.9.0 Feb 25, 2020
@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.9.0, 1.10.0 May 1, 2020
@ashleymichal ashleymichal deleted the avery/bob-the-builder-becomes-more-efficient-by-laying-off-half-of-his-workforce branch June 3, 2020 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

don't install wasm-pack for webpack projects
5 participants