How to avoid duplicate licenses with Parcel? - firebase

Is there a way to extract or duplicate the licenses when using Parcel (or Terser at it seems to be the underlying minifier)?
The terser webpack plugin seems have a custom option extractComments https://webpack.js.org/plugins/terser-webpack-plugin/#extractcomments then the comments will be stored to foo.js.LICENSE.txt
It seems I have 259 of the same repeated licence all over my bundle (all from Firebase, 2017/2020).
it would be nice to remove it. It seems I can compress all comments, but I think the license should remain, but only once.
/**
* #license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const Ea={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"};
/**
* #license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Da{constructor(e){this.jr=e.jr,this.Wr=e.Wr}zr(e){this.Hr=e}Jr(e){this.Yr=e}onMessage(e){this.Xr=e}close(){this.Wr()}send(e){this.jr(e)}Zr(){this.Hr()}eo(e){this.Yr(e)}no(e){this.Xr(e)}}

Related

Configure KafkaRoutingTemplate from Application yml file

we need to send the data to 2 topics which belongs to the two different servers. One is confluent offerings in Azure another is kafka cluster on azure VM.
Now we are using KafkaRoutingTemplate to send message to the 2 different Kafka Offerings.
But we create 2 producers/factory via config class ( coding) - Is there any way to configure 2 producers via application.yml file instead of coding
You can override the bootstrap servers in one of the templates; they can use the same producer factory, but you have to define the templates as beans.
/**
* Create an instance using the supplied producer factory and properties, with
* autoFlush false. If the configOverrides is not null or empty, a new
* {#link DefaultKafkaProducerFactory} will be created with merged producer properties
* with the overrides being applied after the supplied factory's properties.
* #param producerFactory the producer factory.
* #param configOverrides producer configuration properties to override.
* #since 2.5
*/
public KafkaTemplate(ProducerFactory<K, V> producerFactory, #Nullable Map<String, Object> configOverrides) {

Apple Export Compliance when using Libsodium and SSL (HTTPS)

Apple's explanation of the export compliance is rather difficult to understand and a complete mix of IT and Law-Knowledge making it difficult to connect to the correct people.
Our app uses:
Libsodium (using a flutter library, so not apple-default-encryption but open source)
Https/SSL/... which require no uploads to app store connect.
I couldn't find out if Libsodium is
- is accepted by international standard bodies (such as IEEE, IETF, or ITU)
Other Stackoverflow-Questions ("duplicates") do either not contain explicit Open-Source-Software or are missing helpful answers.

How can I update an Entity in Symfony 4 and API Platform

I'm using Symfony 4 with API Platform and I altered my existing Entity by adding some fields to it by running:
php bin/console Make:Entity
again.
After that I ran:
php bin/console doctrine:schema:update --force
and:
php bin/console cache:clear
Then I copied the Entity and the Repository to the Server and cleaned the cache there also.
After that I altered the SQL Table directly in the database reflecting the same as on my local side (where I ran migration).
When I now open my Swagger Documentation by travelling to /symfonysite/api/ on the server,
I can see the model altered correctly but the route examples (if you click on a route) does not reflect that.
Also when I do a GET Request with Postman, it's only returning the old Entity reflecting the old Model without the new added fields.
Can you point me out what is missing ?
What is your way to alter an Entity on production site?
Thanks in advice!
Ok, i finally got it, it was very simple.
To reflect the new model in the result, i had to add a group to my entity fields. Since its a get request i had to add the group "get" in the annotations
#Groups({"get"})
When i asked the question, my entity looked like this:
/**
* #ORM\Column(type="string", length=255, nullable=true)
*/
private $firstname;
Finally i fixed it by changing it to this
/**
* #ORM\Column(type="string", length=255, nullable=true)
* #Groups({"get"})
*/
private $firstname;

CRUD generation with composite key on Doctrine 2.2

I got a problem with the CRUD generation on Doctrine. I saw that the composite keys have been implemented since version 2.1. I got a few tables that are identified with such keys but when I try to generate the code with the command php app/console generate:doctrine:crud it send me back the following error: "The CRUD generator does not support entity classes with multiple primary keys."
Should I code my CRUD from scratch or is there a workaround to generate them?
Doctrine doesnt support composite keys, you could just use a new primary key:
/**
* #ORM\Id
* #ORM\Column(name="id", type="integer")
* #ORM\GeneratedValue
*/
private $id;

Symfony 2 bundle dependency issue

I created a bundle to manage user-group-permissions. I want it to make project independent by moving it into the vendors directory.
To make this bundle immutable I moved the users data into a usermeta bundle.
The main bundle contains username and email only about the user, and usermeta contains everything else (name, birthdate etc. whatever a project require).
The problem is the main user bundle intended to belong to a core bundle group, from which every project using the same.
The user-usermeta relation now created a dependency. So every project will need it.
My question is
- How can I standardize its format, to enforce in every project create it properly.
- How can I make this dependency optional (preferred)
I suggest you only handle a UserInterface instead of a User entity in your bundle.
In case of Symfony UserInterface doesn't implement everything you need (username but no email), create your own UserInterface in your bundle :
namespace YourDomain\YourBundle\Interface;
use Symfony\Component\Security\Core\User\UserInterface as BaseInterface;
/**
* UserInterface is the interface that user classes must implement.
*/
interface UserInterface extends BaseInterface
{
/**
* Returns the email address of the user.
*
* #return string The user email address
*/
function getEmail();
}
And then, in the projects using your bundle, your User entity must implements your specific interface instead of Symfony UserInterface.

Resources