I know FullCalendar can use multiple sources. I am able to get a great render using one ICS url. Is it possible to use multiple ICS files?
I just got it! It was the syntax that I couldn't get right....
eventSources: [
{
url: "https://www.gov.uk/bank-holidays/england-and-wales.ics",
format: "ics",
},
{
url: "https://www.gov.uk/bank-holidays/england-and-wales.ics",
format: "ics",
}
]
Related
I am currently looking for a way to track time (in ms/sec) spent on Next.js building steps and write this information into json file. So in the end I would like to have something like
{
"js": 10000,
"css": 5000,
...
}
I could not find any tools available for solving this task.
There is also a /.next/trace file created during "next build" and containing some data like
[{"traceId":"0350c99bb05551a7","parentId":"2071643884994g71","name":"build-module-json","id":"89936a6d306d4411","timestamp":13930168804,"duration":6869574, ...}]
but Im not sure if its data could be useful as there is no detail information on this file in docs.
Thanks for any help in advance
found a solution speed-measure-webpack-plugin
I have a form with the following super basic file field:
Schema-
"file_upload": {
"type": "string"
}
Options-
"file_upload": {
"type": "file"
}
I want to access the file uploaded somehow, but particularly through Handlebars.js.
A regular field, say "file_checkbox" can be rendered using {{file_checkbox}} in handlebars but I can not figure out how to access the file.
Using basic javascript (document.getElementById('fieldId').files), I can see that the file has uploaded as anticipated.
But, trying to get the value of the Alpaca Form ($.alpaca($("#formDiv")).getValue()) yields the data from the regular fields (i.e. file_checkbox) and nothing from the file field.
When I submit the alpaca form all of the other data is properly saved, but again nothing from the file field (not even the name of the field with an empty/nil value)!
I've spent many hours searching and haven't found anything on the Alpaca website, Github Issues, or stack overflow! This is my first question so please let me know if there is any additional information I can provide.
Thank you!
That's normal with Alpaca, there will be no data for your file input set in your form data object, you should use the function selectionHandler to set the file(s) selected (you can use either File or Base64 data) to your form data like this :
"file-upload": {
"type": "file",
"selectionHandler": function(files, data) {
// files for multiple or use files[0] to get only one file
// and if you want to use base64 data you could use data
this.data = files;
}
}
And here's a fiddle for that.
Hi there I have been forced to come here due to every resource out there on the topic is very poor and incomplete.
Not only on the babel site but every single post out there is not complete and informative enough.
I tried to reach out at the babel forum and no replies.
I am trying to convert my prototype libraries to Es6 and convert to the most leanest possible code. So no bloaty duplicated generated code and if possible no bloaty requirejs and whatever browserify generates.
I have tried to make a project with grunt and babel directly, configure the external-helpers plugin according to the babel documentation.
It fails to include the relevant helper code and fails to include the import module code altogether.
ie a babel config like
{
options: {
sourceMap: false,
presets: ['es2015'],
"plugins": ["external-helpers"]
},
dist: {
files: {
'build/<%= package.name %>.js': ['src/<%= package.name %>.js']
}
}
}
The main project file has an import like
import Button from './ui/buttons/Button';
The module code looks like this as if the export is placed underneath extra code is generated for that.
export default class ShareButton {}
produces an output like this
Object.defineProperty(exports, "__esModule", {
value: true
});
require('babel-core/external-helpers');
var _Button = require('./ui/buttons/Button');
var _Button2 = babelHelpers.interopRequireDefault(_Button);
No source of the module or the helper object is included.
I searched hard for how to deal with external-helpers and it suggests it has to be imported into a separate file ie something like this to generate only the helper functions needed
babel-external-helpers -l createClass > src/helpers.js
But any resource regards to this fails to go as far as to how to import that into the project.
If I use the transform-runtime plugin, it produces a massive polyfill that cannot be disabled so a bug and not so useful for what I need.
"plugins": [
["transform-runtime", { "polyfill": false, "regenerator": false }]
]
If I use browserify / babelify it makes a royal mess and duplicates code still.
A config like
{
options: {
"transform": [["babelify", {
"presets": ["es2015"],
"plugins": ["external-helpers"],
sourceMap: false
}]]
},
dist: {
files: {
'build/<%= package.name %>.js': ['src/<%= package.name %>.js']
}
}
}
Produces code like this still with the external helper missing and duplicated code not relevant to the helper. ie
Object.defineProperty(exports, "__esModule", {
value: true
});
Is within every module in the generated file.
If I export the classes like this at the bottom of every file
export default class {}
Duplicated code is generated like
var _class = function _class() {
babelHelpers.classCallCheck(this, _class);
};
exports.default = _class;
In terms of filesize that doesn't include bloaty wrapping code like
},{}],2:[function(require,module,exports){
It seems concatting all the prototype classes files together to bundle in one file is the winner still.
So trying to port the library but keep it similar and bundle it together into one file.
Hopefully this is concise enough and there is a simple solution.
FYI browsers do not understand tabs and 4 spaces. I had to edit this post in my editor to get the code blocks working ! It would be nice to have a markup like other places like "```" ?
Let me know thanks.
I'm using rollup with babel now. Rollup produces a clean output as umd mode. Browserify is really bloaty in itself.
There is just a problem with polyfills being converted. I have to concat external ones in like for WeakMap.
I had a problem trying to use the generated Iterator and finding a polyfill for that so I have to code loops a particular way it doesn't generate Iterators.
The polyfill generation in babel is still too bloaty and crazy. It's pretty terrible. So I concat in minified polyfills that are very small and it's used globally.
I was running into something very similar. Was tired of trying to do it the "right way" and ended up just creating https://www.npmjs.com/package/grunt-babel-helpers which simply manipulates the string output.
I am using assemble (https://github.com/assemble/assemble) via a grunt plugin to build static pages.
I have been using grunt for a while now so understand how it all works, yet this is my first time using assemble so I looked at this for ref (http://blog.parkji.co.uk/2013/07/06/building-a-static-site-using-grunt-and-assemble.html). Everything seemed to be working fine.
However, I want to introduce JSON data to the mix and have looked at the docs on the assemble site (http://assemble.io/docs/Data.html) yet after I run 'grunt assemble' it doesnt render the json data :(
My gruntfile
assemble: {
options: {
layout: "src/responsive/layouts/default.hbs",
data: 'src/responsive/data/**/*.json',
flatten: true
},
pages: {
files: {
'src/': ['src/responsive/pages/*.hbs']
}
}
},
test json:
{
"name ": "This is a square widget" ,
"modifier ": "widget-square"
}
and folder structure:
- data
-- index.json
- layouts
-- default.hbs
- pages
-- index.hbs
Within pages/index.hbs I am trying to call {{ index.name }} or simply {{ name }} (I have tried both) to no avail.
Im pulling my hair out as grunt is giving no errors (and in fact if I make json not valid grunt complains so it is reading it).
Any help much appreciated before I go crazy....
Thanks,
Adrian
Your JSON here is the issue. You had extra spaces in your keys. Your JSON should be formatted as the following:
{
"name": "This is a square widget",
"modifier": "widget-square"
}
I have a number of backbone apps all hosted on the same site. I am attempting to use grunt-manifest to generate appcache manifests for them. It generates the manifest file, but the links are wrong. I want each app to have a separate manifest file.
For example say I have an app called 'hello', it would be accessed via this url:
mydomain.com/apps/hello
so the main js and css files would be at:
mydomain.com/apps/hello/app.js
mydomain.com/apps/hello/style.css
etc.
There are also some shared components, found at say:
mydomain.com/shared/shared.js
(I dynamically load these with require.js so don't want to concat into the main app.js)
I specify the manifest in grunt like this:
manifest: {
generate: {
options: {
basePath: '<%= gconf.dist_dir %>/',
timestamp: true,
network: ['*'],
},
files: [
{
cwd: 'public/',
src: [
'apps/hello/*',
'shared/*',
// etc
],
dest: '<%= gconf.dist_dir %>/public/apps/hello/manifest.appcache' },
]
}
},
I believe the issue is I am trying to get grunt-manifest to generate an appcache manifest for a portion of a site not the root site. The manifest i get looks like this:
CACHE
apps/hello/app.js
apps/hello/style.css
shared/shared.js
When I load the page - the manifest retrieval fails because it is trying to access links like this:
mydomain.com/apps/hello/apps/hello/app.js
If I manually edit the manifest files and add a '/' in front of everything so it looks like this:
CACHE
/apps/hello/app.js
/apps/hello/style.css
/shared/shared.js
...then it all works.
The issue obviously being the manifest creating relative links, when I want them from the root.
I cannot for the life of me figure out how to get grunt-manifest to create these for me with a '/' in front.
I've tried experimenting with 'basePath' on its own, 'cwd' on its own, a combination of the two. If I leave the '/' off the end of say basePath or cwd and try adding it in the 'src' it doesn't work and I get an empty CACHE section.
I'm sure there must be an easy way of doing this with the grunt globing patterns, but I just can't work it out.
Any ideas?
(also - not enough rep to create a new tag, but a 'grunt-manifest' tag might be useful for others in the future)
I just ecnountered the same issue.
I've forked the module here: https://github.com/killfish/grunt-manifest
If you pass in the option absolutePath : true, it will prepend a '/'
options: {
**absolutePath: true,**
network: ['http://*', 'https://*'],
preferOnline: true,
verbose: true,
timestamp: true
},