text:
runtimeChunk: single is not being honored for first entrypoint

Operating System: macOS 10.13/Arch Linux
Node Version: 10.3.0
NPM Version: 6.1.0
webpack Version: 4.10.1
webpack-serve Version: 1.0.2

This issue is for a:

[x] bug
[ ] feature request
[ ] modification request

Code
https://github.com/whs/wps-issue
How Do We Reproduce?

Run npm start
Go to http://localhost:8080/a.js . This URL has the runtime code even though there is /runtime.js already. Somehow, the chunk b and c does not have the runtime code.
Run npm run build (or just use the prebuilt files)
Look in dist/{a,b,c}.js. The files does not have any runtime code.

👉🏽 Need support, advice, or help? Don't open an issue.
Head to StackOverflow or https://gitter.im/webpack/webpack.

Not sure what a 'runtime code' is in this context (or in the context of webpack). webpack-serve doesn't modify your config or compiler (outside of webpack-hot-client adding an entry to allow for HMR). You may also be experiencing the same effects as #114

I'm pretty sure this is a bug in webpack stack, but it may or may not be a bug of webpack-serve. I'll try looking into webpack-hot-client.
In the minimal example I posted, I'm not using --content nor having any static content so I believe this is not the same case as #114.
The runtime is this piece of code which is described in webpack docs. In this bug, the runtime code appears in some entrypoints despite turning on the option to split it to another chunk. This is not the case when the same configuration is used with webpack-cli.

With regard to --content (or more specifically the content option) the default value is process.cwd() if no value is specified. It looks like the README doesn't have that correct, so I'll update it. As for the build, we pass things directly onto webpack-dev-middleware, which passes the config directly onto webpack proper.

Here's what I found:

I could isolate the issue to somewhere in webpack-hot-client's hotEntry. If I set WHC_TARGET to something else then the problem will not exists.
From what I understand the function injects webpack-hot-client/client?random into the first entrypoint.
So I run with WHC_TARGET set to disable autoinject and manually injectwebpack-hot-client/client?random into my entrypoint. The issue still does not happen.
With some breakpoints, I found that MultiEntryPlugin ran twice, one with original entrypoints and one with modified entrypoint. I modified EntryOptionPlugin to ignore the first call and the issue was resolved.

In summary, I believe the issue is that webpack-hot-client injected itself too late in the process.
Should I open an issue in webpack-hot-client?

You could, but the point at which hot-client is injecting the entries is literally the only place in the process that it can. A better route for your environment might be to use autoConfigure: false and add the entries and HMR Plugin as needed.

Submitted as https://github.com/webpack/webpack/issues/7452

@whs Did you ever resolve this? I'm not familiar with how all these libs tie together and I've had a hell of a time with trying to figure this out. I had to revert to webpack-dev-server so I could continue working.
I'm pretty sure my issue is the same, except I'm seeing the runtime chunk get inserted at the top of all my entry points. So, two scripts that should be sharing a single instance of a 3rd party module are both getting their own individual instances of it, causing errors.
With optimization: { runtimeChunk: single, ....... }, my production webpack build spits out a runtime.js that I include before other scripts. It looks like webpack-dev-server is doing the same (in-memory), but webpack-serve isn't.

We have moved back to webpack-dev-server

authors: shellscape simshaun whs

repo: webpack-contrib/webpack-serve


text:
Use React Refs instead of DOM queries

Hello. This PR replaces some dom queries with react refs. Just an idiomatic thing, nothing too big :)

This fixes https://github.com/webpack/webpack.js.org/issues/2208 ?

No, it doesn't. Just a convention/code style thing.

Thanks!

source: gharchive/pull-request

authors: montogeek tryzniak

license_type: permissive

license_source: github-api


text:
When updating from 5.0.0-beta.26 to 5.0.0-beta.27 build fails

Bug report
What is the current behavior?
When trying to build I get this:
HookWebpackError: asset.source.buffer is not a function
    at makeWebpackError (/home/runner/work/web/web/node_modules/webpack/lib/HookWebpackError.js:49:9)
    at /home/runner/work/web/web/node_modules/webpack/lib/Compilation.js:1978:11
    at eval (eval at create (/home/runner/work/web/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
-- inner error --
TypeError: asset.source.buffer is not a function
    at /home/runner/work/web/web/node_modules/webpack/lib/optimize/RealContentHashPlugin.js:213:25
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
caused by plugins in Compilation.hooks.processAssets
TypeError: asset.source.buffer is not a function
    at /home/runner/work/web/web/node_modules/webpack/lib/optimize/RealContentHashPlugin.js:213:25
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:2554) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined
    at /home/runner/work/web/web/config/webpack/config.js:156:22
    at finalCallback (/home/runner/work/web/web/node_modules/webpack/lib/Compiler.js:367:32)
    at onCompiled (/home/runner/work/web/web/node_modules/webpack/lib/Compiler.js:376:20)
    at /home/runner/work/web/web/node_modules/webpack/lib/Compiler.js:974:25
    at /home/runner/work/web/web/node_modules/webpack/lib/Compilation.js:1977:17
    at eval (eval at create (/home/runner/work/web/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

An example is here: https://github.com/cloverleaf/web/pull/223/checks?check_run_id=1007353755
The only thing that changed in this PR is the version number so I'm fairly sure this is the issue.
The config I'm using can be found here but it's not a minimal repro https://github.com/cloverleaf/web/blob/13d58fdbdccfc6918474b1c503959cc80bdbee9a/config/webpack/config.js
Other relevant information:
webpack version:  5.0.0-beta.27
Node.js version: v12.18.3
Operating System: Tested on Windows 10 and Ubuntu

Try to update to beta 28 https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.28, I think it's fixed.

source: gharchive/issue

authors: ChildishGiant chenxsan

repo: webpack/webpack

license: MIT


text:
splitChunks with innerGraph does not add required dependencies into common chunk

Bug report

What is the current behavior?
Two entries and common chunk (see the linked repo for more details):

index1 - imports dep1 which imports dep2. actually uses both of them
index2 - imports dep1 but only uses a function that does not depend on dep2
commons - contains everything that is used by more than one entry

The issue is that dep2 is detected only as required only for index1 (since index2 does not actually use it). By itself that is kind of fine - when loading commons+index1, everything works, because dep2 is loaded from index1 chunk.
However when loading index2, fails with runtime error due to the fact that in commons chunk, dep1 still lists dep2 as dependency - but it is not included in either commons or index2.
If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/Knagis/webpack-concat-issue/tree/commons-error

What is the expected behavior?
no runtime errors (either dep2 is included in commons chunk or it is loaded only when calling the function that uses it or various other combinations of moving/splitting the modules so that it works for both entries)

Other relevant information:
webpack version:  5.1.3
Node.js version: 12.13.1
Operating System: Win10
Additional tools:

setting optimization.innerGraph = false prevents the problem - and gets both dep1 and dep2 added to the commons chunk. or adds dep2 to both index1 and index2 if I set the commons to explicitly only include dep1 (instead of all modules in more than one entry).

i can reproduce it
https://github.com/Knagis/webpack-concat-issue/blob/c46dfd7cdfee8d301547a32417ca825c343e398e/dist/main2.js#L35
__webpack_modules__ in main2.js only contains 51 and 113 but gets called with 891
__webpack_modules__
{…}

51: function 51(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__)
113: function 113(__unused_webpack_module, __webpack_exports__, __webpack_require__)
<prototype>: Object { … }

moduleId
891
__webpack_modules__[moduleId]
undefined

hmm, yes that's a tricky case... The import is actually unused in index2, but merging the two variants of dep1 into a common variant (shared by both runtimes) generates an invalid __webpack_require__(891).
We probably need to generate some code to conditionally import the dependencies depending on runtime, so these forcefully shared modules can be generated correctly.
There are multiple workaround possible:

no name for splitChunks to avoid forcing them to merge
optimization.usedExports: "global" to disable runtime-dependent exports
optimization.innerGraph: false to disable import usage tracking

I'm hitting the same problem. Using optimization.sideEffects: false seems to work around the issue for me.

There is a bugfix here: https://github.com/webpack/webpack/pull/11802
but I'm unsure if this has more undiscovered side effects...
Maybe you can test the PR in your real repos, that would give me more certainty that it works fine?
You can just reference a branch in your package.json "webpack": "webpack/webpack#bugfix/11770"

will do. hopefully during weekend, if not, on Monday.

@sokra I just tested the the bugfix/11770 branch  and unfortunately it shows about 100 errors like the following.
Is there anything I can do to help?
ERROR in ./src/framework/SplitViewModule/configuration.ts
str.replace is not a function
 @ ./src/framework/SplitViewModule/index.ts 9:0-56 104:22-43
 @ ./src/modules/las_mod_siheader/index.ts 16:0-79 45:36-51 106:27-41 140:27-42 149:27-41 154:32-47 166:93-108 180:27-42 206:17-32 213:17-32 229:17-31 233:17-32 538:27-42 538:57-71

ERROR in ./src/framework/SplitViewModule/info.ts
str.replace is not a function
 @ ./src/framework/SplitViewModule/index.ts 16:0-38 211:15-27
 @ ./src/modules/las_mod_siheader/index.ts 16:0-79 45:36-51 106:27-41 140:27-42 149:27-41 154:32-47 166:93-108 180:27-42 206:17-32 213:17-32 229:17-31 233:17-32 538:27-42 538:57-71

ERROR in ./src/framework/SplitViewModule/table.ts
str.replace is not a function
 @ ./src/framework/SplitViewModule/index.ts 15:0-152 134:15-30 164:32-43 198:19-31 422:47-64 445:16-33 470:16-33 505:20-37 506:54-67 546:46-59 639:45-62 640:39-52 663:37-50 681:43-60
 @ ./src/modules/las_mod_siheader/index.ts 16:0-79 45:36-51 106:27-41 140:27-42 149:27-41 154:32-47 166:93-108 180:27-42 206:17-32 213:17-32 229:17-31 233:17-32 538:27-42 538:57-71

ERROR in ./src/framework/UniversalTable/columnsMenu.ts
str.replace is not a function
 @ ./src/framework/UniversalTable/index.ts 10:0-50 189:41-58
 @ ./src/framework/SplitViewModule/index.ts
 @ ./src/modules/las_mod_siheader/index.ts 16:0-79 45:36-51 106:27-41 140:27-42 149:27-41 154:32-47 166:93-108 180:27-42 206:17-32 213:17-32 229:17-31 233:17-32 538:27-42 538:57-71

Could you add stats.errorDetails: true or stats.errorStack: true to get a stack trace?

@sokra Does this help
ERROR in ./src/framework/SplitViewModule/configuration.ts
str.replace is not a function
TypeError: str.replace is not a function
    at quoteMeta (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/util/compileBooleanMatcher.js:9:13)
    at Function.from (<anonymous>)
    at itemsToRegexp (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/util/compileBooleanMatcher.js:195:49)
    at Function.compileBooleanMatcherFromLists [as fromLists] (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/util/compileBooleanMatcher.js:41:25)
    at RuntimeTemplate.runtimeConditionExpression (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/RuntimeTemplate.js:592:32)
    at RuntimeTemplate.importStatement (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/RuntimeTemplate.js:625:28)
    at HarmonyImportSpecifierDependency.getImportStatement (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:90:26)
    at HarmonyImportSpecifierDependencyTemplate.apply (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:290:31)
    at HarmonyImportSpecifierDependencyTemplate.apply (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:298:10)
    at JavascriptGenerator.sourceDependency (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/javascript/JavascriptGenerator.js:203:12)
    at JavascriptGenerator.sourceModule (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/javascript/JavascriptGenerator.js:112:9)
    at JavascriptGenerator.generate (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/javascript/JavascriptGenerator.js:98:8)
    at NormalModule.codeGeneration (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/NormalModule.js:924:22)
    at /Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/Compilation.js:2147:24
    at /Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/CacheFacade.js:51:43
    at /Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/webpack/lib/Cache.js:93:5
 @ ./src/framework/SplitViewModule/index.ts 9:0-56 104:22-43
 @ ./src/modules/las_mod_user/index.ts 21:0-79 40:32-47 134:21-36 135:21-36 138:21-35 141:21-36 187:96-110 188:27-41 283:17-32 293:17-32 323:17-31 327:17-32

Yep, thanks that helped. I updated the PR with a fix for that and a few other fixes I discovered. If you have some time it would be cool to test the PR again. If it works for you, I would publish a new webpack version for this.

@sokra I'm working on it ...

I have now tested the update PR and the TypeError: str.replace is not a function have disappeared but unfortunately the generated bundle does still not run. Interestingly the bundle did work before when using the optimization.sideEffects: false option but now also fails with this option.
The error stack looks like this:

The actual code where the error is reported looks like this:

Is there anything I can do to help?

In my case the error I used to get due to the common chunk seems to be fixed.

@doberkofler did you try using innerGraph: false as a workaround? That is how I worked around the issue in my repo and it seems to be better than completely turning off sideEffects - at least compared to webpack 4 there wouldn't be a loss of optimizations.

I have also tried innerGraph: false but it still generated a bundle does not run. Maybe I'm hitting a different bug?

@doberkofler yep, maybe... Can you provide example of code or reproducible repo or maybe you can simplify to provide simple example

@evilebottnawi As I wrote something must have changed in this PR because now the optimization.sideEffects: false workaround is no longer working as well. I would love to provide a simple example but unfortunately most of my problem only appear in one of my very large production environments. Do the errors I get indicate anything that might help you to identify what goes wrong or help me to understand how to create a simple example ?

Could you disable source map and look at the extends UiElement code (the generated code)?

The line itself looks like this
class UiElementFile extends (/* unused pure expression or super */ 7324 == __webpack_require__.j && (UiElement_UiElement)) {

Yep that's what I through. Ill fix it...

... fortunately I don't need to understand ;-)

@doberkofler ok fixed. Could you try once again?

@sokra I had to reinstall all modules after completely removing my node_modules directory and the package-lock.json file before seeing any difference but unfortunately I now get a different error.

in this line
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);

Is there anything else I can do to help ?

Ok. So the extends UiElement is fixed and this is another one...
You could add optimization: { minimize: false, moduleIds: "named" } to the config to get better stack traces. Interesting would be the location of the bundle where the __webpack_require__ is called. (here: at Object.47916, but it's different with the different settings)

Maybe I add a little explanation why this issue is so complex:
Since webpack 5 webpack optimizes used exports per entrypoint. So if entrypoint A uses export X of module M and entrypoint B uses export Y of module M, then webpack will optimize the graph for each entrypoint separately. This means if export X of module M references module N, then module N will only be part of the graph of entrypoint A.
There will be two variants of module M: let's call them Mx and My. Mx only includes export X and references module N. My only includes export Y and doesn't reference module N.
This all works fine util Mx and My are merged into a single chunk (by a splitChunks configuration). Merging them makes sense in some cases, e. g. to reduce duplication and improve long term caching.
Currently webpack merges the variants into a combined variant Mxy which includes exports X and Y and references module N. The problem occurs when module N is not merged into the combined chunk, but kept somewhere else. In this case module N is only available in graph A and not in graph B. Executing Mxy in graph B fails, because module N is not available. This causes the Cannot read property 'call' of undefined error.
My PR adds the ability to generate code that executes differently depending on which is the current graph (called 'runtime' in webpack). So basically it generates code like if (graph == A) reference(N). This allows that module Mxy executes like Mx in graph A and like My in graph B. Such code is only generated for some pieces of code:

import { ... } from "side-effect-free-module": The module might be referenced or not.
const x = expression;: if expression is pure and x is only used by exports that are used or not.

We need to skip evaluation of expression as it might contain imported references.

class X extends expression: if expression is pure and X` is only used exports that are used or not.

Similar to above
It's a bit tricky as expression must only replaced with null since only null is a valid super class.

Ok. So the extends UiElement is fixed and this is another one...

I guess so

You could add optimization: { minimize: false, moduleIds: "named" } to the config to get better stack traces. Interesting would be the location of the bundle where the __webpack_require__ is called. (here: at Object.47916, but it's different with the different settings)

minimize: false was already set and i now also set moduleIds: "named" with the following results
this is the stack

at webpack_require (las_mod_dashboard.min.js?_=20.10.0:25879)
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
at Object../src/framework/ods/date.ts (vendors.min.js?_=20.10.0:195129)
var add = __webpack_require__("./node_modules/date-fns/esm/add/index.js");
at webpack_require (las_mod_dashboard.min.js?_=20.10.0:25879)
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
at Object../src/framework/uielement/private/UiElementInputDate.ts (vendors.min.js?_=20.10.0:204911)
/* harmony import */ var Source_ODS_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/framework/ods/date.ts");
...

Ok I think this is related to module concatentation, which doesn't seem to handle conditional imports correctly.
I guess if you add optimization.concatenateModule: false the error disappears?

I guess it was the concatenateModules option and yes, by disabling module concatenation the error disappears.

Maybe I add a little explanation why this issue is so complex:
Since webpack 5 webpack optimizes used exports per entrypoint. So if entrypoint A uses export X of module M and entrypoint B uses export Y of module M, then webpack will optimize the graph for each entrypoint separately. This means if export X of module M references module N, then module N will only be part of the graph of entrypoint A.
There will be two variants of module M: let's call them Mx and My. Mx only includes export X and references module N. My only includes export Y and doesn't reference module N.
This all works fine util Mx and My are merged into a single chunk (by a splitChunks configuration). Merging them makes sense in some cases, e. g. to reduce duplication and improve long term caching.
Currently webpack merges the variants into a combined variant Mxy which includes exports X and Y and references module N. The problem occurs when module N is not merged into the combined chunk, but kept somewhere else. In this case module N is only available in graph A and not in graph B. Executing Mxy in graph B fails, because module N is not available. This causes the Cannot read property 'call' of undefined error.
My PR adds the ability to generate code that executes differently depending on which is the current graph (called 'runtime' in webpack). So basically it generates code like if (graph == A) reference(N). This allows that module Mxy executes like Mx in graph A and like My in graph B. Such code is only generated for some pieces of code:

import { ... } from "side-effect-free-module": The module might be referenced or not.

const x = expression;: if expression is pure and x is only used by exports that are used or not.

We need to skip evaluation of expression as it might contain imported references.

class X extends expression: if expression is pure and X` is only used exports that are used or not.

Similar to above
It's a bit tricky as expression must only replaced with null since only null is a valid super class.

Thank you for the explanation that I most likely did not fully understand ;-)
It is quite stunning how complex a seemingly simple task like bundling can be and unfortunately most people are not aware of the complexity and just take the results as granted.
Thank you for your great work! (I'm happy to at least contribute a little)

I guess it was the concatenateModules option and yes, by disabling module concatenation the error disappears.

Great. I work on fixing that thing too...

It is quite stunning how complex a seemingly simple task like bundling can be and unfortunately most people are not aware of the complexity and just take the results as granted.

Most complexity doesn't come from a single feature. Most features along are pretty straight-forward. Most complexity comes from combining multiple features so that they play well together. This issue is a good example. It only occurs as a combination of:

Code Splitting and especially custom chunk merging via splitChunks
used exports analysis per runtime
side-effect-free modules
analysis of dependencies between top-level-symbols in modules
and now also: concatenation of modules

Great. I work on fixing that thing too...

Ok, this was a big one... Should be fixed now. Maybe you can try it again? Sorry for bothering you so often...

I had to reinstall all modules after completely removing my node_modules directory and the package-lock.json file before seeing any difference but unfortunately I now get a different error.

yeah npm and yarn doesn't really like if the version in package.json doesn't change.

Ok, this was a big one... Should be fixed now. Maybe you can try it again? Sorry for bothering you so often...

That's the least I can do without having provided a simple example.
I guess something it comes handy to have a huge and complicated production environment ;-)
I switched back to the original configuration and it works like a charm now.
Congratulations!

yeah npm and yarn doesn't really like if the version in package.json doesn't change.

The only way for me: removing the node_modules directory and the package-lock.json file.

I switched back to the original configuration and it works like a charm now.

great. released as 5.3.0

Thanks for all your testing and comments

You are welcome

I might have spoken too soon... With 5.3.0 still getting these same errors. Will now try to pinpoint what is the cause.

@Knagis Just an idea but I had to manually remove the node_modules directory and the package-lock.json file to successfully update to the new npm version.

@doberkofler I had the error from fresh CI build, so nothing cached is to be blamed.
@sokra The error I get now is due to:
// EXTERNAL MODULE: ./packages/path/SomeModule.ts
var SomeModule = __webpack_require__(null);

obviously moduleId null does not work... This module is one that is extracted into a common chunk as part of concatenated module with ID=784404 - an ID that is not referenced anywhere at all.
Should I report another issue or reopen this?

@Knagis let's open a new issue, I think this is a related problem, but not the same

authors: Knagis code1x1 doberkofler evilebottnawi sokra


text:
Webpack 5 persistent cache + EnvironmentPlugin: environment variables changing doesn't affect cache.

Bug report

What is the current behavior?
Webpack 5 persistent cache + EnvironmentPlugin: environment variables changing doesn't affect cache.
If the current behavior is a bug, please provide the steps to reproduce.

make webpack config with persistent cache and EnvironmentPlugin
build code, for example, with env variable TEST_VAR=1, output code will contain value 1
next build with TEST_VAR=2, output code will still contain value 1

What is the expected behavior?
Environment variable change will affect output code.

Other relevant information:
webpack version:  5
Node.js version: 12
Operating System:  macOS

changing something in webpack.config.js should invalid cache, you if do right setup, please provide example how you use it

changing something in webpack.config.js should invalid cache, you if do right setup, please provide example how you use it

@alexander-akait webpack.config.js doesn't changing, only values of environment variables which should passed to code.

@alexander-akait webpack.config.js doesn't changing, only values of environment variables which should passed to code.

How you pass variables to EnvironmentPlugin

How you pass variables to EnvironmentPlugin

@alexander-akait yes, only names with default values

@alexander-akait yes, only names with default values

We can't invalidate cache based on process.env, your cache will then become useless, in this case you need to use https://webpack.js.org/configuration/other-options/#cacheversion - version: JSON.stringify(envVariables)

We can't invalidate cache based on process.env, your cache will then become useless, in this case you need to use https://webpack.js.org/configuration/other-options/#cacheversion - version: JSON.stringify(envVariables)

@alexander-akait so that will invalidate whole cache, it's sad....

@alexander-akait so that will invalidate whole cache, it's sad....

Maybe you want this https://github.com/webpack/webpack/issues/10249?

Maybe you want this https://github.com/webpack/webpack/issues/10249?

EnvironmentPlugin uses DefinePlugin under the hood https://github.com/webpack/webpack/blob/master/lib/EnvironmentPlugin.js#L59

EnvironmentPlugin uses DefinePlugin under the hood https://github.com/webpack/webpack/blob/master/lib/EnvironmentPlugin.js#L59

@alexander-akait
so if i have
new webpack.EnvironmentPlugin({
  NODE_ENV: 'development',
  TENANT: null,
})

i should replace it with
new webpack.DefinePlugin({
  'process.env.NODE_ENV': JSON.stringify('development'),
  'process.env.TENANT': webpack.DefinePlugin.runtimeValue(() => process.env.TENANT),
})

or what?

@alexander-akait
so if i have
new webpack.EnvironmentPlugin({
  NODE_ENV: 'development',
  TENANT: null,
})

i should replace it with
new webpack.DefinePlugin({
  'process.env.NODE_ENV': JSON.stringify('development'),
  'process.env.TENANT': webpack.DefinePlugin.runtimeValue(() => process.env.TENANT),
})

or what?

No, you can still use EnvironmentPlugin, in the provided issue, changing something in options should invalidate modules where values used

No, you can still use EnvironmentPlugin, in the provided issue, changing something in options should invalidate modules where values used

@alexander-akait Sorry, doesn't see what you talking about. Can you please provide example?

@alexander-akait Sorry, doesn't see what you talking about. Can you please provide example?

When value (for example process.env.TENANT) changed, we should invalidate only modules where you use process.env.TENANT, not whole cache when you using cache.version, so we should track previously value of process.env.TENANT as described here https://github.com/webpack/webpack/issues/10249, I don't know how even easier to explain it

When value (for example process.env.TENANT) changed, we should invalidate only modules where you use process.env.TENANT, not whole cache when you using cache.version, so we should track previously value of process.env.TENANT as described here https://github.com/webpack/webpack/issues/10249, I don't know how even easier to explain it

so we should track previously value of

how we should track it?

so we should track previously value of

how we should track it?

It is not implemented yet, so https://github.com/webpack/webpack/issues/10249 has bug and enhancement, because for some developers it is bug, but in fact it is just limitation right now, but we can improve this

It is not implemented yet, so https://github.com/webpack/webpack/issues/10249 has bug and enhancement, because for some developers it is bug, but in fact it is just limitation right now, but we can improve this

@alexander-akait I thought I can turn it on somehow right now 🙂
Ok, thanks. Will wait this enhancement.

@alexander-akait I thought I can turn it on somehow right now 🙂
Ok, thanks. Will wait this enhancement.

Let's close in favor https://github.com/webpack/webpack/issues/10249 because duplicate, right now only one solution - cache.version

Let's close in favor https://github.com/webpack/webpack/issues/10249 because duplicate, right now only one solution - cache.version

authors: alexander-akait dangreen


text:
Initial styles are broken with lazyCompilation and style-loader

Bug report

The lazyCompilation experimental feature is very useful for multi-entry projects, the switch to webpack 5 did cause an overall slow down for cold builds and hot module reload times but I've been able to improve the situation with a bit of tuning.
This issue is kind of minor since reloading the page does fix the broken styles, but it's still a big enough issue that I'm going to have to continue using mini-css-extract-loader in development until this issue is resolved.
What is the current behavior?
At startup with lazyCompilation, it seems that styles from external styles, such as those loaded from a shared component library, are not being injected into the document. As mentioned, the styles do load successfully after reloading the page.
If the current behavior is a bug, please provide the steps to reproduce.
I'm using less, so the config looks like this:
  {
    test: /\.less$/,
    use: ["style-loader", "css-loader", "less-loader"],
  }

Use lazyCompilation:
 experiments: {
    lazyCompilation: true,
  },

Example entry point:
import React from "react";
import ReactDOM from "react-dom";
// Local component that has it's own stylesheet.
import Widget from "../components/Widget";
// Component from component library that also imports it's own stylesheet.
import SharedWidget from "shared-components/Widget";

const App = () => {
  return (
    <>
      {/* Styles work as expected */}
      <Widget />
      {/* Styles are not added to the document after the initial compilation. */}
      <SharedWidget />
    </>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

I'm actually using Suspense here with a lazy loaded App component but it doesn't seem to affect this issue.

Start webpack dev server
Load the entry point
Wait for the entry point to compile
Widget styles are added to the document, SharedWidget styles are not.
Refresh the page to fix the issue.

What is the expected behavior?
SharedWidget styles should be added to the document without having to manually reload the page.

Other relevant information:
webpack version:  ~5.45.0
Node.js version: 10, same on 14
Operating System: macos
Additional tools:
Some of the related dependencies:
// v5 claims not to be compatible with webpack 5 but we haven't been able to switch over yet
// due to some breaking changes. I get the same results on v7.
"less-loader": "^5.0.0",
"mini-css-extract-plugin": "1.3.6",
"css-loader": "^3.4.1",
"style-loader": "^2.0.0",
"esbuild-loader": "^2.13.0",

I can contribute

bump

Weird, can't reproduce with the later webpack version and style-loader, so I want to close, anyway feel free to feedback or open a new issue if you faced with this bug, thank you


text:
webpack -v does not report correct version number

I am running the latest version number as documented here on github.
5.51.1
It is installed locally.  When I run npm run webpack -v, however it reports the version as 6.14.4.
I expected it to report the version number I am using as 5.51.1.
Oddly, I see it is reporting the version of npm I am using.  I am not sure if this is an error or expected behavior.
This stack overflow article led me to believe I could pass command line options to webpack such as -v.
I have an npm script as follows in my package.json file, which gives me command line access to the local installation of webpack:
  "scripts": {
    "webpack": "webpack",

To pass -v to webpack you need to use npm run webpack -- -v,  otherwise npm will consider -v and print npm version instead of webpack which happened in your case.


text:
require.main is not supported

Bug report

What is the current behavior?
Webpack outputs require.main isn't required when in #64, it looks like support was added. When looking in the bundled code, Webpack replaces the statement with (void 0).

If the current behavior is a bug, please provide the steps to reproduce.

Create a file that uses require.main.
Compile it
See warning in webpack output
See (void 0) in bundled code

Webpack config: https://gist.github.com/TechStudent10/a53cb2007c052129fa505d794b8afadf

What is the expected behavior?
require.main shouldn't be compiled to (void 0), but rather Module (according to the NodeJS docs):

Other relevant information:
webpack version:  5.75.0
Node.js version: v19.1.0
Operating System: Windows 11 21H2
Additional tools:

You should set target: 'node' if you want to support it, for target: 'web' it is converted to void 0 for bakcward compatbility with some legacy code, feel free to feedback

You should set target: 'node' if you want to support it, for target: 'web' it is converted to void 0 for bakcward compatbility with some legacy code, feel free to feedback

I feel like this should be included in the error message, it is rather cryptic for such as simple fix.

@TechStudent10 we can't understand the target based on the code, but we can improve our documentation, feel free to send a PR, webpack mostly used for web applications so the default value of target is web

@TechStudent10 we can't understand the target based on the code, but we can improve our documentation, feel free to send a PR, webpack mostly used for web applications so the default value of target is web or browserslist

All I'm saying is that if the fix is so simple, you should add a warning whenever require.main is detected and the target isn't node. I'm not sure I understand your message.

@TechStudent10 I am about:
if (require.main) {
  // Logic for Node env
} else {
// Logic for non Node env
}

And it will be false positive and I can provide more cases for all Node stuff. Ideally - a linter can help to catch such things (mix node and browser code, but you can isomorphic application and it is normal to have such code), but it will not say about the target option for webpack, I would say that this is a small part of the knowledge that you should know.
I'm not opposed to warning improvements, but if you look at different applications you will find that they very often have use mixed of browser and node code to detect env and it will be very annoing for such developers. Feel free to feedback

I'm not opposed to warning improvements, but if you look at different applications you will find that they very often have use mixed of browser and node code to detect env and it will be very annoing for such developers. Feel free to feedback

Ah okay I think I get it now.


text:
dynamic import naming doesn't work

Do you want to request a feature or report a bug?
bug

What is the current behavior?
I used comment to define chunkname as follows:
import(/* webpackChunkName: "chunk1" */'@/components/chunk1.js')

But in build report there is no chunk name specified and still generate filename as 1.[hash].js
If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/MarvinXu/webpack-chunkname-test
npm install
npm run build

Try with an '='
import(/* webpackChunkName="chunk1" */'@/components/chunk1.js')

Try with an '='
import(/* webpackChunkName="chunk1" */'@/components/chunk1.js')

doesn't work.

Same problem.
I had to used webpack 1. The old api require.ensure works perfectly in webpack 1.

To be clear, I use the latest webpack(2.5.1) in my project. The require.ensure method works fine with the chunkname, it's just comment definition in import() doesn't work. I don't know where went wrong.
I added require.ensure test in my project:
https://github.com/MarvinXu/webpack-chunkname-test

I use this feature (2.5.1) and it works fine to me. The only difference is that I don't have the '@' inside the path of my dynamic module; instead I have a relative path.

@ematipico '@' is an alias for 'src', I've tested it is not relevant to this.

I also set an alias for path, so it fails here?

I have the same problem

It works for me without the @ - might be something with your setup.

I encountered this and it turned out I had to set output.chunkFilename in my webpack config

It works for me without the @ - might be something with your setup. (I'm on OS X, for reference.)

Did you test on my project? I removed alias '@' just now. Can you test it for me once more?

This is not related to Webpack as @MarvinXu is using vue-cli with webpack template to generate the project. This issue should be closed

Same problem. Does someone find the solution？

I also have this problem, does someone resolve this issue?

The problems were related to bad configuration inside the project. At the moment I am heavily using this feature and I don't have issues. What your problem? Care to share some code of how you use the import()?

This problem is caused by babel configuration comment: false in my project, babel removes the "magic comments" before it takes effect. Check .babelrc to see if you have similar configuration, set comment to true or simply remove it and it should work.
More details please see https://github.com/vuejs-templates/webpack/issues/730

Same issue. Was suspecting babel but even with my .babelrc with comments: true it won't work :(

Okay gotcha: I set output.filename to include [name] but forgot to configure output.chunkFilename to contain [name] 💡

I'm also having issues with webpackChunkName with a simple test project. I have chunkFilename and don't strip comments. It always generates a 0.bundle.js
module.exports = {
entry: './src/index.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js',
chunkFilename: '[name].bundle.js'
},
...
}
I feel so close! I'm simply separating the login page from the rest of the app.

@mikeaustin you know what.. one of my latest project which was working before out of suddenly started to output 0. 1. bundler names too!  it might be a bug with latest version of webpack.. try downgrading it a bit see if that works for you

Following @milewski,
This works, bundle is split
System.import(/* webpackChunkName: "OverviewComponent" */ './__tdm-code__.ts');

This does not, one bundle to all imports.
import(/* webpackChunkName: "OverviewComponent" */ './__tdm-code__.ts');

The issue seems' to be in import() only

This is weird because ImportPlugin does the same thing for System.import and import-call so I'm confused...
For now i'm just using System.import, which will be easy to port once I move to Webpack 4, I hope it's fixed there.

It's very odd so, on typescript and webpack with module esnext dynamic import is worked, and on just JavaScript and webpack dynamic import is not worked , with babel-plugin-dynamic-import too

@shlomiassaf r u using Typescript when you write
System.import(/* webpackChunkName: "OverviewComponent" */ './__tdm-code__.ts');
``` ?

System.import and import are different.
In my TypeScript+Webpack case, { "module": "commonjs" } caused the problem. It worked fine on "es5" and "esnext".

To sum up, make sure you set:

comments: true in .babalrc (this is the default)
chunkFilename: '[name].....' in your webpack config

If you are using typescript, also make sure:

removeComments: false under compilerOptions in tsconfig.json
module: esnext in tsconfig.json

This works for me and here is my commit for adding dynamic import (code split) support to my react-typescript project, hope it helps :)

In case anyone else runs into this issue. I was using new webpack.optimize.UglifyJsPlugin and in that config I had output: { comments: 0 } and by changing it to 1 fixed it.

@Armour's last comment worked for me, but note that [you may need to also add `"moduleResolution": "node"](https://github.com/Microsoft/TypeScript/issues/16820#issuecomment-312033871) to preserve the module resolution approach that `"module": "commonjs"` provides.

Can you make it just dynamically import a file just purely based on the text string and do the chunking yourself instead of having webpack mangle the names for you?

Still not working with import(). Works only with System.import() for me. But its deprecated?!? :-/
(chunkFilename is set)
System.import(/* webpackChunkName="chunk1" '../components/chunk1.js')

I am also facing trouble with just import instead System.import is working for dynamic imports.

authors: 6220119 Armour BlackGlory MarvinXu SilenY a573367014 adjenks axe312ger devinRex ematipico ericbiewener jhernandez5922 js2me lihaoqi1991 maelon mikeaustin milewski mzahidriaz probablyup rphl shlomiassaf stevewillard


text:
webpack-cli doesn't execute

Do you want to request a feature or report a bug?
bug

What is the current behavior?
webpack doesn't execute and doesn't show any errors. After a while there comes an fatal memory error.
If the current behavior is a bug, please provide the steps to reproduce.
I just installed webpack (npm i -D webpack) without the cli.
It's the version 4.6.0. After I was setting up my typescript pack, i wanted to run npx webpack. For sure I had to install the webpack-cli, the cl asked me if I want to fix it. I did what the cl wanted.
The cl installed the webpack-cli 2.1.0, and I believe that is wrong.
With the webpack-cli 2.1.0 and the webpack 4.6.0 nothing happen after I run npx webpack (see below). After upgrading to the webpack-cli 2.1.2 everything works fine.

What is the expected behavior?
The cl should install the right version.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
windows 10, npm 5.6.0

@TobiasBaumgarten webpack-cli 2.1.0  was broken. Also it is related to webpack-cli. We release new very light and fast CLI https://github.com/webpack-contrib/webpack-command. Feel free to try it first. Thanks!

@evilebottnawi What is the distinction between both CLI, it seems that this is going to confuse our users a lot.


text:
How to use webpack loader to convert *.{jpe?g|png|gif} as a react component

I want to load file type *.{jpe?g|png|gif} into react components, as does https://github.com/smooth-code/svgr/tree/master/packages/webpack for svg files.
This will be used with https://react-styleguidist.js.org/ which can render React component to build HTML documentation for showing assets static without having to write a bunch of code or to know JS.
I have tried using image-webpack-loader 4.5.0 to do the following loader :
function imgLoader(source) {
  return '';
  // return React.createElement('img', { src: source });
};

module.exports = {
  default: imgLoader,
};

It is configured with Webpack 4 as follow:
rules: [
        {
          test: /\.svg$/,
          use: ['@svgr/webpack'],
        },
        {
          test: /\.(gif|png|jpe?g)$/i,
          use: [
            'file-loader',
            {
              loader: 'image-webpack-loader',
              options: {
                disable: true, // webpack@2.x and newer
              },
            },
            {
              loader: path.resolve(__dirname, './loader/loader.js'),
            }
          ],
        }
      ],

For some reason, that does not work.
I may have misunderstood how to use loaders.
It is definitely not converted in React component. I want to avoid having to write  when importing .jpg|png|gif, I want instead to have the following component (props = {}) =>
any idea ?

This is a usage question, and we encourage you to ask it on StackOverflow instead. We try to use the issue tracker for bug reports and feature requests, as well as some discussions, but this appears to be a very localized question.
This is the only way to ensure the same question doesn’t get asked many times in a row, and that folks who have the same question in the future will be able to find it.
I’m closing for these reasons.

Dear @ooflorent , I have posted on stackoverflow and unfortunately, they say Webpack can't do that:
https://stackoverflow.com/questions/53249705/how-to-use-webpack-loader-to-convert-jpegpnggif-as-react-component-props/53252392?noredirect=1#comment93405379_53252392
I am not sure if it's true through, could you please tell?
Regards

authors: kopax ooflorent


text:
Knip doesn't parse arguments of yarn run --top-level correctly

Reproduction url
Sandbox
Description of the issue
In a monorepo setting, a workspace script invoking a top-level script which takes positional parameters gets these parameters incorrectly interpreted as scripts (and reported) by knip

Top-level package.json:
"scripts": {
    "echo": "echo"
  },

Here, the echo script just calls the echo shell command, which takes extra parameters on the command line.
Workspace (packages/shared) package.json:
"scripts": {
    "foo": "yarn run --top-level echo hello"
  }

This uses the --top-level flag which seems to not exist in yarn 1. It simply calls the top-level script, providing a parameter to it.
When running (from the toplevel) yarn workspace @monorepo/shared run foo, or (from the workspace directory) yarn foo, I get the correct behaviour (display hello in the terminal).
When running yarn knip, I get:
Unlisted binaries (2)
...
hello  packages/shared/package.json

So, it seems that knip is interpreting the command as running echo and hello scripts.
Adding a hello script inside the package does remove the reporting. Adding one at toplevel doesn't.
This may be related to https://github.com/webpro-nl/knip/issues/735 but I believe it is different.

I was not able to reproduce this in a basic (single workspace) setting; Without the --top-level option (and using an echo script in the workspace), hello is not reported, so the option may have something to do with it.
Somehow, removing the echo script from the top-level is not reported. Maybe knip interpretes yarn run --top-level echo hello as being an option --top-level echo and calling script hello (instead of option --top-level and calling script echo with parameter hello).

This may be related to #735 but I believe it is different.

Why do you think it's different?

#735 (and the linked #433) seemed related to Github action on first read.
Looking more, #735 may have something to do with parsing CLI arguments, but there knip correctly detects the script name, and incorrectly doesn't find it (as it looks in the wrong directory). Here, knip incorrectly detects the script name, and ("correctly") reports it as missing (that script indeed does not exist).
But indeed, they may both boil down to the fact that --foo bar is effectively discarded while in both cases (--cwd, --top-level) it actually has a meaning that should impact knip behaviour.

Doing some refactoring that unlocks features like this. In the next version, Knip will support --top-level and --cwd [dir] for Yarn commands. You could try an early version if you like:
yarn add -D https://pkg.pr.new/knip@f1349c2

Going to close with the release of v5.34.0

repo: webpro-nl/knip

license: ISC


text:
Support for components testing in playwright plugin

Playwright now supports component testing which uses a different config + dependencies: https://playwright.dev/docs/test-components

Thanks @jgoux, looks like a good addition. Any chance you could add some fixtures and test coverage for this?

Added fixtures and generated the docs. 👍

Looked into their docs a bit, what do you think about splitting this up in a separate plugin (e.g. playwright-ct)?
I say this, because when I run npm init playwright@latest -- --ct I only get @playwright/experimental-ct-react so the ENABLESRS are also separate dependencies? Didn't actually use CT before, so I'm not sure :)

Looked into their docs a bit, what do you think about splitting this up in a separate plugin (e.g. playwright-ct)?
I say this, because when I run npm init playwright@latest -- --ct I only get @playwright/experimental-ct-react so the ENABLERS are also separate dependencies? Didn't actually use CT before, so I'm not sure :)

It's pretty new to me as well, I tested removing @playwright/test and indeed it works with only @playwright/experimental-ct-*. I'll make the changes to split it into a new plugin. 👍

The feature is now isolated into its own playwright-ct plugin, and the CI is ✅, I guess it's ready for review @webpro. 😄

Awesome! Thanks for this, great addition

:rocket: This pull request is included in v2.27.0. See Release 2.27.0 for release notes.

authors: jgoux webpro

repo: webpro/knip


text:
(Self hosted) Cloud Storage issue

Running version 0.0.5 in Docker. Everything works except linking to Dropbox. Getting this error message: "This WebRcade Server is not authorized to access Dropbox."
Is there a fix for this?
Thanks in advance.

Unfortunately, Dropbox is not compatible with local hosting of webrcade (Docker, etc.).
In the future I plan on adding a local Dropbox equivalent that runs on the Docker image itself.

Another option that would be simpler in the short term would be to provide instructions for users to configure their own "webrcade app" in Dropbox.

Hi, would be really great if you could provide those instructions. Thanks!

It will require some tweaks, but shouldn’t be too bad. I will try to put something together in the next couple of days.

Really appreciate it, thank you!

@marcb199 do you still need help with this issue?

Hi, yes! Any help setting this up would be great.

Install with Docker
The fastest way to get up and running is via the Docker container.
After you have docker installed on either Linux or Windows, do one of the follow:
Install via docker cli:
docker run -rm \
  --name=webrcade \
  -p 80:80 \
  -v /path/to/content:/var/www/html/content \
  --restart unless-stopped \
  webrcade/webrcade:latest

or deploy with docker-compose:
version: "3"
services:
  webrcade:
    image: webrcade/webrcade:latest
    container_name: webrcade
    volumes:
      - /path/to/content:/var/www/html/content # Docker for Windows use "/c/path/to/content"
    ports:
      - 80:80
    restart: unless-stopped

Setup
The /path/to/content location will be accessible to the webRcade server so it can host your games and feeds locally.
Its recommended to have your ROMs in their own system folder structure:
Example File Structure
- nes/Super Mario Bros. (U).nes (or .zip)
- gba/Sonic Advance (U).gba (or .zip)
- myfeed.json

When setting up games/feeds with the editor, use the following example URLs:
Example URLs
- /content/nes/Super Mario Bros. (U).nes
- /content/gba/Sonic Advance (U).gba
- /content/myfeed.json

@marcb199 If this works out for you, please close the ticket.

Always remember that, being a product in early development, things may change in the future. Checkout the release notes for any new changes.

I discovered WebЯcade recently and started adding it to my self-hosted stack today and stumbled across this issue. Having a quick look at the code, the Dropbox account settings appear to be hardcoded in webrcade/webrcade-app-common. I'm not sure of the best way to make this configurable (as a PR) as it gets built into several bundles. One approach may be to:

add a config.json file which defaults to an empty object ({}) in the dist bundle and can be overridden by docker users
read the config into window.globals.config when the webpage is requested
modify the implementation of storage/cloud/dropbox/index.js to use values from window.globals.config and default to the static properties already defined in the file if they do not exist

For now, to test that this may be all that is required, I've modified the start-up command of my container and can confirm that saving and loading states works. This requires creating a new Scoped App (App Folder) in Dropbox and assigning it the correct scopes. I'm not sure what scopes are required but have selected: files.metadata.write, files.metadata.read, files.content.write, files.content.read. I've also set the OAuth 2 Redirect URIs but do not know if this step is required:

https://play.mydomain.com/dropbox/
https://play.mydomain.com/app/editor/dropbox/
https://play.mydomain.com/app/standalone/dropbox/

I'm using traefik as a reverse proxy and coincidentally was already using subpath rewriting so that accessing my host by play.mydomain.com displays the /play subpath. However, the redirect back from Dropbox expects /play in the url path so I've added an additional rule to redirect to the non /play path.
My service definition is as below (note that I'm using an M1 MacBook, defining platform and modifying /etc/apache2/apache2.conf shouldn't be needed on linux/amd64 platforms which is what I imagine most people will be using):
---
services:
  webrcade:
    image: webrcade/webrcade
    platform: linux/amd64
    labels:
      - traefik.enable=true
      - traefik.http.middlewares.webrcade-play-redirect.redirectRegex.regex=^(https?://[^/]+)/play\b(.*)$$
      - traefik.http.middlewares.webrcade-play-redirect.redirectRegex.replacement=$${1}$${2}
      - traefik.http.middlewares.webrcade-play-prefix.addPrefix.prefix=/play
      - traefik.http.routers.webrcade.middlewares=webrcade-play-redirect,webrcade-play-prefix
      - traefik.http.routers.webrcade.rule=HostRegexp(`play.mydomain.com`)
      - traefik.http.services.webrcade.loadBalancer.server.port=80
    environment:
      - HTTP_HOST=play.mydomain.com
      - WEBRCADE_DROPBOX_APP_KEY=changeme
    entrypoint: /bin/sh
    command:
      - -c
      - |-
        find /var/www/html -type f -name '*.js' -or -type f -name '*.js.map' \
          | xargs grep -l 'play.webrcade.com' \
          | xargs sed -i "s/play.webrcade.com/$$HTTP_HOST/g"
        find /var/www/html -type f -name '*.js' -or -type f -name '*.js.map' \
          | xargs grep -l 'xvz6ybh9wta2u30' \
          | xargs sed -i "s/xvz6ybh9wta2u30/$$WEBRCADE_DROPBOX_CLIENT_ID/g"
        if ! grep -qE '^Mutex' /etc/apache2/apache2.conf; then
          echo "Mutex posixsem" >>/etc/apache2/apache2.conf
        fi
        exec /usr/local/bin/docker-php-entrypoint /home/start.sh "$@"
    volumes:
      - ./config/webrcade/content:/var/www/html/content
    restart: unless-stopped

In summary, a hack/workaround is to replace the hardcoded redirect uris and app key on container start.

Great, thanks a lot for the feedback! I am actively working to get a new build out this upcoming week that includes some changes to Docker (specifically an ARM64 image). I don't think I will be able to integrate your changes this round, but I can prioritize for the next update.
I never really anticipated anyone else using Dropbox for saves for local deployments, but I can add the customization hooks similar to how you have described to allow for it.
Thanks again for the contribution!

Hitting the same problem but I'd like to know if there's a better way to solve this for self-hosted scenario. Maybe adding the possibility of storing saved state directly on the server (e.g. upload to the server, webdav, minio, or another storage api)? I guess this is connected to your comment:

Unfortunately, Dropbox is not compatible with local hosting of webrcade (Docker, etc.).
In the future I plan on adding a local Dropbox equivalent that runs on the Docker image itself.

Yeah, in the future, we will add the ability to either use Docker as the host (but will require a bit of work on your end). Or, just integrate a completely different storage option into the Docker image (this would be my preference).

Picking up on this. I am interested in self-hosting and added some of my findings in here. This seems to be right place to discuss.
In short:

Ability to load read-only files from local volumes.
Automatically generate a feed from a local directory.
Work with a non-root user. I am somewhat "new" to permissions and docker, so I am not entirely sure. I can tell we might need to create a separate volume to store logs where the user can write into.
Ability to use a reverse proxy (i.e. define a BASE_URL).

The pattern I am trying to use:
version: "3.8"

services:
  # https://github.com/webrcade/webrcade/issues/7#issuecomment-1314400463. Exposes port 80.
  webrcade:
    image: webrcade/webrcade:latest
    container_name: webrcade
    hostname: webrcade
    # user: "${PUID}:${PGID}" # Does not work as it cannot write to logs!
    volumes:
      - "./config:/var/www/html/content"
      - "${GAMING_ROMS_DIR}/gba:/var/www/html/content/gba:ro" # read-only intentionlly
    restart: unless-stopped
    networks:
      - webrcade

networks:
  webrcade:
    name: webrcade

authors: KingIzzymon andrewmackrodt bphenriques marcb199 nopper raz0red

repo: webrcade/webrcade


text:
WSIO-755 Fix swapping column issue

Description

Motivation and Context

Screenshots (if appropriate)
Upgrade notes (if appropriate)

Types of changes

[X] Bug fix (non-breaking change which fixes an issue) labeled with bug
[ ] New feature (non-breaking change which adds functionality) labeled with enhancement
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[ ] My code follows the code standards of this project.
[ ] My change requires updating the documentation. I have updated the documentation accordingly.

I have read the Dynamic Solutions Individual Contributor License Agreement (CLA) Document and I hereby sign the CLA

repo: websight-io/starter


text:
Using eqs on EnumColumn

Hi, @alexflav23.
Found out that I can't use eqs in where on enum columns, declared using EnumColumn. This is due to implicit mechanism requiring Primitive typeclass instance for query columns.
For now to resolve the problem I declared the following generic helper:
import com.websudos.phantom.builder.primitives.Primitive
import com.websudos.phantom.builder.syntax.CQLSyntax
import com.websudos.phantom.dsl._

import scala.util.Try

class EnumIsPrimitive[E <: Enumeration](enum: E) extends Primitive[E#Value] {

  override type PrimitiveType = String

  override def cassandraType: String = CQLSyntax.Types.Text

  override def fromRow(column: String, row: Row): Try[E#Value] = nullCheck(column, row) {
    r => enum.withName(r.getString(column))
  }

  override def asCql(value: E#Value): String = "'" + value.toString + "'"

  override def fromString(value: String): E#Value = enum.withName(value)

  override def clz: Class[String] = classOf[String]

}

and use it like this in model definition:
implicit val LanguageIsPrimitive: Primitive[Language] = new EnumIsPrimitive(Language)
object language extends EnumColumn(this, Language) with PartitionKey[Language]

Am I missing something obvious, or is it the way to go?

Hi @Tvaroh ,
There is already a helper for this, namely enumToQueryConditionPrimitive available in the default import: import com.websudos.phantom.dsl._.

repo: websudos/phantom


text:
Update setup script to download WebUI Github releases

Closes #59
Currently it uses WebUIs nightly releases.
Eventually (for the 2.4.0 release), it will be updated to to download the stable releases by default and optionally nightly releases.
@hassandraga we could make this into a repo (something like webui-release-downloader). It could have its own binary GitHub releases and work as CLI tool that other wrappers could download and use to download and prepare the WebUI static files for different platforms. It would help to keep things uniform. I would make the webui destination dir configurable via an argument then.

That is a good idea, but I still need clarification about how other wrappers could download the pre-built binaries. Can you explain, please?

Yep, I'll add a short explanation. It also should be possible to just attach it here or give a short instruction if you prefer to have it self compiled, then its possible to test how it would work. Maybe even creating the repo as private at first, then testing is the full experience :D
Gonna catch some sleep and do some work before. Hear you later 👍

Lets test it here https://github.com/webui-dev/webui-release-downloader

We can already move towards using the pre-builts here. If and how to use a release-downloader for other wrappers we can decide over at the test repo 🙂👍.

authors: hassandraga ttytm

repo: webui-dev/v-webui


text:
Is WebSocket supported or not?

Hello. Is WebSocket supported or not?
I was trying to start ws connection but the app doesn't connect. Everything works in Chrome, Firefox, Midori.

CONSOLE NETWORK ERROR WebSocket connection to 'ws://localhost:21652/my-roomname' failed: The server did not accept the WebSocket handshake.

There's no special support for WebSocket in the core library but there's also to my knowledge nothing in the core library that hinders the underlying browser engine from supporting WebSocket.
Which backend/platform are you using?

Never mind, I tested WebSocket now with pure echo WebServer and a minimal HTML page and it works.
(Actually, I did two such tests with different servers (Python, node.js) and different clients.)
So the problem is with my application. (After some digging I found the error.)
Sorry for the noise, and thank you for your great work!)

Never mind, I tested WebSocket now with pure echo WebServer and a minimal HTML page and it works.
(Actually, I did two such tests with different servers (Python, node.js) and different clients.)
So the problem is with my application. (After some digging I found the error.)
Sorry for the noise, and thank you for your great work!)

authors: SteffenL shitpoet

repo: webview/webview


text:
🛑 DragonBoat Times is down

In f3e8b6f, DragonBoat Times (https://www.dragonboattimes.com) was down:

HTTP code: 521
Response time: 146 ms

Resolved: DragonBoat Times is back up in 708a7fc after 423 days, 41 minutes.

repo: webworldview/uptime


text:
🛑 Prime Life Women is down

In 17a3d81, Prime Life Women (https://primelifewomen.com) was down:

HTTP code: 521
Response time: 202 ms

Resolved: Prime Life Women is back up in 269f876.


text:
建议增加editorconfig文件统一代码格式化规则

由于本项目的缩进方式可能和别的项目方式不同,建议增加editorconfig文件适配本项目的格式化格式.
IntelliJ IDEA默认支持,Eclipse可以使用插件支持
别的项目中的一个例子
# EditorConfig: http://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{java,py}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

好主意，方便的话你可以帮忙设置添加下吧

ok 已提交pr

多谢~

authors: binarywang kakotor

repo: wechat-group/weixin-java-tools


text:
【问题】SDK所使用的默认签名方法是什么？

错误描述
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6
（公众号调用JSAPI支付文档）
当中需要使用和prepay接口一样的签名算法，我使用MD5的方式，提示“支付签名验证失败”。
我想知道SDK内部默认的签名方法是什么。
重现bug的步骤
1、后端代码生成 prepayId，可以正常生成并返回。
/**
 * 微信收银
 * @return
 */
public PrepayResponse getPayUrl(int amountParam,String desc,String notifyUrl,String orderId,String openId){
    PrepayRequest request = new PrepayRequest();
    Amount amount = new Amount();
    amount.setTotal(amountParam);
    request.setAmount(amount);
    request.setAppid(weixinConfigure.getAppId());
    request.setMchid(weixinConfigure.getMerchantId());
    request.setDescription(desc);
    request.setNotifyUrl(notifyUrl);
    request.setOutTradeNo(orderId);
    Payer payer = new Payer();
    payer.setOpenid(openId);
    request.setPayer(payer);
    PrepayResponse response = service.prepay(request);
    return response;
}

2、前端通过 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6
（公众号调用JSAPI支付文档） 进行调用支付提示 “支付签名验证失败”
							let param = {
									"appId": orderResult.data.weixinJsSignVO.appId,
									"timeStamp": orderResult.data.weixinJsSignVO.timestamp,
									"nonceStr": orderResult.data.weixinJsSignVO.nonceStr,
									"package": "prepay_id=" + orderResult.data.payUrl,
									"signType": "MD5", //微信签名方式：
									"paySign": orderResult.data.weixinJsSignVO.signature
								};
							WeixinJSBridge.invoke(
								'getBrandWCPayRequest', param,
								function(res) {
									console.log(res)
									if (res.err_msg == "get_brand_wcpay_request:ok") {
										// 使用以上方式判断前端返回,微信团队郑重提示：
										//res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
									}
								});

生成的签名和在线签名校验工具一致，但提示 “付签名验证失败”
预期行为
希望能够正常出现支付页面
导致错误的代码片段
let param = {
									"appId": orderResult.data.weixinJsSignVO.appId,
									"timeStamp": orderResult.data.weixinJsSignVO.timestamp,
									"nonceStr": orderResult.data.weixinJsSignVO.nonceStr,
									"package": "prepay_id=" + orderResult.data.payUrl,
									"signType": "MD5", //微信签名方式：
									"paySign": orderResult.data.weixinJsSignVO.signature
								};
							WeixinJSBridge.invoke(
								'getBrandWCPayRequest', param,
								function(res) {
									console.log(res)
									if (res.err_msg == "get_brand_wcpay_request:ok") {
										// 使用以上方式判断前端返回,微信团队郑重提示：
										//res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
									}
								});

操作系统
windows
Java 版本
java 8
wechatpay-java 版本
v0.2.5
其他信息
No response

前端提交的签名信息

SDK 支持使用 RSA/国密 的微信支付 APIv3，不支持过去 MD5/HMAC 的API
调起支付签名请参考 下单并生成调起支付的参数


text:
weex debug

Makes sure these boxes are checked befor submitting your issue - thank you!

[] Check that your node version is >= 6 and npm version is >=5(Run npm --version and node --version).
[] If you encounter any problems using the tool, please check if there has a new version to update(Run weex update [pluginname]@latest).
[] Check the FAQ, make sure there have not the same issue.

Your development environment

weex-toolkit verison (Run weex -v)
platform (Win/Mac/Ubuntu..)

The key error stack message.
Steps to reproduce the problem.(Maybe a dotwe link,)

node 8.12.0   npm  6.5.0  weex   2.0.0-beta.24(core 2.0.0-beta.23)   weex debug 启动之后 不动几分钟之后会自动断线  地址直接变成http://192.168.0.71:8089/    page提示There is no preview page yet, you can compile the page with the following command

repo: weexteam/weex-toolkit

license: mit

license_source: bigquery


text:
Fixed-weight EEXE simulations should have the choice to be initiated by different sets of weights for different replicas

In the current implementation, the weights of EXE replicas in a fixed-weight EEXE simulation are initialized from the same set of weights defined in the template MDP file. For example, say that the weights corresponding to the full alchemical path that covers 4 states include 0, 0.5, 1.5, and 3.5. Then for the first replica that spans 3 states, the weights would be 0, 0.5, and 1.5, and those for the second replica would be 0, 1.0, 3.0 (after shifting the weight of the first state to 0).
However, the user should have the choice to have different sets of weights for states in different replicas. For example, one could have 0., 0.5, and 1.5 for the first replica, but have 0, 0.5, 3.0 for the second replica (instead of 0, 1.0, 3.0). This could be useful for, but not limited to EEXE simulations for multiple serial mutations and can possibly be done by inputting multiple MDP files or specifying the list of weights in the YAML file.
This issue is a part of the work in the project EEXE for serial mutations.

We later decided to implement the feature by allowing specifying multiple MDP files, one for each replica, so the user can, for example, specifies different alchemical paths and the corresponding weights for different mutations. This way of implementing the feature would allow higher flexibility, especially when one wants to use the ensemble_md package to perform simulation replicas with different general MD parameters (parameters other than just lambda values or the weights).

The feature has been implemented in commit b5301c7.


text:
Error: Cannot call method 'forEach' of undefined

I see this error every once in a while in my logs. It would be nice if it threw a more helpful error instead.
Cannot call method 'forEach' of undefined
    GoogleContacts.GoogleContacts._saveContactsFromFeed in /app/node_modules/google-contacts-api/index.js:211
    Object.receivedContacts in /app/node_modules/google-contacts-api/index.js:105
    IncomingMessage.[anonymous] in /app/node_modules/google-contacts-api/index.js:76

@FredKSchott any steps to reproduce?

same error, but only for some users

authors: FredKSchott somename85 weisjohn

repo: weisjohn/google-contacts-api


text:
Add support for MySql

This one should be quite easy:

[ ] Add corresponding feature flags to the wundergraph_derive, wundergraph and wundergraph_cli crate
[ ] Generate an impl for LoadingHandler for diesel::mysql::Mysql in wundergraph_derive/src/wundergraph_entity.rs
[ ] Generate an impl for WundergraphBelongsTo for diesel::mysql::Mysql in wundergraph_derive/src/belonging_to.rs
[ ] Generate an impl for BuildFilterHelper for diesel::mysql::Mysql in wundergraph_derive/src/build_filter_helper.rs
[ ] Implement HandleInsert and HandleBatchInsert for diesel::mysql::Mysql in wundergraph/src/query_builder/mutations/insert
[ ] Implement ApplyOffset for diesel::mysql::Mysql in wundergraph/src/query_builder/selection/offset.rs
[ ] See if you get at least wundergraph_example running with the mysql backend. This includes porting the SQL migrations here to the MySQL dialect.

@weiznich, I finished all the steps except following one easily.

[  ]  Implement HandleInsert and HandleBatchInsert for diesel::mysql::Mysql in wundergraph/src/query_builder/mutations/insert

Without possibility to get id of inserted item, which mysql/mariadb offers by mysql_insert_id I can hardly implement handle_insert and handle_batch_insert reliably.
Sure, it is possible to implement both methods in style of Sqlite
https://github.com/weiznich/wundergraph/blob/b0cf967c7579b0936f990fcfcdc2be3e109ae0c7/wundergraph/src/query_builder/mutations/insert/sqlite.rs#L55
but I rather reluctant to do that. In my opinion it would be good to do an amendment in diesel crate to support in guide described get_result approach, which implemented for PostgreSQL back end only.
For instance DBIc::Class::ResultSet->create uses  mysql_insert_id (over DBD::mysql) to return a complete entry on insert. I'm deeply missing this feature in diesel.

First of all a big thanks for working on this.It's great to see that this is done 👍

Without possibility to get id of inserted item, which mysql/mariadb offers by mysql_insert_id I can hardly implement handle_insert and handle_batch_insert reliably.
Sure, it is possible to implement both methods in style of Sqlite
but I rather reluctant to do that. In my opinion it would be good to do an amendment in diesel crate to support in guide described get_result approach, which implemented for PostgreSQL back end only.

This situation is quite unfortunate, as neither SQlite nor MySQL do provide a reliable way to get back the inserted (or updated) column in such queries. The following statement more or less describes the reasoning on diesel side: There is LAST_INSERT_ID() which returns the last inserted id for a given statement, but as far as I'm aware that function can have issues if there are multiple concurrent inserts involved. So that's no general solution. The next best thing that someone can do is the order + limit hack done in the SQLITE backend. This isn't much nicer but coupled with an transaction this should at least return reliable results, while it communicates the general tradeof much clearer. As both solutions have their short comings and restrictions the diesel team has decided to not hack some solution together that only works most of the time reliably, but make this an explicit user decision (especially as this involves transactions which are potential blocking/expensive/…).
On the other hand PostgreSQL does support RETURNING clauses which basically allows you to return an arbitrary select like clause from your insert statement. Those are used to implement get_results() and co via a single query for PostgreSQL. As far as I'm aware neither Sqlite nor Mysql do support a similar concept. (It is interesting that MariaDB does support returning clauses since a few versions. Some changes like this are basically the reason why I would like to see a distinct backend for MariaDB in diesel itself, as we could then add support for such constructs there.)

There is LAST_INSERT_ID() which returns the last inserted id for a given statement, but as far as I'm aware that function can have issues if there are multiple concurrent inserts involved.

Indeed, LAST_INSERT_ID() is SQL equivalent to API function mysql_insert_id. Well, it's not the same what PostgreSQL offers, butt it's good enough for single or sequential inserts.
According to documentation

For LAST_INSERT_ID(), the most recently generated ID is maintained in the server on a per-connection basis. It is not changed by another client.

I think both handle_insert and handle_batch_insert could be implemented with LAST_INSERT_ID()

Diesel does not provide a LAST_INSERT_ID() query ast not out of the box, but you can simply define one in wundergraph using the no_arg_sql_function! macro

Thank you for pointing it out to me. I'm struggling with type casting yet. Unfortunately I couldn't figure out by my self how to solve this issue. May I ask your help for that?

So that's a really tricky one. On the surface that question is simple as we would only need to adjust those trait bounds to make this work. Below the surface there is a much more fundamental problem. Now that I look at that code again I remember why I've written the sqlite code that way and have not used LAST_INSERT_ID(). The issue there is basically, if we use LAST_INSERT_ID() we would restrict the implementation to entities with single integer primary key, not for all tables with some possible composite primary key. Getting that working for the general case in Sqlite is quite simple, as there is an "hidden" table column called rowid which is basically a INTEGER PRIMARY KEY AUTOINCREMENT primary key like column, so we can just order by that column and be done.
For MySQL it's unfortunately not possible because there is no such hidden column. Now we could try to emulate this behavior using the ROW_NUMBER() window function, but that does require sorting by id, which would loose insert order for the general case (Think of a Text/Uuid primary key here).
That all written down I'm not really sure what's the right way forward here. Possible solutions are:

Do not provide out of the box HandleInsert/HandleBatchInsert support for MySQL as it requires specific knowledge over the table
Restrict the HandleInsert/HandleBatchInsert impls to only work with tables with integer primary keys for MySQL. In this case we would need to check that it's possible to provide manual impl's for all other cases and document that accordingly. In this case you would need to change the constraints in such a way that they require the following:

T::PrimaryKey: Expression<SqlType = Integer>,
<&'static L as Identifiable>::Id: UnRef<'static, UnRefed = i32>,

remove everything related to the generic Id parameter + fix all compiler error messages.

Find some general solution for this problem, I've not came up with yet.

is the cheapest approach
is impossible for me yet because I've only few months of Rust experiences
52759f93d76c88ea94698ecf1f9ffe982b3cb24a contains an attempt to implement HandleInsert triet, which compiles error-free. Unfortunately even wundergraph_example can't be compiled on top of it. I'll appreciate any assistance in this regard

Your solution is basically that what I've proposed with my second point :wink: The consequences that tables with composite keys are not supported are kind of expected...

Your solution is basically that what I've proposed with my second point

Indeed, but I wasn't aware of the consequences for wundergraph_example.

Do you have any advice how this attempt to implement HandleInsert trait could be improved?

I think you don't need nearly as many generic constraints as you've used there to make this work for a concrete type. See this impls for example.

Indeed, this seems to be the right approach.

Restrict the HandleInsert/HandleBatchInsert impls to only work with tables with integer primary keys for MySQL. In this case we would need to check that it's possible to provide manual impl's for all other cases and document that accordingly. In this case you would need to change the constraints in such a way that they require the following:

T::PrimaryKey: Expression<SqlType = Integer>,
<&'static L as Identifiable>::Id: UnRef<'static, UnRefed = i32>,

In case of
https://github.com/weiznich/wundergraph/blob/ffbb883eea169d1750659e038d7051a84b21f6e7/wundergraph_example/src/lib.rs#L104-L109 for instance it would cause E0119
It looks like to move forward with #48 the only option I have:

Do not provide out of the box HandleInsert/HandleBatchInsert support for MySQL as it requires specific knowledge over the table

and provide implementation  of HandleInsert/HandleBatchInsert traits for all wundergraph_cli- and wundergraph_example-tables.
Do you agree?

If I remember correctly the PR to your repo I've linked above does choose a hybrid approach: It does implement HandleInsert/HandleBatchInsert for all tables that have an integer primary key + it provides specific impls in wundergraph_example for all tables that do not have a single integer key. It would be great to generate those, but for the first iteration I'm fine with just having some documentation that it could be required to write those manually and show how it is done.

If I remember correctly the PR to your repo I've linked above does choose a hybrid approach

I beg your pardon, I've completely overseen it is a PR. Such a pity! It would have save me some hours

In my opinion at least for CI sake wundergraph_bench should support MySql also.
I've started appropriate implementation but couldn't move further because I'm not aware how to deal with https://github.com/weiznich/wundergraph/blob/ffbb883eea169d1750659e038d7051a84b21f6e7/wundergraph_bench/src/api.rs#L555-L557
Souldn't the struct provide both two other fields like FilmActor?
https://github.com/weiznich/wundergraph/blob/ffbb883eea169d1750659e038d7051a84b21f6e7/wundergraph_bench/src/api.rs#L288

Sorry for taking that long to answer, but life is currently really busy here.

Souldn't the struct provide both two other fields like FilmActor?

Yes that struct should provide also the other two keys. Seems like this is a bug in wundergraph-cli, we should probably not skip not autoincrement primary keys anywhere. Could you fill an issue for that? Beside of that is fine for the mysql PR to just manually add the missing fields there.

There is absolutely no reason to say sorry! I see how busy you are with diesel, which obviously has higher priority.
Could you add bug label to the issue #55, please.

authors: p-alik weiznich

repo: weiznich/wundergraph


text:
Like to play

When I know what you are doing

https://github.com/weldingham

I am so lost on this game

repo: weldingham/reviewing-a-pull-request


text:
cockpituous: Fix srpm Release:

Use release-srpm's -V option [1] so that the generated srpm will get a
proper changelog and Release "1" instead of "2".
[1] https://github.com/cockpit-project/cockpituous/commit/abb2bdb5

The previous few releases I didn't realize this mistake, so I had to do the bodhi releases manually (as the release machinery expected "Release: 2"), and the current Fedora srpm has a poor changelog.
I locally ran cockpituous release scripts with this change, and it looks fine now.

Codecov Report

Merging #699 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #699      +/-   ##
==========================================
- Coverage   78.39%   78.24%   -0.16%
==========================================
  Files          66       66
  Lines        3324     3324
  Branches      684      684
==========================================
- Hits         2606     2601       -5
- Misses        718      723       +5

Impacted Files
Coverage Δ

components/Form/Password.js
85.71% <0%> (-2.39%)
:arrow_down:

core/sagas/inputs.js
71.42% <0%> (-1.03%)
:arrow_down:

core/selectors.js
92.96% <0%> (-0.79%)
:arrow_down:

core/sagas/blueprints.js
73.57% <0%> (-0.52%)
:arrow_down:

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 d52e7ae...b93344f. Read the comment docs.

authors: codecov-io martinpitt

repo: weldr/cockpit-composer


text:
Harmonise EBSCO and Sierra MatType codes

The materialType code is found in the leader. (character 6).  However, this is not necessarily the same value as the one in Sierra which we rely on to define MaterialTypes in the API. (The Sierra documentation states: "However, this data is customizable in Sierra and each organization determines the codes and strings for their system.")
e.g.  Sierra d means Journal, but d in MARC Leader 06 https://www.loc.gov/marc/bibliographic/bdleader.html is "Manuscript notated music".  We have several values of materialType that are not in the official list on Leader.
Journals from EBSCO have s in this position, and monographs m.
We need to map the values found here and/or in 008 to a value that corresponds with the one we use.
We may also need to do something about the label.
Originally posted by @paul-butcher in https://github.com/wellcomecollection/catalogue-pipeline/issues/2563#issuecomment-1978470058

Part of https://github.com/wellcomecollection/platform-infrastructure/issues/426

Closing as done.

authors: kenoir paul-butcher

repo: wellcomecollection/catalogue-pipeline


text:
Parse a handful more dates for the date filter

I was using the site, and spotted a slightly odd looking date on a works page: Feb.y 11th 1782 (https://wellcomecollection.org/works/kntad7tz)
Currently this work won't show up using date filters, because the parser doesn't recognise this month. This patch updates the date parser to recognise months like Feb.y, and other spellings that can be parsed unambiguously. It's a pretty small change given that current design of the parser, yay.
As part of this, I also did a little data wrangling to get a list of all the period labels currently in the catalogue API – to check there's nothing the parser crashes on, and to get an idea of what it currently can't parse.
Two discoveries of note:

It already parses ~80% of labels. There's some more low-ish fruit (e.g., but there aren't substantial gains to be made here. See unparseable_labels.txt
This change doesn't have a substantial impact on performance. On my very slow not-work laptop, it parses ~1M period labels in less than three minutes (about the same as before the patch).

mai is french isnt it?

mai is french isnt it?

Are things like mai expected for some wonderful reason, or is it something that collections info should fix?

I think what we're seeing isn't misspellings, but month names in other languages, e.g. "mai" is French for May. AIUI, Collections Info will often transcribe the date as written on the document, rather than converting it directly into the Gregorian calendar.

Are things like mai expected for some wonderful reason, or is it something that collections info should fix?

I think what we're seeing isn't misspellings, but month names in other languages, e.g. "mai" is French for May. AIUI, Collections Info will often transcribe the date as written on the document, rather than converting it directly into the Gregorian calendar.

authors: alexwlchan warrd

repo: wellcomecollection/catalogue


text:
Render items on exhibition properly in the item status on wc.org

When an item is on exhibition, there's information in the catalogue record to tell readers where the item is on exhibition, and when it's likely to be returned. We don't expose this information in the API or on the website, but we should.
e.g. https://wellcomecollection.org/works/gzgzm2sf
Compare the new site:

To the old site:

Oh yes, matching the "On Exhibition" Location
varFields is a List, so we'd have to filter the list for fields with tag 'r' (rather than copy the same techniques used for fixedFields)
https://github.com/wellcomecollection/scala-libs/blob/main/sierra/src/main/scala/weco/sierra/models/data/SierraItemData.scala

Yup.
We have some helpers for filtering var fields that you might find useful: https://github.com/wellcomecollection/scala-libs/blob/ec821ac48edcf9bdd653473ffc5c1e8673fdf950/sierra/src/main/scala/weco/sierra/models/SierraQueryOps.scala#L74-L82
(If you haven't come across it already: var/fixedfields are short for "variable-length fields" and "fixed-length fields", respectively. It's part of the MARC design that's very space-efficient.)

When there are multiple 'r' fields, how should they end up?
It seems like the wrong place to fully format something like an HTML UL, but the output field is a string, so there isn't much choice - either format it up here, or leave it as just a text list.

When there are multiple 'r' fields, how should they end up?

Good question!
Maybe join them with an HTML line break? The front-end will render whatever HTML we put in here, because the Catalogue pipeline/API is a trusted source (in turn because Sierra/our source systems are trusted).

Yes, I think that's right in the context of this ticket.
We can look at improving the layout in the future, but this ticket is simply a matter of getting the information out of the source database in whatever way makes sense.
Without being able to see and refine the eventual styling, I'd be reluctant to do something like a UL that could cause weird formatting errors.

Looking at the example, there are two 'r' fields.  It looks like the first one is irrelevant - it's from a long time ago, and it's for the Reading Room.
I suspect that the correct thing, therefore, is to only return the last reservation.  Can we rely on the order being meaningful?
    {
      "fieldTag": "r",
      "content": "02-04-15 ON RESERVE FOR Reading Room"
    },
    {
      "fieldTag": "r",
      "content": "27-09-21 ON RESERVE FOR Diseases: Curse of the past, threat to the future, Roemer- und Pelizaeus-Museum, Hildesheim, Germany, 1 October 2021 - 5 June 20"
    },

Hmm. I don't know if that's true in the general case. (We do have tools for exploring the Sierra data in bulk, which I can show you if it'd be useful.)
In this case I'd err on displaying both of them – it's more confusing to staff if we only display some of the record, because the rule may not be obvious to them. If there's a data quality issue we ask somebody in Collections & Research to correct the underlying record rather than working around it in our code.

what should happen in the absence of such a note - should it fall through to the "cannot be requested online" message, or should the note field be left blank?

Fall through to the default message; I think it's more useful than leaving an empty note.

Given the further requirement to filter out the ON/OFF RESERVE and CIRCED information, I notice that this could theoretically cause the output to have two identical lines, e.g.
2022-01-31 ON RESERVE FOR some exhibition
2022-02-01 OFF RESERVE FOR some exhibition CIRCED 2 TIMES

would become
some exhibition
some exhibition

Obviously, if it is off reserve, then it will not be on exhibition, so this branch won't be triggered.
However, I was concerned about things being exhibited multiple times. e.g.
2022-01-31 ON RESERVE FOR some exhibition
2022-02-01 OFF RESERVE FOR some exhibition CIRCED 2 TIMES
2022-01-31 ON RESERVE FOR some other exhibition

I have had a bit of a browse through the data for records with CIRCED (N>1) TIMEs, but in the ones I saw, I only discovered one each of ON and OFF reserve, implying that the upstream system replaces on and off reserve entries, rather than appends them.
However, I did discover at least one item that could suffer this problem in real life:
item 1704412 is marked as On Exhibition, and has both an ON and OFF RESERVE entry.  This means that it would get an access condition note that looks like this
Beauty and Belief: Crossing Bridges with the Arts of Islamic Culture. Brigham Young University, Provo. 24 February 2012 - 29 Sep.
Beauty and Belief: Crossing Bridges with the Arts of Islamic Culture. Brigham Young University, Provo. 24 February 2012 - 29 Sep.

I suspect that this is a data quality problem. It appears to have come off reserve in 2013, and it is has status.display: AVAILABLE, so it is probably caught by a case higher up in the match (not looked yet).

Actually, 2 out of 2 records I have just looked at are ON EXHIBITION with both ON and OFF RESERVE (1665446 looks like dummy data)

Yeah, so the data in the reporting cluster is imperfect in this regard – Sierra records can be suppressed (all the data is populated, but not available publicly) or deleted (gone forever).
Currently there's no way to tell if a record is suppressed from the varFields index – you need to look in the sierra_bibs index. That's how you can tell if it really is placeholder data.

It's live now.

I think we may wish to revisit this logic at some point in the future after we have seen it in action in a few records (and consulted with C&R). The implementation matches the behaviour of the old site, but I suspect that the reserves notes may be a partial historical record in chronological order, and anything other than the last note is probably not very informative for an end user (and may be misleading - in the case of gzgzm2sf, there is an implication that it is both in the Reading Room and in Germany). That said, it may simply be something to be handled in the source data.

authors: alexwlchan paul-butcher

repo: wellcomecollection/platform


text:
Do some pretty-printing in the "prepare" step

I'll extend this to the "deploy" step at some point, but this is still a step forward IMO:
Before:

After:

Awesome!

authors: alexwlchan kenoir

repo: wellcomecollection/weco-deploy


text:
Adding new content to homepage

What is it and who's it for?

Requested by content team
Need a way to add content links to homepage so that activities that fall outside our normal programme can be given some visibility

Danny says:

I can imagine that over the next few weeks we might be doing some things for which it's a legitimate consideration to have a link to on the home page if we understand that people aren't currently looking anywhere else on the site -- though there are of course other channels to promote them

Decisions as of 15/4/20:

This is a throwaway design solution for now; does not represent a massive design change to homepage
The top-of-page messaging will need to change in response to a phased reopening of Wellcome Collection
Limit the manual card group to 4 items.
Cards won't reflect live status, e.g. if it's an online event, it doesn't need the fully booked indicator

User story
In order to provide a current view of what's on online,
As a content editor
I need to be able to add links to internal and external content on the homepage.
This mechanism should be manual; the content team should be able to control this via Prismic, rather than hard-coding the links/cards
Sample content:
At the moment we have two hard coded text links:
Read our latest stories -->
Explore our digital collections -->
I can imagine that over the next few weeks we might be doing some things for which it's a legitimate consideration to have a link to on the home page if we understand that people aren't currently looking anywhere else on the site -- though there are of course other channels to promote them
Such things might be...
A new virtual tour of Play Well linked to from an existing page, text/link thus:
Take a virtual tour of Play Well [link to page on site]
A promo for an instagram zine workshop, text/link thus:
Join our live instagram zine workshop on 4 May [external link to insta story]
A promo for BBC's broadcast of Max Richter's Sleep
Drop off with Max, recorded live at Wellcome Collection [external link to BBC site]
A promo for an individual story on the site, text/link thus:
How did 17th century Londoners isolate themselves during the plague? [internal link to Story]
Implementation

Top-of-page message to be hardcoded; likely to have occasional updates but not frequently enough to make it editable in prism
Cards are directly editable.
Menu card includes Title, Summary, Image and Link (internal path or external link)
3 default size; 1 featured size card
Group header = What's online
Content team should be able to control the order of cards

Testing and tracking
Will want to monitor CTR from manual links where the link is internal (e.g. link from a card to a story)
Measurement

Related KPIs : Total pageviews

Homepage design on Zeplin:
https://zpl.io/VD0qXLg
zpl://screen?pid=5aab926b4b6efde01259e959&sid=5e970de00f36017ac7f868f3

@gestchild @davidpmccormick re: implementation - Do you have an idea of how you are going to fetch these from Prismic in a performant way given that we already fetch articles?

@taceybadgerbrook FYI this is now done in case you are keeping an eye on the home page during our closure

authors: GarethOrmerod jamesgorrie jennpb pollecuttn


text:
Slice Machine part 3

These were generated from our existing types using @slicemachine/init

These were generated using @slicemachine/init which pulled down what we had and generated the appropriate shape JSON for a Slice Machine project. They are what we'd push to the Prismic staging environment in order to test our Slice Machine work with data that is in the same shape as what we'll ultimately be using


text:
Stick with A condition after comics A/B test

Closes #9633

🅰 🅰 🅰

authors: alexwlchan davidpmccormick


text:
Handover: research and analytics to do list

Things to do for handover:

[x] create user research how we work doc (includes recruitment, tools, people to contact, locations of documents etc)
[x] update research tracker and move to sharepoint
[ ] update aurelius - insights specifically
[ ] update aurelius - add prototype images to 'docs' section
[ ] user research calendar - transfer ownership, see IT
[x] hand over dotdigital (dotmailer) to Hannah
[ ] review open github tickets
[ ] brief doc on how we run AB testing calculations
[ ] Stacks posts

Analytics:

[x] Heesoo GA recap
[x] Jenn GA recap
[x] Q3 report in data studio with Jenn
[x] data studio editorial hand over to Alice
[x] Hannah GA recap?
[x] transfer ownership of data studio dashboards to Jenn
[ ] GA audit (event tracking, goals, properties)
[x] document event tracking
[x] plot workType data on dashboard

For workType graph which is on the main wc dashboard, this will need updating as more worktypes are added.
To do this you need to:

click 'resource' on the top menu,
then 'manage added data source'
then select wc.org (main) and EDIT
scroll to the bottom of the list of blue and green things to the bottom where it should be green and say work type graph groupings. There's a little fx button that you need to click on to edit it.
here you can see the syntax. You need to add any new worktypes as they appear in GA in the brackets and then create a label that you want to display.

Alternatively --> just change the dimension to 'Work' on the graph. However this will have less readable labels but will have everything that's being collected.

IT ticket opened for the research calendar


text:
Rust is not company 读后感

https://wendajiang.github.io/essay/rust-is-not-company/

优秀

@ChestnutHeng
优秀

？？？ 你还过来偷窥

authors: ChestnutHeng wendajiang


text:
Oppo R9s 上没有通知

Oppo R9s 上点击 demo 上的按钮通知栏没有任何效果

发现是手机厂商默认关闭了应用通知，到 app 的通知管理中打开即可

repo: wenmingvs/NotifyUtil