Giter VIP home page Giter VIP logo

jinqu's People

Contributors

codacy-badger avatar dependabot[bot] avatar solenya-group avatar umutozel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jinqu's Issues

ofType broken?

The following:

[1,"two",3].ofType(Number)

Won't compile. And even if it could, you really want number, not Number.

See:
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html

And also:
https://www.typescriptlang.org/play/#src=var%20x%3Anumber%3B%0Avar%20y%3ANumber%3B%0Ay%20%3D%20x%3B%20%2F%2F%20okay%20%0Ax%20%3D%20y%3B%20%2F%2F%20not%20okay%20

Repro:
https://stackblitz.com/edit/jinqu-oftype?file=index.ts

Thinking out loud, but the possible categories of types are:

  • Primitive Types
  • Class Types
  • Structures

The only category of types that can actually just work here are class types. The other categories don't have runtime type information. One strategy I've eventually become comfortable with in such scenarios has been to allow the caller to provide a default or "guide" type:

[1,"two",3].ofType(0) // numbers
[1,"two",3].ofType("") // strings

Keep npmjs readme in sync with github readme

For the projects I've worked on, I just use the same directory to publish to npm as to publish to github, so no need to worry about keeping the two in sync. (Sometimes the docs will be slightly less up to date, as sometimes docs are updated in github without an npm publish, but this isn't a big deal).

You can have a .npmignore file if different from the .gitignore file.

  • obviously also true for the other projects (jinqu-odata).

Bundle Warnings, Add IE 11 support

Getting a large number of warnings when running a web app when using the jinqu package, perhaps due to source map issues, in the Chrome window (pasted below).

If it helps, here's the webpack config that will work with source maps that need double translations (so they go from typescript to javascript, and then javascript to bundled javascript):
https://github.com/solenya-group/solenya-aspnetcore-starter/blob/master/webpack.config.js

So if you reference Solenya package, and hit F12 in chrome, go to the Sources tab, then Page, you can debug Solenya .ts files in the webpack://./node_modules/solenya/src directory

Anyway, here's the warnings:

[HMR] bundle has 12 warnings

./node_modules/jokenizer/dist/lib/ExpressionVisitor.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/ExpressionVisitor.ts': Error: Can't resolve '../../lib/ExpressionVisitor.ts' in 'C:\Code\feesmonthly\node_modules\jokenizer\dist\lib'./node_modules/jinqu/dist/lib/ajax.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/ajax.ts': Error: Can't resolve '../../lib/ajax.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist\lib'./node_modules/jinqu/dist/lib/array-extensions.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/array-extensions.ts': Error: Can't resolve '../../lib/array-extensions.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist\lib'./node_modules/jinqu/dist/lib/array-query-provider.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/array-query-provider.ts': Error: Can't resolve '../../lib/array-query-provider.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist\lib'./node_modules/jokenizer/dist/lib/evaluator.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/evaluator.ts': Error: Can't resolve '../../lib/evaluator.ts' in 'C:\Code\feesmonthly\node_modules\jokenizer\dist\lib'./node_modules/jinqu/dist/lib/query-part.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/query-part.ts': Error: Can't resolve '../../lib/query-part.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist\lib'./node_modules/jinqu/dist/lib/queryable.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/queryable.ts': Error: Can't resolve '../../lib/queryable.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist\lib'./node_modules/jokenizer/dist/lib/tokenizer.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/tokenizer.ts': Error: Can't resolve '../../lib/tokenizer.ts' in 'C:\Code\feesmonthly\node_modules\jokenizer\dist\lib'./node_modules/jokenizer/dist/lib/types.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../../lib/types.ts': Error: Can't resolve '../../lib/types.ts' in 'C:\Code\feesmonthly\node_modules\jokenizer\dist\lib'./node_modules/jinqu/dist/index.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../index.ts': Error: Can't resolve '../index.ts' in 'C:\Code\feesmonthly\node_modules\jinqu\dist'./node_modules/jokenizer/dist/index.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file '../index.ts': Error: Can't resolve '../index.ts' in 'C:\Code\feesmonthly\node_modules\jokenizer\dist'./node_modules/reflect-metadata/Reflect.jsModule Warning (from ./node_modules/source-map-loader/index.js):(Emitted value instead of an instance of Error) Cannot find source file 'Reflect.ts': Error: Can't resolve './Reflect.ts' in 'C:\Code\feesmonthly\node_modules\reflect-metadata'

asQueryable

Apologies for logging an issue for what might just be a documentation question, but what's the purpose of asQueryable (and q)?

In other words, what's the difference between these two lines:

[1,2,3].where (x => x % 2 == 0)
[1,2,3].asQueryable().where (x => x % 2 == 0)

String interpolation?

Not sure if I have a mental block here, but I'm wondering why this is necessary:

const filtered = orders.where('c => c.id > value', { value: 3 })

As opposed to simply using string interpolation:

const value = 3
const filtered = orders.where(`c => c.id > ${value}`)

toArray return type

A very common pattern is to have a function ending with toArray. My expectation was that the type signature would be T[], but the type signature is an intersection type between T[] and InlineCountInfo. So have to add boilerplate to explicitly modify the return type, otherwise the signature is polluted. This seems to break the 90/10 principle, as the vast majority of the time you don't care about getting the inline count.

Less self-effacing tagline

Instead of:

Yet another Linq for JavaScript. Supports string expressions.

"The ultimate Javascript LINQ API"

Cause it's true.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.