arnaudbuchholz / gpf-js Goto Github PK
View Code? Open in Web Editor NEWA multi-purpose JavaScript library
Home Page: http://gpf-js.blogspot.com/
License: MIT License
A multi-purpose JavaScript library
Home Page: http://gpf-js.blogspot.com/
License: MIT License
Related to Issue 17
As described here
But then I need the lib to detect browser version (which is not done yet).
See default test case
Looks like I have to transmit gpf handler (like for class constructors)
Due to the way _next are called within _next
Related to Issue 17
This is why the XML test does not work in DEBUG mode: the _Base class is no more the one from XML but it became the one from HTML.
I need to isolate those names the proper way.
The idea would be to wrap the gpf.define in order to keep the definition object and return a wrapper function that would finalize the class generation and instantiate an object if new is used.
It looks like the $XmlList attribute is ignored since the class rewriting
Need to check why.
Related to Issue 17
When an URL is on several lines (because of the max 80 width), Safari inserts a %0A character for each carriage return. They should be escaped.
Related to Issue 17
The same way gpf.forEach is capable of doing array::forEach and an equivalent for objects, the following helpers could be used:
Today, the IXmlSerializable interface allows any class to customize the XML serialization. When XML attributes are used, this is handled internally. However, there is no call made to 'toXml' on sub objects. As a result, any custom XML serialization would be skipped.
This has to be handled.
To work properly, attributes rely on several mechanism that are related to gpf.Class inheritance. The same way, they are 'declared' within gpf.Class.extend.
If we want to use attributes outside of this scope, we might need to change the gpf.attributes.add method to verify if the prototype comes from a gpf.Class base. If not, we might have to create specific handling.
When minifying the websvr.js, I found that the buffer variable defined in ResponseHandler::fromFile was not replaced with its minified name inside the fs.open callback. This is due to the above write function that declares the buffer parameter.
I need to change the minification to handle that properly.
Found a bug in the test.html page that uses the gpf global as if it exists when it coul dbe undefined (because executed just after loadGPF)
The issue comes from the way a group with a minCount is handled: (a|bc)(de)+
When the input "e" is recognized, the group is considered validated (hence we have a result of 4), we must then branch the analysis between:
This is actually not used (like any Pattern class) but will become required for identifier parsing ([a-z][a-z0-9_]*)
It appears that when I implemented mochaTest, all tests can't be chained because the library alters global objects. I need to figure out a way to limit the impacts on the JavaScript ecosystem: either by providing a way to CLEAN or by being COMPATIBLE with myself (but then, how do I test properly)
When the JavaScript code contains <, > or &, the innerHTML method returns <, > and &. As a result, the code includes those entities instead of the original characters.
This comes from the string parsing that is not taking into account carriage returns
Polyfills exist and these are nice tools.
Check for instanceof compatibility.
Looks like the UMD loader does not work properly in PhantomJS
As I removed gpf.defer to replace it with setTimeout, I should provide handlers for any 'standard'-to be objects: JSON, atob, btoa...
Because _toBaseAny is not using binary operations, it gives toHexa(-1) = '0'
Should be an attribute that extends a class to expose an EventDispatcher interface (with dispatchEvent, addEventListener, removeEventListener)
Could be used to restrict usage of properties, such has (naming to be defined)
gpf.$enum("a", "b", ...)
gpf.$range(from, to)
gpf.$notEmpty()
And defines a gpf.check to apply validation rules (each check must generate a custom error message).
I could use it for Parameter loading.
Found a bad condition inside debug.js that doesn't wait properly for everything to be loaded (waitForBootstrap, condition on gpf._sources and gpf.include)
I must control the data flow to fit the GPF model (i.e. when the first read is called, we start reading from the stream).
see test case define/gpf.define/validate definitions/generates constructor functions
Suspecting new inheritance model
In the tokenizer, the "symbol" type is used for single characters only (one among (){}[]<>|&?,.;:!=+-*/%^). However, I would like the tokenizer to be able to detect JavaScript operators, i.e. ==, ===, ++, -- ...
It generates the error EncodingNotSupported: Encoding not supported
I suspect an issue with scope management in the different callbacks.
Need to debug.
This would clearly be a part of the XML implementation but could be reused for other parts such as file storage, ...
Related to Issue 17
Another test
Such as forEach, filter, every, map...
This has to be tested again as it was found 2 years ago (!).
One workaround would be to use XHR to load the script source and add a script tag inside the head (and finally remove it). Must evaluate the impacts before implementing (knowing that we rarely need to load a script that does not exist).
Initially, the gpf.interfaces.IXmlContentHandler
was designed to be synchronous. However, the reality is that it could be used to write on a stream (that would implement gpf.interfaces.IWritableStream
).
So the whole XML serialization code must be rewritten to handle that asynchronism (and avoid as much as possible the use of closures).
I want to be compatible with existing test frameworks.
The idea would be to describe the tests as in Mocha:
describe('User', function(){
describe('#save()', function(){
it('should save without error', function(done){
var user = new User('Luna');
user.save(function(err){
if (err) throw err;
done();
});
})
})
})
The trick here is if the callback has one parameter, then it is asynchronous.
Then, I could implement my own framework (based on what exist) to start with.
I need to change the tokenizer to remove the use of exceptions as it breaks unexpectedly inside the debugger. Also, It would be better to fit the Parser model.
Related to Issue 17
This will be necessary for Pokemul (http://buchholz.free.fr/PokeMul/)
When the following code is generated:
<path>
A closing tag is also generated (I suspect the use of innerHTML)
Using the falsy result is not enough.
Create an internal function (and apply it everywhere)
Related to Issue 17
Related to Issue 17
$ClassAttribute (ClassAttributeAttribute) to limit attribute to Class handling
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.