add rollup plugin for building citation
🦋 Changeset detected
Latest commit: faf6cce5e42e4c20637022cfa7d4d623725268d4
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 58 packages
| Name | Type |
|---|---|
| @jspsych/plugin-serial-reaction-time-mouse | Minor |
| @jspsych/plugin-canvas-keyboard-response | Minor |
| @jspsych/plugin-audio-keyboard-response | Minor |
| @jspsych/plugin-image-keyboard-response | Minor |
| @jspsych/plugin-video-keyboard-response | Minor |
| @jspsych/plugin-canvas-button-response | Minor |
| @jspsych/plugin-canvas-slider-response | Minor |
| @jspsych/plugin-html-keyboard-response | Minor |
| @jspsych/plugin-audio-button-response | Minor |
| @jspsych/plugin-audio-slider-response | Minor |
| @jspsych/plugin-image-button-response | Minor |
| @jspsych/plugin-image-slider-response | Minor |
| @jspsych/plugin-initialize-microphone | Minor |
| @jspsych/plugin-video-button-response | Minor |
| @jspsych/plugin-video-slider-response | Minor |
| @jspsych/plugin-categorize-animation | Minor |
| @jspsych/plugin-html-button-response | Minor |
| @jspsych/plugin-html-slider-response | Minor |
| @jspsych/plugin-same-different-image | Minor |
| @jspsych/plugin-serial-reaction-time | Minor |
| @jspsych/plugin-visual-search-circle | Minor |
| @jspsych/plugin-webgazer-init-camera | Minor |
| @jspsych/plugin-html-audio-response | Minor |
| @jspsych/plugin-html-video-response | Minor |
| @jspsych/plugin-same-different-html | Minor |
| @jspsych/plugin-survey-multi-choice | Minor |
| @jspsych/plugin-survey-multi-select | Minor |
| @jspsych/plugin-webgazer-calibrate | Minor |
| @jspsych/extension-mouse-tracking | Minor |
| @jspsych/plugin-initialize-camera | Minor |
| @jspsych/plugin-webgazer-validate | Minor |
| @jspsych/plugin-categorize-image | Minor |
| @jspsych/plugin-survey-html-form | Minor |
| @jspsych/plugin-virtual-chinrest | Minor |
| @jspsych/extension-record-video | Minor |
| @jspsych/plugin-categorize-html | Minor |
| @jspsych/plugin-reconstruction | Minor |
| @jspsych/plugin-browser-check | Minor |
| @jspsych/plugin-call-function | Minor |
| @jspsych/plugin-external-html | Minor |
| @jspsych/plugin-mirror-camera | Minor |
| @jspsych/plugin-survey-likert | Minor |
| @jspsych/plugin-instructions | Minor |
| @jspsych/extension-webgazer | Minor |
| @jspsych/plugin-survey-text | Minor |
| @jspsych/plugin-fullscreen | Minor |
| @jspsych/plugin-animation | Minor |
| @jspsych/plugin-free-sort | Minor |
| @jspsych/plugin-iat-image | Minor |
| @jspsych/plugin-sketchpad | Minor |
| @jspsych/plugin-iat-html | Minor |
| @jspsych/plugin-maxdiff | Minor |
| @jspsych/plugin-preload | Minor |
| @jspsych/plugin-resize | Minor |
| @jspsych/plugin-survey | Minor |
| @jspsych/plugin-cloze | Minor |
| jspsych | Minor |
| @jspsych/config | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@jodeleeuw When you updated the dependencies, including esbuild from 0.15.14 to 0.23.1 in 59ce0b3, did you read the changelogs? There seem to be a lot of breaking changes in esbuild and we need to be confident that they are not breaking for @jspsych/config users (unless you are planning to release a config v4 for any other reason :thinking: ). I didn't get suspicious about this earlier because your commit message didn't make it clear to me that you were updating dependencies :see_no_evil:
@jodeleeuw I double-checked and committed the rollup dependency updates in #3396 – they're all welcome and independent of the .json issue. Re that issue: Because we are using esbuild via the rollup plugin, the final bundling is performed by rollup. esbuild never sees @citation-js/core/package.json, hence can't run its JSON loader on it. Your workaround with the additional Rollup JSON loader is good for now, although the more desirable solution might be to inline the version string right in the citation-js build (like most other packages do too). I'm too busy to contribute there ATM though :confused:
@bjoluc just FYI, we ended up solving this by using @rollup/plugin-replace. We explored the esbuild define, but it required adding some declare const statements at the top of the plugin ts templates and that felt unnecessarily confusing for rookie devs.
but it required adding some declare const statements at the top of the plugin ts templates and that felt unnecessarily confusing for rookie devs.
Have you thought about declaring the constants globally in a .d.ts file in @jspsych/config, referenced by the exported tsconfigs?
Also, what about replacing a single __CITATIONS__ object? That would allow to add other formats at a later point without changing all the plugins, while further reducing boilerplate.
Have you thought about declaring the constants globally in a .d.ts file in @jspsych/config, referenced by the exported tsconfigs?
For some reason I thought this kind of strategy wouldn't work, but can't reconstruct my reasoning now. We can explore it!
Also, what about replacing a single CITATIONS object? That would allow to add other formats at a later point without changing all the plugins, while further reducing boilerplate.
This was something that crossed my mind. I was thinking that the current boilerplate makes it easier for someone building with the JS template to modify because they won't have to know the syntax, but then again we could just have a different template for plugins that aren't going to go through the build process. So that does seem better.
@cherriechang I'd like to get this merged soon. We need some docs still I think.
@jadeddelta we could also include the CFF files in the v8 update for the contrib repo?
Hi all, I just received the notification mail and had a quick look at the diff. I think I would much prefer replacing a __CITATIONS__ reference (with a global TS definition) over replacing a '__CITATIONS__' string as IMO with the former variant the intention is clearer and the typing more consistent. Just posting the wish here, guessing that you have most likely had good reasons to rule that path out...